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

Intersection of complex polygons fails #2

Open
mipastgt opened this issue Sep 26, 2024 · 1 comment
Open

Intersection of complex polygons fails #2

mipastgt opened this issue Sep 26, 2024 · 1 comment

Comments

@mipastgt
Copy link

I don't know whether this project is still supported but I just give it a try.

The attached test tries to compute the intersection of a complex polygon (just two rectangles)
with another polygon (a simple rectangle). The test fails with an illegal state
exception so computing the intersection of complex polygons does not seem to be
supported, although I haven't found any hint in the documentation about this.

Only applies to polys of size 1
java.lang.IllegalStateException: Only applies to polys of size 1
at com.seisw.util.geom.PolyDefault.setContributing(PolyDefault.kt:257)
at com.seisw.util.geom.Clip.minimax_test(Clip.kt:841)
at com.seisw.util.geom.Clip.clip(Clip.kt:223)
at com.seisw.util.geom.Clip.intersection(Clip.kt:104)
at com.seisw.util.geom.PolyDefault.intersection(PolyDefault.kt:268)
at com.seisw.util.geom.IntersectionTest.test(IntersectionTest.kt:33)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

IntersectionTest.kt.zip

@ChristianLutz
Copy link
Owner

Hello,

thank you for reporting it. And documenting this error.

It is quite some time since I used the library. Never developed any of it by myself.

But I'll give it a try.

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

No branches or pull requests

2 participants