apache / apache/lucene

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

Open
#11,767 6 comments 0 reactions 0 assignees View on GitHub
type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

### 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?

Contributor guide

Open the contributing guide

Research direction

Start by reading the Tessellator Java documentation and the #cureLocalIntersections method, then trace how the checkSelfIntersections flag affects its callers. Compare tessellation behavior and timing with the method enabled, removed, or conditionally skipped; done means the chosen behavior is justified by tests or a documented benchmark and the unnecessary work is no longer performed.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.