Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plane splitPolygon running into loop / StackOverflowError #53

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

udatny
Copy link

@udatny udatny commented Mar 11, 2019

i runned several times into the stackoverflow issue (which also people reported #48 ) and i am still not sure what it is causing. fact is, that under certain circumstances the Plane.splitPolygon could end in a loop. somehow it does not recognize polygons as coplanar.

it is reproducable with the AppleTest i added. (simply run mvn test -Dtest=eu.mihosoft.jcsg.AppleTest
in the root folder)

a possible fix is also there but in my opinion it is not addressing the root cause....it just works around the issue.

maybe you find time to analyze.

we're adjusting two things... still the root cause of the stackoverflow is still not clear.
we're using a random polygon to define the plane for the node. chances are bigger that find a a coplanar polygon.
then if we have only one polygon as an input, we're expecting it to be coplanar.

a better alternative  may be to say that as long as the polygon from which we defined the plane is not SPANNING, it must be COPLANAR. 

anyway, this fix made my situation work again. 

maybe the issues arise from bigger models somewhere in the 100 dimension
for maven-based builds
this is a quick and dirty fix which does the job.
revert
run this test to reproduce the StackOverflowError
revert
@jimbok8
Copy link

jimbok8 commented Apr 24, 2019

I have a StackOverflowError when performing the intersect method on two objects.
I have tried your code and it does get rid of the StackOverflowError on the intersect method, however it does not produce the correct output for the difference method.

In addition, it produces many lines of "our plane is not spanning and not coplannar but it should be 1.0"

Any ideas?
PS Thanks for the work to get rid of the stackoverflow!

@madhephaestus
Copy link
Contributor

I think you may be working around the issue i fixed in #64 @jimbok8 Give it a shot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants