Reduce buffer curve short fillet segments #960
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
New Code