Repository navigation
Fall back to the nearest point of the node in sample_point_on_node. - #205
Open
sidneyprins wants to merge 1 commit into
Open
sidneyprins wants to merge 1 commit into
sidneyprins wants to merge 1 commit into
Conversation
sidneyprins
force-pushed
the
fix-sample-point-on-node-edge
branch
from
October 17, 2026 19:54
727ba37 to
3b32c2b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #204.
sample_point_on_nodeassumes the point projects onto the node. Points on the node's boundary, such as the clipped ends of an animation link's portal, can miss every triangle by float error, and the function panics. Instead it now falls back to the point of the node nearest to the given point.sample_point's nestedproject_to_triangle, which already clamps to the triangle, moves to a module-levelclosest_point_on_triangleso both functions share it. Its behavior is unchanged.sample_point_on_nodestill returns the first triangle the point projects onto. While it tests the triangles it keeps the nearest clamped point, and returns that when none matches.sample_point_on_node_point_just_outside_node, using the triangle and point from the issue. Without the change it panics at the same line.I left
EPSILONas it is rather than widening it: a larger tolerance only moves the boundary where it fails, while the fallback handles any point the caller believes is on the node.cargo test --all-features --all-targets,cargo clippy -- -D warningsandcargo +nightly fmt --all -- --checkpass. With this patch our stress test that used to panic in two of three runs passed every run.🤖 Generated with Claude Code