Closed madhephaestus closed 7 years ago
Sorry, but we don't want hacky ;) The problem is that your pyramid will still be a cylinder/truncated-cone with a very small top polygon. Rather than that, I'd introduce a primitive class that creates proper pyramids.
I agree. I think #15 is the deeper root cause though, and if that were solved, this issue may never have manifested?
(on a side note, I'd love to have a video call to show you some cool things I'v done with your awesome library!)
If you create a pyramid by making a cylinder with a radius of zero, then triangulation function fails when doing a difference operation between this object and any other.
CSG torso = new Cylinder( 30, // Radius at the bottom 0, // Radius at the top 60, // Height (int)4 //resolution ).toCSG()//convert to CSG to display
CSG cover = new Cube( 200,// X dimention 200,// Y dimention 200// Z dimention ).toCSG()
Both of these shapes are valid.
This operation however will fail:
cover.difference(torso);
Changing the top radius to a small number is a hack to fix this issue:
CSG torso = new Cylinder( 30, // Radius at the bottom 0.001, // Radius at the top 60, // Height (int)4 //resolution ).toCSG()//convert to CSG to display
This bug is related to #15 in that it originates in the triangulation function falling off the front surface and ending up inverting the surfaces.