Snap AreaMeta vertices to a precision grid #3525
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.
Identify the Bug or Feature request
Addresses #3521
Description of the Change
The precision grid (not to be confused with MapTool's grid) is provided by
GeometryUtil.getPrecisionModel()
. By snapping to this grid, we avoid needing to check points for "closeness" rather than equality while still avoiding problems with points that would otherwise lie close to one another without technically being the same point.The hardcoded precision is high enough that any intentional detail is going to be captured. But it is low enough that any points that would cause issues for the vision blocking algorithm are elided. E.g., the points in #3521 that are within about 2e-13 are elided, while most points further than that can be preserved without issue.
Possible Drawbacks
Not likely to be any. Released versions of MapTool can't operate at these precisions anyways, so no one should be counting on them one way or another.
Documentation Notes
N/A
Release Notes
N/A (fixes a new bug)
This change is