Home › Forum › SOFA › Using SOFA › [SOLVED] No collision between the collision models
Tagged: 64_bits, no collision between models, SOFA_1612, Windows_7
- This topic has 2 replies, 2 voices, and was last updated 7 years, 4 months ago by shang.
-
AuthorPosts
-
13 August 2017 at 15:28 #9918shangBlocked
hi,everybody, I am trying to use the BeamFEMModel as a soft catheter and the TriangleTensorMassModel as the deformable model of the tissue; but there is a problem, there is no collision between the catheter model and the soft tissue model, the scn scripts are illustrated bellow:
<?xml version="1.0" ?> <Node name="root" dt="0.01"> <VisualStyle displayFlags="showBehaviorModels showForceFields showCollisionModels" /> <RequiredPlugin name="Geomagic plugin" pluginName="Geomagic" /> <RequiredPlugin name="SofaPython" pluginName="SofaPython" /> <CollisionPipeline depth="6" verbose="0" draw="0" /> <BruteForceDetection name="N2" /> <MinProximityIntersection name="Proximity" alarmDistance="0.03" contactDistance="0.02" /> <LocalMinDistance name="proximity" alarmDistance="0.15" contactDistance="0.05" angleCone="0.0" /> <CollisionResponse name="Response" response="default" /> <CollisionGroup name="Group" /> <LightManager /> <SpotLight name="light1" color="1 1 1" position="0 80 25" direction="0 -1 -0.8" cutoff="30" exponent="1" /> <SpotLight name="light2" color="1 1 1" position="0 40 100" direction="0 0 -1" cutoff="30" exponent="1" /> <LCPConstraintSolver tolerance="0.01" maxIt="1000"/> <GeomagicDriver name="GeomagicDevice" deviceName="Default Device" scale="1" drawDeviceFrame="1" positionBase="0 0 0" orientationBase="0 0.707 0 -0.707" /> <Node name="Liver" gravity="0 -9.81 0"> <EulerImplicitSolver tolerance="0.001" maxIt="1000"/> <CGLinearSolver name="linear solver" iterations="25" tolerance="1e-09" threshold="1e-09" /> <MeshObjLoader name="meshLoader" filename="mesh/artery-modified-coarse-hole-small.obj" createSubelements="true" scale3d="3 3 3"/> <Mesh src="@meshLoader" /> <MechanicalObject name="dofs" src="@meshLoader" translation="10 0 0"/> <TriangleSetTopologyContainer name="Container" src="@meshLoader"/> <TriangleSetTopologyModifier name="Modifier" /> <TriangleSetTopologyAlgorithms name="TopoAlgo" template="Vec3d" /> <TriangleSetGeometryAlgorithms name="GeomAlgo" template="Vec3d" /> <DiagonalMass name="computed using mass density" massDensity="0.001" /> <TriangularTensorMassForceField name="TM" youngModulus="10" poissonRatio="0.2" /> <Monitor template="Vec3d" name="forces_vessel" listening="1" indices="249" showPositions="0" PositionsColor="1 1 0 1" showVelocities="0" VelocitiesColor="1 1 0 1" showForces="1" ForcesColor="0 1 1 1" showMinThreshold="0.01" TrajectoriesPrecision="0.1" TrajectoriesColor="1 1 0 1" sizeFactor="1" /> <PrecomputedConstraintCorrection recompute="true"/> <FixedConstraint name="FixedConstraint" indices="3 39 64 248 249" /> <Node name="Visu" > <OglModel name="VisualModel" fileMesh="mesh/artery-modified-smooth-hole-small.obj" scale3d="3 3 3" translation="10 0 0 "/> <BarycentricMapping name="visual mapping" input="@../dofs" output="@VisualModel" /> </Node> <Node name="Surf2"> <MeshObjLoader name="loader" filename="mesh/artery-modified-coarse-hole-small.obj" scale3d="3 3 3" translation="10 0 0"/> <Mesh src="@loader" /> <MechanicalObject src="@loader" dx="0.5" /> <Triangle /> <BarycentricMapping /> </Node> </Node> <Node name="Omni"> <MechanicalObject template="Rigid" name="DOFs" position="@GeomagicDevice.positionDevice"/> <MechanicalStateController template="Rigid" listening="true" mainDirection="-1.0 0.0 0.0" handleEventTriggersUpdate="true"/> <Node name="VisuAvatar" activated="false" > <OglModel name="Visual" fileMesh="mesh/sphere.obj" color="gray" scale="0.1"/> <RigidMapping input="@.." output="@Visual" index="0"/> </Node> <Node name="RefModel"> <MeshObjLoader filename="Demos/Dentistry/data/mesh/dental_instrument_centerline.obj" name="loader"/> <Mesh src="@loader" /> <MechanicalObject src="@loader" name="instrumentCollisionState" ry="-180" rz="-90" dz="3.5" dx="-0.3" /> <RigidMapping /> </Node> <Node name="RefModelRight" > <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" dy="0.5" /> <RigidMapping /> </Node> <Node name="RefModelLeft" > <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" dy="-0.5" /> <RigidMapping /> </Node> <PythonScriptController name="device" filename="E:/sofa-engine/sofa/applications/plugins/Geomagic/scenes/ScriptEvents.py" classname="geomagic"/> </Node> <Node name="beam"> <EulerImplicit rayleighStiffness="0.1" printLog="false" /> <CGLinearSolver template="GraphScattered" iterations="20" threshold="1e-008" tolerance="1e-5" /> <MechanicalObject template="Rigid" name="catheterDOFs" position="0 0 0 0 0 0 1 1 0 0 0 0 0 1 2 0 0 0 0 0 1 3 0 0 0 0 0 1 4 0 0 0 0 0 1 5 0 0 0 0 0 1 6 0 0 0 0 0 1 7 0 0 0 0 0 1 8 0 0 0 0 0 1 9 0 0 0 0 0 1 10 0 0 0 0 0 1 11 0 0 0 0 0 1 12 0 0 0 0 0 1 13 0 0 0 0 0 1 14 0 0 0 0 0 1 15 0 0 0 0 0 1 16 0 0 0 0 0 1 17 0 0 0 0 0 1 18 0 0 0 0 0 1 19 0 0 0 0 0 1 20 0 0 0 0 0 1 21 0 0 0 0 0 1 " rotation="0 -90 0"/> <Mesh name="lines" lines="0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21" /> <FixedConstraint name="FixedConstraint" indices="0" /> <UniformMass mass="1 1 0.01 0 0 0 0.1 0 0 0 0.1" printLog="false" /> <LCPForceFeedback activate="true" forceCoef="0.005"/> <!-- ADDED : Compute a force-feedback for the device --> <UncoupledConstraintCorrection/> <BeamFEMForceField name="FEM" radius="1" youngModulus="2000000000" poissonRatio="0.19"/> <Node name="Collision"> <CylinderGridTopology name="coli" nx="5" ny="5" nz="115" length="21" radius="0.05" axis="1 0 0" /> <MechanicalObject /> <BeamLinearMapping isMechanical="true" /> <Triangle /> </Node> <!-- <Node name="visu"> --> <!-- <OglModel name="VisualModel" fileMesh="mesh/cylinder_65_cm.obj" position="@../Collision/coli.position" edges="@../Collision/coli.edges"/> --> <!-- <!-- <OglCylinderModel name="VisualModel" position="0 0 0 10 0 0 " edges="0 1 1 2 2 3" /> --> --> <!-- <IdentityMapping /> --> <!-- </Node> --> <PythonScriptController name="catheter" filename="E:/sofa-engine/sofa/applications/plugins/Geomagic/scenes/ScriptEvents.py" classname="catheter"/> </Node> </Node>
does any can solve this problem,help me~
thanks!15 August 2017 at 20:56 #9919HugoKeymasterHey @xiaojuan
Have you tried to replace the bottom node :
<Node name="Collision"> <CylinderGridTopology name="coli" nx="5" ny="5" nz="115" length="21" radius="0.05" axis="1 0 0" /> <MechanicalObject /> <BeamLinearMapping isMechanical="true" /> <Triangle /> </Node>
with
<Line name="BeamCollisionModel"/>
If it’s working, could you share with us your meshes so that everyone can try your scene?
Best,Hugo
16 August 2017 at 03:28 #9920shangBlockedSorry,Hugo,it doesn’t work, there is not collision response,either.
I did replace the episode
<Node name="Collision"> <CylinderGridTopology name="coli" nx="5" ny="5" nz="115" length="21" radius="0.05" axis="1 0 0" /> <MechanicalObject /> <BeamLinearMapping isMechanical="true" /> <Triangle /> </Node>
with
<Line name="BeamCollisionModel"/>
but the console shows “object type ‘Line’ Creation Failed”
so I replaced
<Triangle />
with
<Line name="BeamCollisionModel"/>
and collision response did not show up, it seems that that object does not work.Is there any other solution alternative?
Thank you so much! -
AuthorPosts
- You must be logged in to reply to this topic.