commit 36686c6b5bb6ebf7b97ece39794c3c4a88614939
parent 9e0520ca193d05c6b4b2d0d39d1c375f0c8951db
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Mon, 8 Feb 2021 09:51:31 +0100
Add an error message for some ill-formed scenes
Diffstat:
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/src/sdis_scene_Xd.h b/src/sdis_scene_Xd.h
@@ -24,6 +24,9 @@
#include "sdis_scene_c.h"
#include <star/ssp.h>
+#include <star/senc2d.h>
+#include <star/senc3d.h>
+
#include <rsys/cstr.h>
#include <rsys/float22.h>
#include <rsys/float33.h>
@@ -569,7 +572,23 @@ XD(run_analyze)
/* With il-formed scenes, scene creation can success without being able
* to extract enclosures; in this case just fail */
res = sencXd(scene_get_enclosure_count(senc_scn, &count));
- if(res != RES_OK) goto error;
+ if(res != RES_OK) {
+ count = 0;
+#if DIM==2
+ senc2d_scene_get_overlapping_segments_count(senc_scn, &count);
+ if(count > 0)
+ log_err(scn->dev,
+ "%s: the scene includes overlapping segments.\n",
+ FUNC_NAME);
+#else
+ senc3d_scene_get_overlapping_triangles_count(senc_scn, &count);
+ if(count > 0)
+ log_err(scn->dev,
+ "%s: the scene includes overlapping triangles.\n",
+ FUNC_NAME);
+#endif
+ goto error;
+ }
exit:
if(senc) SENCXD(device_ref_put(senc));