[WireRestShape] Fix initTopology accumulation for N≥3 sections#226
Closed
lkarstensen wants to merge 2 commits intosofa-framework:masterfrom
Closed
[WireRestShape] Fix initTopology accumulation for N≥3 sections#226lkarstensen wants to merge 2 commits intosofa-framework:masterfrom
lkarstensen wants to merge 2 commits intosofa-framework:masterfrom
Conversation
added 2 commits
April 29, 2026 16:34
…ons (sofa-framework#223) x_used is the global curvilinear abscissa; adding x_start again placed the rest node at 2*x_start + local_offset instead of x_used. For wires with two or more RodStraightSections this produced enormous elastic restoring forces at every timestep, causing simulation explosion. Fix: use x_used directly, consistent with RodSpireSection and RodMeshSection.
…logy Fixes sofa-framework#225. Both accumulators were reset via assignment instead of accumulation, corrupting point coordinates and edge indices for any wire with three or more sections.
Author
|
Withdrawing — fix for #225 does not produce the expected improvement. Further investigation needed. |
This was referenced Apr 30, 2026
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 #225.
Problem
WireRestShape::initTopologyuses two accumulator variables to track the running point-coordinate offset and edge index offset across sections. Both were updated via assignment instead of accumulation:For N≤2 sections the assignment and accumulation forms produce the same value after the first iteration, so those wires are unaffected. For N≥3 sections, section 2 onward receives corrupted point coordinates (overlapping prior sections) and wrong edge indices, producing a degenerate
EdgeSetTopologyContainer.Fix
Zero behavioural change for N≤2 wires.
Testing
Manually verified: 3-section wire fails on
master, initialises correctly with this patch applied (on top of #224).