commit 42c7afa249659bd354c34f6e9d2410c063901527
parent 420f9185bc1446e267e621f3f125cd7302354c16
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Fri, 20 Oct 2023 10:33:30 +0200
Add a warning when get_[partial]_data collects no triangle
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/scad.c b/src/scad.c
@@ -352,7 +352,7 @@ scad_stl_get_data_partial
size_t* nodeTags = NULL;
double* coord = NULL;
double* pCoord = NULL;
- size_t i, tcount, sz, dsz = 0;
+ size_t i, count0, tcount, sz, dsz = 0;
int ierr = 0;
int *data, *ddata = NULL;
struct scad_device* dev = get_device();
@@ -390,7 +390,7 @@ scad_stl_get_data_partial
}
/* Collect triangles */
- tcount = darray_double_size_get(triangles);
+ count0 = tcount = darray_double_size_get(triangles);
for(i = 0; i < sz; i++) {
size_t j, coord_n, pCoord_n, nodeTags_n;
const int type = 2; /* 3-node triangles (see src/common/GmshDefines.h) */
@@ -421,6 +421,10 @@ scad_stl_get_data_partial
gmshFree(pCoord); pCoord = NULL;
}
ASSERT(tcount == darray_double_size_get(triangles));
+ if(count0 == tcount) {
+ log_message(dev, "No triangle collected for geometry '%s'.\n",
+ str_cget(&geometry->name));
+ }
exit:
if(!allocator) {