question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does the method #cureLocalIntersections in the Tessellator make any sense?

See original GitHub issue

Description

I have always been confused by this method which claims to fix self-intersections of the polygon but we require in the Tessellator java docs that polygons should not have self-intersections. More over, we have no test that needs this method to pass so it is currently untested / unnecessary.

I am bringing this up because I have an example of a polygon that it seems to spend half of the time on that method. It is a huge polygon that with this method takes around 560 seconds to tessellate but 260 seconds if we don’t go through this method.

My proposal is to remove the method completely or at least not call this method if the Tessellator has been called with the flag checkSelfIntersections set to true.

@nknize introduced this method on the first version of the Tessellator, he might have more background about the need of this method. what do you think?

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
iverasecommented, Sep 16, 2022

Then let’s just skip that step if the tessellator is called with the flag checkSelfIntersections set to true. In that case it will fail before getting to this place.

0reactions
nknizecommented, Sep 16, 2022

I don’t understand this. We re claiming in the java docs that polygons should not be self-intersecting and we do not introduce self-intersections in our code, why we want to remove them?

Because real life Geo data doesn’t care what our javadocs say. Small self intersections are a reality that rears its head every now and then in real data and the performance hit to “best effort” detect and clean in the tessellator’s cure phase at index time was worth more than directing user’s to a third party cleaning utility before indexing.

Our blind polygon class does nothing to enforce those javadocs so maybe before completely removing we might consider flagging that phase as an optional validation step disabled by default? (Think ignore_malformed)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cure small self-intersections locally · Issue #8 · mapbox/earcut
iverase mentioned this issue on Sep 15. Does the method #cureLocalIntersections in the Tessellator make any sense? apache/lucene#11767.
Read more >
Tessellation - Wikipedia
A tessellation or tiling is the covering of a surface, often a plane, using one or more geometric shapes, called tiles, with no...
Read more >
Tessellation Creator
A tessellation is a repeating pattern of polygons that covers a plane with no gaps or ... What kind of tessellations can you...
Read more >
Tessellation Patterns - From Mathematics to Art - Widewalls
Also known as tiling, the process of creating a tessellation can be based on a regular, semiregular geometric or non-geometric shape or tile ......
Read more >
Tessellation - OpenGL Wiki - Khronos Group
The tessellation process is divided into three stages which form an ... A patch that is discarded does not get tessellated, and no...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found