star-cad

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

commit 83eee983fd8c4b25f0ef0f1ef9f6a13b7962ccf9
parent dde4f0cd14dce6a1c1a2e4d335010ed793d3bbd0
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date:   Fri,  2 Sep 2022 11:27:53 +0200

Rename geometry get size to get count

Diffstat:
Msrc/scad.h | 6+++---
Msrc/scad_geometry.c | 9+++++----
2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/scad.h b/src/scad.h @@ -96,11 +96,11 @@ SCAD_API res_T scad_scene_clear (void); -/* `size' is the number of primitives of the geometry `geom' */ +/* Get the number of connex components of the geometry `geom' */ SCAD_API res_T -scad_geometry_get_size +scad_geometry_get_count (const struct scad_geometry* geom, - size_t* size); + size_t* count); /* Add a rectangle to the scene, defined by a point `xyz' and * `dxdy' the extents along the x-, y-axes. */ diff --git a/src/scad_geometry.c b/src/scad_geometry.c @@ -164,17 +164,18 @@ error: } res_T -scad_geometry_get_size +scad_geometry_get_count (const struct scad_geometry* geom, - size_t* size) + size_t* count) { res_T res = RES_OK; - if (!geom) goto error; + if(!geom || !count) goto error; ERR(check_device()); - *size = geom->gmsh_dimTags_n / 2; + ASSERT(geom->gmsh_dimTags_n % 2 == 0); + *count = geom->gmsh_dimTags_n / 2; exit: return res;