fix mitering bug with ground polylines over long distances #7885
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.
Fixes #7855.
GroundPolylineGeometry
miters between line segments, but only if their endpoints aren't coplanar.This used to be a literal coplanar check, but this would fail sometimes for very long-distance line segments due to the tiny epsilon used for coplanarity. The computed miter vector would then also have problems due to the curvature of the Earth, since it was a naive average of the directions from point-to-point.
This PR moves the check for whether miters are needed or not to a check using vectors pointing towards the segments' end points but tangent to the surface of the ellipsoid.
The spec for miter breaking was also incorrect, the first test case wasn't even encountering a miter break.