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(coordinate_space): handle nearly integer-aligned bounds #742

Merged
merged 1 commit into from
Feb 26, 2025
Merged

Conversation

jbms
Copy link
Collaborator

@jbms jbms commented Feb 25, 2025

Previously, coordinate bounds approximately, but not exactly, equal to an integer or half-integer were handled poorly.

In particular, the lower/upper bounds could end up off by 1 from the expected value, and voxelCenterAtIntegerCoordinates could end up false when it was expected to be true, leading to coordinates snapping to the boundary between two voxels, rather than the center, as expected.

With this change, coordinate bounds within 1e-3 of an integer or half-integer are handled properly.

Fixes #719.

Previously, coordinate bounds approximately, but not exactly, equal to
an integer or half-integer were handled poorly.

In particular, the lower/upper bounds could end up off by 1 from the
expected value, and voxelCenterAtIntegerCoordinates could end up false
when it was expected to be true, leading to coordinates snapping to the
boundary between two voxels, rather than the center, as expected.

With this change, coordinate bounds within 1e-3 of an integer or
half-integer are handled properly.

Fixes #719.
@jbms jbms merged commit 190ff9f into master Feb 26, 2025
27 checks passed
@jbms jbms deleted the fix-720 branch February 26, 2025 17:54
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.

floating point division creates mistakes in resolution when using non m units
1 participant