miho / JCSG

Java implementation of BSP based CSG (Constructive Solid Geometry)
Other
177 stars 52 forks source link

Fix the stackOverflow issue in #54 #64

Open madhephaestus opened 3 years ago

madhephaestus commented 3 years ago

This is a fix to the stack overflow issue in the plane split function. If a plane that comes in that is not as flat as the fixed Plane.EPSILON value, then the algorithm would recourse until a crash.

This change measures the epsilon off of the incoming polygon to set the epsilon values accurately for each incoming polygon.

CreamyCookie commented 1 year ago

@madhephaestus When I enable this the icosahedron.intersect assert of the IcosahedronTest fails

madhephaestus commented 1 year ago

This feature should be implemented in neuronrobotics/jcsg along with lots of additional features. I made this pr in hopes the upstream project was not abandoned, but alas, it seems the neuronrobotics fork seems to the the currently maintained fork.

CreamyCookie commented 1 year ago

@madhephaestus Oh, maybe I should have mentioned.. I applied the changes to your fork, and there the test failed.

madhephaestus commented 1 year ago

My fork already has this feature. This PR is intended to back-feed solutions to begs to the ubstream project, in case someone is stock on this fork for some reason. There is no need to apply this to my fork.

CreamyCookie commented 1 year ago

@madhephaestus Ah, I see, my bad

Thank you for your fork :+1: