Home › Forum › SOFA › Using SOFA › How to completely prevent penetration when collision occurs?
Tagged: 64_bits, collision, penetration, SOFA_1712, Windows_7
- This topic has 7 replies, 2 voices, and was last updated 6 years, 3 months ago by Hugo.
-
AuthorPosts
-
2 September 2018 at 12:29 #11789WongBlocked
I just simplify the .scn (as shown below) from an example in Geomagic plugin, but penetration still occurs sometimes when the instrument is manipulated to collide with the liver.
So how to more effectively prevent such penetration?<Node name="root" dt="0.005" gravity="0 -9.81 0" > <VisualStyle displayFlags="hideBehaviorModels hideCollisionModels hideMappings hideForceFields" /> <RequiredPlugin name="Geomagic plugin" pluginName="Geomagic" /> <CollisionPipeline name="pipeline" depth="6" verbose="0"/> <BruteForceDetection name="detection" /> <CollisionResponse name="response" response="FrictionContact" /> <LocalMinDistance name="proximity" alarmDistance="0.15" contactDistance="0.05" angleCone="0.0" /> <FreeMotionAnimationLoop/> <LCPConstraintSolver tolerance="0.001" maxIt="1000"/> <GeomagicDriver name="GeomagicDeviceL" deviceName="Default Device" tags="L" scale="1" forceScale="5" drawDeviceFrame="1" positionBase="-2 0 0" orientationBase="0 0 0 1" /> <Node name="Liver" gravity="0 -9.81 0"> <EulerImplicitSolver name="cg_odesolver" /> <CGLinearSolver name="linear solver" iterations="25" tolerance="1e-09" threshold="1e-09" /> <MeshGmshLoader name="meshLoader" filename="mesh/liver.msh" /> <TetrahedronSetTopologyContainer name="topo" src="@meshLoader" /> <MechanicalObject name="dofs" src="@meshLoader" dx="0"/> <TetrahedronSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" /> <DiagonalMass name="computed using mass density" massDensity="1" /> <TetrahedralCorotationalFEMForceField template="Vec3d" name="FEM" method="large" poissonRatio="0.3" youngModulus="6e3" computeGlobalMatrix="0" /> <PrecomputedConstraintCorrection recompute="1"/> <BoxROI template="Vec3d" box="-3 1 -2 -1 3 3" drawBoxes="1" position="@dofs.rest_position" name="FixedROI" computeTriangles="0" computeTetrahedra="0" computeEdges="0" /> <FixedConstraint template="Vec3d" name="default6" indices="@FixedROI.indices" /> <Node name="Visu" tags="Visual" gravity="0 -9.81 0"> <OglModel name="VisualModel" fileMesh="mesh/liver-smooth.obj" dx="0"/> <BarycentricMapping name="visual mapping" input="@../dofs" output="@VisualModel" /> </Node> <Node name="Surf" gravity="0 -9.81 0"> <MeshObjLoader name="meshLoader" filename="mesh/liver.obj"/> <Mesh src="@meshLoader" /> <MechanicalObject name="spheres" dx="0"/> <Triangle group="0" name="ballT" contactStiffness="10"/> <Line group="0" name="ballL" contactStiffness="10"/> <Point group="0" name="ballP" contactStiffness="10"/> <BarycentricMapping name="sphere mapping" input="@../dofs" output="@spheres" /> </Node> </Node> <Node name="InstrumentL" > <EulerImplicitSolver name="ODE solver" rayleighStiffness="0.05" rayleighMass="1.0" /> <CGLinearSolver name="linear solver" iterations="25" tolerance="1e-10" threshold="10e-10" /> <MechanicalObject name="instrumentState" position="@GeomagicDeviceL.positionDevice" template="Rigid" /> <UniformMass name="mass" totalmass="0.005" /> <LCPForceFeedback tags="L" activate="true" forceCoef="0.005"/> <!-- ADDED : Compute a force-feedback for the device --> <RestShapeSpringsForceField points="0" stiffness="10" angularStiffness="10"/> <!--external_rest_shape="toto"/>--> <UncoupledConstraintCorrection/> <Node name="VisualModel" > <OglModel name="InstrumentVisualModel" fileMesh="Demos/Dentistry/data/mesh/dental_instrument.obj" color="1.0 0.2 0.2 1.0" ry="-180" rz="-90" dz="3.5" dx="-0.3"/> <RigidMapping name="MM->VM mapping" input="@instrumentState" output="@InstrumentVisualModel" /> </Node> <Node name="CollisionModel" > <MeshObjLoader filename="Demos/Dentistry/data/mesh/dental_instrument_centerline.obj" name="loader"/> <Mesh src="@loader" name="InstrumentCollisionModel" /> <MechanicalObject src="@loader" name="instrumentCollisionState" ry="-180" rz="-90" dz="3.5" dx="-0.3" /> <Line name="L" contactStiffness="10" /> <Point name="P" contactStiffness="10" /> <RigidMapping name="MM->CM mapping" input="@instrumentState" output="@instrumentCollisionState" /> </Node> </Node> </Node>
2 September 2018 at 20:25 #117903 September 2018 at 02:59 #117993 September 2018 at 08:56 #11804HugoKeymasterIt corresponds to information (“tag”) regarding your SOFA version and your operating system that you have to precise when creating a new topic (look juste down the topic title)
Well, what is your SOFA version then?
Best
Hugo
3 September 2018 at 09:37 #118063 September 2018 at 22:40 #11820HugoKeymasterOk, it was just to check: some more recent version have issues with Geomagic. But v17.12 should be fine.
Have you tried to increase both the alarmDistance and contactDistance in the LocalMinDistance ?
If it does not solve your issue, I’ll test the scene with the Geomagic compiled on my machine.Best,
Hugo
4 September 2018 at 05:18 #11821WongBlockedHello @hugo,
Increasing both the alarmDistance and contactDistance is sure to be fine, but the animation would become slow. How to address this issue?13 September 2018 at 18:54 #11940HugoKeymasterHi @outtt
if the simulation slows down, it means the computation becomes more complicated. Hard to make it more efficient. You can:
– decrease the refinement of your collision mesh
– try to increase the stiffness of your collision modelsLet me know if this helps.
I did not use the Geomagic for some weeks. As soon as I use it again, I will give a try to your scene.Best
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.