union of shapes sometimes results in error #423
Replies: 3 comments 14 replies
-
I haven't had much luck debugging our C++ code through WASM, though I also haven't tried building with Not surprising it doesn't repro with |
Beta Was this translation helpful? Give feedback.
-
Alright, I wrote a C++ test case that generates exactly the same shape as in WASM. You can find it in this gist. Copy and paste the code as a test in The test should run fine and print out the volume of the resulting shape. On line 457 of the gist it's possible to change the scaling factor of the path. For now I found two scale factors that break the shape generation: It's also possible to export the resulting GLB file by running: As for the errors it throws with scale factors 0.1 and 0.8:
I'm not very experienced with C++, so I'm unsure how to debug this further at the moment. |
Beta Was this translation helpful? Give feedback.
-
Do you think it might be possible that the error occurs because of lots of coplanar faces having to be unioned together? The test I wrote generates a ton of primitives, which all have coplanar faces. Inspecting the final mesh that comes out, they don't always get unioned together. (Which is normal I guess.) Perhaps this might be linked to the crash? |
Beta Was this translation helpful? Give feedback.
-
I have this example code doing a basic path sweep. It generates lots of small linear extrusions and partial revolves, which when unioned together form a shape:
You can find the example code here. Just copy and paste in manifoldcad.org
I noticed that when scaling the path up and down, for some scale factors, seemingly randomly, the manifold generation results in an error. On line 8 of the example code above you can change the scale factor. When changing it to
1
or0.2
, an error is thrown:Any idea on how to proceed to debug this error?
Should I rebuild the .wasm file with the
-sASSERTIONS
flag as shown by the error, to get more info?If I rebuild the .wasm file, is there an easy way for me to test it out in the browser with my local newly created .wasm file?
It's not immediately obvious to me how to debug this. Having an easy way to test a local .wasm build in the browser might also make the development of new bindings (at least for wasm) easier!
EDIT:
some extra information: using
compose
to combine all the tiny primitives together works just fine. So it seems to be specific to theunion
call.Beta Was this translation helpful? Give feedback.
All reactions