Skip to content

Commit cac4005

Browse files
lkarstensenLennart Karstensen
andauthored
[RodStraightSection] Fix rest shape double-offset for non-first sections (sofa-framework#223) (sofa-framework#224)
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. Co-authored-by: Lennart Karstensen <lennart.karstensen@ipa.fraunhofer.de>
1 parent f62e734 commit cac4005

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/BeamAdapter/component/model/RodStraightSection.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ bool RodStraightSection<DataTypes>::initSection()
5353
template <class DataTypes>
5454
void RodStraightSection<DataTypes>::getRestTransformOnX(Transform& global_H_local, const Real x_used, const Real x_start)
5555
{
56-
global_H_local.set(type::Vec3(x_start + x_used, 0.0, 0.0), Quat());
56+
global_H_local.set(type::Vec3(x_used, 0.0, 0.0), Quat());
5757
}
5858

5959

0 commit comments

Comments
 (0)