star-cad

Geometric operators for computer-aided design
git clone git://git.meso-star.fr/star-cad.git
Log | Files | Refs | README | LICENSE

commit b3e3af653cdbdcd3b2c0cb44ec11d1bb5c951c3c
parent aa56ff24cf73d0af653b4a72bc050a5706b81540
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Thu, 12 Dec 2024 09:54:21 +0100

Add an API call to get current values for options

Diffstat:
Msrc/scad.h | 4++++
Msrc/scad_device.c | 32+++++++++++++++++++++++++++++---
2 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/src/scad.h b/src/scad.h @@ -169,6 +169,10 @@ SCAD_API res_T scad_set_options (const struct scad_options* options); /* May be NULL: set default */ +SCAD_API res_T +scad_get_options + (struct scad_options* options); + /******************************************************************************* * Geometry API - A geometry is a primitive, a group of primitives, or the * result of an operation on geometries. diff --git a/src/scad_device.c b/src/scad_device.c @@ -679,15 +679,16 @@ scad_set_options dev = get_device(); keep = dev->options; - SET_GMSH_OPTION_INT(Mesh.Algorithm); - SET_GMSH_OPTION_INT(Mesh.MeshSizeExtendFromBoundary); SET_GMSH_OPTION_DOUBLE(Mesh.MeshSizeFactor); SET_GMSH_OPTION_DOUBLE(Mesh.MeshSizeFromCurvature); - SET_GMSH_OPTION_INT(Mesh.MeshSizeFromPoints); SET_GMSH_OPTION_DOUBLE(Mesh.MeshSizeMax); SET_GMSH_OPTION_DOUBLE(Mesh.MeshSizeMin); SET_GMSH_OPTION_DOUBLE(Mesh.Smoothing); SET_GMSH_OPTION_INT(Mesh.StlOneSolidPerSurface); + SET_GMSH_OPTION_INT(Mesh.MeshOnlyVisible); + SET_GMSH_OPTION_INT(Mesh.Algorithm); + SET_GMSH_OPTION_INT(Mesh.MeshSizeExtendFromBoundary); + SET_GMSH_OPTION_INT(Mesh.MeshSizeFromPoints); SET_GMSH_OPTION_INT(General.Verbosity); SET_GMSH_OPTION_INT(General.ExpertMode); @@ -715,4 +716,29 @@ error: goto exit; } +#undef SET_GMSH_OPTION_INT #undef SET_GMSH_OPTION_DOUBLE + +res_T +scad_get_options + (struct scad_options* options) +{ + res_T res = RES_OK; + struct scad_device* dev = NULL; + + if(! options) { + res = RES_BAD_ARG; + goto error; + } + + ERR(check_device(FUNC_NAME)); + + dev = get_device(); + + *options = dev->options; + +exit: + return res; +error: + goto exit; +}