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

Snap AreaMeta vertices to a precision grid #3525

Merged
merged 2 commits into from
Aug 7, 2022

Conversation

kwvanderlinde
Copy link
Collaborator

@kwvanderlinde kwvanderlinde commented Aug 7, 2022

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 Reviewable

kwvanderlinde and others added 2 commits August 7, 2022 00:43
This grid is separate from MapTool's grid and 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.
Copy link
Contributor

@Phergus Phergus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @kwvanderlinde)

@Phergus Phergus merged commit 3c66663 into RPTools:develop Aug 7, 2022
@kwvanderlinde kwvanderlinde deleted the bugfix/3521-broken-vision branch September 3, 2022 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants