Closed andygeers closed 4 years ago
Even if you were able to explain a little of how your code maps to the explanation of how the geometry works in that Js library would be a real help- e.g. they use the concept of “invert”ing a set where you use “clip” and I just couldn’t quite follow the intent behind your code (sorry! I am sure it is great; I am just a bear of very little brain)
@andygeers the code has evolved quite a bit since the JS version and I'm not sure it exactly correlates anymore. If you could share the code you use to generate the wallMesh then I can try to track this issue down.
D’oh! I think I figured it out. The clue is in the name: constructive SOLID geometry. My wall mesh had no back plane so all the assumptions were faulty. Haven’t verified this yet but pretty sure that must be the case- I couldn’t reproduce it easily when using the full wall mesh that included a back plane and sides.
@andygeers ah yes, that would explain it. It only works correctly for closed hulls.
@andygeers Do you know how to find the outline from the mesh - and render in 2s
I'm having issues with the CSG
subtract
method, where some of the polygons from the mesh being subtracted are retained, way beyond the bounds of the mesh they're being subtracted from. I've tried to compare your code with the original JS library that the CSG stuff is inspired by, but the implementation is so different that I can't get my head around it. Any thoughts?See the really big sticking out polygons in this:
The long sticking out thing is constructed like so:
Then subtracted from the building like so: