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 fails with short segment lengths #130

Open
martin19 opened this issue Jun 2, 2020 · 0 comments
Open

Intersection fails with short segment lengths #130

martin19 opened this issue Jun 2, 2020 · 0 comments
Assignees

Comments

@martin19
Copy link

martin19 commented Jun 2, 2020

Hi,

thanks for your implementation of this library. I'm currently evaluating libraries for boolean operations and counted your martinez implementation as a top contender. During my evaluation I've noticed the intersection computation completely fails for polygons with very short segment lengths: in my demo I'm approximating bezier-curves through polygons. The intersection algorithm seems to work (much better) with longer line segments - that is what I think is the reason.

Here are two videos of the demo. I'm computing intersection between a circle and some ornament multipolygon I found on the internet. I'm moving the circle interactively with the mouse - the resulting intersection is shown in red color.

https://imgur.com/fJx7Bqd (10 division per bezier segment)
https://imgur.com/TUyDcKP (50 division per bezier segment)

I wondered if I was interpreting the result data wrong or if the input data was malformed - but this would contradict the algorithm performing well on longer segments. Are there any parameters in the algorithm that are tweakable (accuracy or "epsilon") to support shorter segments? Is this a known issue? I've also tried the polybool library which is about 10 times slower but has pretty accurate results also for short segment lengths. Would you suggest me trying your Greiner-Horman implementation?

@martin19 martin19 changed the title Intersections fails with short segment lengths Intersection fails with short segment lengths Jun 2, 2020
@w8r w8r self-assigned this Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants