Repository navigation
Preserve segment neighbor tangents when copying - #319
Merged
Merged
Conversation
Owner
|
Thanks for the bug find and fix! |
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.
Copying a segment loses the neighbor settings that suppress collisions at joined endpoints:
Record the neighbor tangents and restore them through
set_neighbors. Saving the tangents preserves native behavior ifunsafe_set_endpointssubsequently changes the endpoints. Existing states without this field still restore normally.In 48 native segment-chain configurations covering copy/deepcopy, pickle protocols 2/5, rail angles, segment thickness and circle sizes, restored contact queries and all 240 simulation steps now match the original exactly. Another 48 configurations without neighbor settings retain identical trajectories. Scenes are copied before their first step; this does not claim to preserve active contact caches.
The new regressions cover copied spaces and individual shapes, changed endpoints and legacy state. The full suite passes (293 tests, two skipped; baseline 291 with the same skips). Black and the project's strict mypy settings pass for the changed source on Linux/Python 3.12. No other platform result is claimed.