Skip to content

Commit

Permalink
Fix rodSection radius init for physical simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
epernod committed May 14, 2024
1 parent 0d50672 commit 2148192
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
18 changes: 9 additions & 9 deletions examples/3instruments_collis.scn
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
<!-- ------------------------- INTERVENTIONAL RADIOLOGY INSTRUMENTS (catheter, guidewire, coil) ------------------------------ -->

<Node name="topoLines_cath">
<RodStraightSection name="StraightSection" youngModulus="10000" nbEdgesCollis="40" nbEdgesVisu="220" length="600.0"/>
<RodSpireSection name="SpireSection" youngModulus="10000" nbEdgesCollis="10" nbEdgesVisu="80" length="400.0" spireDiameter="4000.0" spireHeight="0.0"/>
<RodStraightSection name="StraightSection" youngModulus="10000" radius="1" nbEdgesCollis="40" nbEdgesVisu="220" length="600.0"/>
<RodSpireSection name="SpireSection" youngModulus="10000" radius="1" nbEdgesCollis="10" nbEdgesVisu="80" length="400.0" spireDiameter="4000.0" spireHeight="0.0"/>

<WireRestShape template="Rigid3d" name="catheterRestShape" wireMaterials="@StraightSection @SpireSection"/> <!-- silicone -->

Expand All @@ -49,8 +49,8 @@
<MechanicalObject template="Rigid3d" name="dofTopo1" />
</Node>
<Node name="topoLines_guide">
<RodStraightSection name="StraightSection" youngModulus="10000" nbEdgesCollis="50" nbEdgesVisu="196" length="980.0"/>
<RodSpireSection name="SpireSection" youngModulus="10000" nbEdgesCollis="10" nbEdgesVisu="4" length="20.0" spireDiameter="25" spireHeight="0.0"/>
<RodStraightSection name="StraightSection" youngModulus="10000" radius="0.9" nbEdgesCollis="50" nbEdgesVisu="196" length="980.0"/>
<RodSpireSection name="SpireSection" youngModulus="10000" radius="0.9" nbEdgesCollis="10" nbEdgesVisu="4" length="20.0" spireDiameter="25" spireHeight="0.0"/>

<WireRestShape template="Rigid3d" name="GuideRestShape" wireMaterials="@StraightSection @SpireSection"/>

Expand All @@ -60,8 +60,8 @@
<MechanicalObject template="Rigid3d" name="dofTopo2" />
</Node>
<Node name="topoLines_coils">
<RodStraightSection name="StraightSection" youngModulus="168000" nbEdgesCollis="30" nbEdgesVisu="360" length="540.0"/>
<RodSpireSection name="SpireSection" youngModulus="168000" nbEdgesCollis="30" nbEdgesVisu="40" length="60.0" spireDiameter="7" spireHeight="5.0"/>
<RodStraightSection name="StraightSection" youngModulus="168000" radius="0.1" nbEdgesCollis="30" nbEdgesVisu="360" length="540.0"/>
<RodSpireSection name="SpireSection" youngModulus="168000" radius="0.1" nbEdgesCollis="30" nbEdgesVisu="40" length="60.0" spireDiameter="7" spireHeight="5.0"/>

<WireRestShape template="Rigid3d" name="CoilRestShape" wireMaterials="@StraightSection @SpireSection"/>

Expand All @@ -83,13 +83,13 @@
/>
<MechanicalObject template="Rigid3d" name="DOFs" showIndices="0" ry="-90"/>

<WireBeamInterpolation name="InterpolCatheter" WireRestShape="@../topoLines_cath/catheterRestShape" radius="1" printLog="0"/>
<WireBeamInterpolation name="InterpolCatheter" WireRestShape="@../topoLines_cath/catheterRestShape" printLog="0"/>
<AdaptiveBeamForceFieldAndMass name="CatheterForceField" interpolation="@InterpolCatheter" massDensity="0.00000155"/> <!--stiff silicone E = 10000 MPa // 1550 Kg/m3-->

<WireBeamInterpolation name="InterpolGuide" WireRestShape="@../topoLines_guide/GuideRestShape" radius="0.9" printLog="0"/>
<WireBeamInterpolation name="InterpolGuide" WireRestShape="@../topoLines_guide/GuideRestShape" printLog="0"/>
<AdaptiveBeamForceFieldAndMass name="GuideForceField" interpolation="@InterpolGuide" massDensity="0.00000155"/>

<WireBeamInterpolation name="InterpolCoils" WireRestShape="@../topoLines_coils/CoilRestShape" radius="0.1" printLog="0"/>
<WireBeamInterpolation name="InterpolCoils" WireRestShape="@../topoLines_coils/CoilRestShape" printLog="0"/>
<AdaptiveBeamForceFieldAndMass name="CoilsForceField" interpolation="@InterpolCoils" massDensity="0.000021"/> <!-- platine E = 168000 MPa // 21000 Kg/m3-->

<BeamAdapterActionController name="AController" interventionController="@IRController" writeMode="0"
Expand Down
15 changes: 6 additions & 9 deletions src/BeamAdapter/component/model/BaseRodSectionMaterial.inl
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,12 @@ void BaseRodSectionMaterial<DataTypes>::getInterpolationParam(Real& _rho, Real&
if (d_massDensity.isSet())
_rho = d_massDensity.getValue();

if (d_radius.isSet())
{
_A = beamSection._A;
_Iy = beamSection._Iy;
_Iz = beamSection._Iz;
_Asy = beamSection._Asy;
_Asz = beamSection._Asz;
_J = beamSection._J;
}
_A = beamSection._A;
_Iy = beamSection._Iy;
_Iz = beamSection._Iz;
_Asy = beamSection._Asy;
_Asz = beamSection._Asz;
_J = beamSection._J;
}

} // namespace sofa::beamadapter

0 comments on commit 2148192

Please sign in to comment.