locationtech / jts

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

Fix OffsetCurve to ensure end segments are included #1029

Closed dr-jts closed 6 months ago

dr-jts commented 6 months ago

This fixes the OffsetCurve algorithm to handle rare cases where an end segment is dropped because of heuristics used to reduce the number of short segments in generated buffer curves.

Example

LINESTRING (4.821 0.72, 7.767 1.801, 4.94 9.552, 0 7.79, 2.858 0, 4.821 0.72)

Offset curve Distance - -0.045; Mitre Join

Before:

image

Fixed code:

image