locationtech / jts

The JTS Topology Suite is a Java library for creating and manipulating vector geometry.
Other
1.99k stars 443 forks source link

Reduce buffer curve short fillet segments #960

Closed dr-jts closed 1 year ago

dr-jts commented 1 year ago

This change reduces the number of very short fillet segments created during buffer/offset curve generation.

Specifically, adjacent input segments which are at a very shallow convex (outside) angle would cause a very short single-segment fillet to be created. These were previously pruned if they were extremely short, to avoid robustness issues. It is possible to increase the segment length that is pruned, since it has essentially no effect on the quality of the offset curve. This reduces the number of short segments which appear in the final curve.

Also, this change improves the selection strategy determining which offset vertex to keep.

Example

Input: LineString with 325 vertices and length 0.0611 Buffer distance: 0.01: Buffer vertex count:

Example of removed fillet segment:

Segment length: 0.00034 Old Code image

New Code image