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

Fix OffsetCurve parameter handling #899

Merged
merged 1 commit into from
May 8, 2023

Conversation

dr-jts
Copy link
Contributor

@dr-jts dr-jts commented May 8, 2023

Fixes OffsetCurve to ignore the value of BufferParmeters.endCapStyle and always use CAP_ROUND.
Also removes the unnecessary setting of this value in GEOSOffsetCurve_r.

Fixes #897

@dr-jts dr-jts added the Bug label May 8, 2023
@dr-jts dr-jts merged commit afbcf67 into libgeos:main May 8, 2023
@dr-jts dr-jts deleted the fix-offset-curve-params branch May 8, 2023 20:17
dr-jts added a commit that referenced this pull request May 8, 2023
@strk
Copy link
Member

strk commented May 25, 2023

Should it have always used CAP_FLAT instead ?

@strk
Copy link
Member

strk commented May 25, 2023

See qgis/QGIS#53165 (comment)

@dr-jts
Copy link
Contributor Author

dr-jts commented May 25, 2023

Should it have always used CAP_FLAT instead ?

Not according to that unit test, and the way I wrote the algorithm.

@dr-jts
Copy link
Contributor Author

dr-jts commented May 25, 2023

From the issue in qgis/QGIS#53165 it appears that using Quadrant Segments = 0 (or any small value) causes artifacts to appear. The QuadrantSegments value should be forced to be >= 8 when building offset curves. (Even better would be an ability to specify the End Cap Quadrant Segments independently of the Join QS).

The cause of the problem is that a small QS value can expose "closing arc" linework at internal corners. This is a problem with generating buffers as well.

It also might be possible to detect and remove unwanted end cap segments when the QuadrantSegments value is small (at the ends of the offset curve, via a distance check).

@dr-jts
Copy link
Contributor Author

dr-jts commented May 25, 2023

See locationtech/jts#980

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Offset curve has Weird Geometry
2 participants