1212g_needleTotalMass = 0.01
1313
1414g_gelRegularGridParameters = {
15- "n" :[8 , 8 , 8 ],
15+ "n" :[6 , 6 , 6 ],
1616 "min" :[- 0.125 , - 0.125 , - 0.350 ],
1717 "max" :[0.125 , 0.125 , - 0.100 ]
1818} #Again all in mm
@@ -65,13 +65,12 @@ def createScene(root):
6565
6666 needleBaseMaster = root .addChild ("NeedleBaseMaster" )
6767 needleBaseMaster .addObject ("MechanicalObject" , name = "mstate_baseMaster" , template = "Rigid3d" , showObjectScale = 0.002 , showObject = False , drawMode = 1
68- #, position=[0.04, 0.04, 0, 0, 0, 0, 1])
6968 , position = "@reader.position" )
70- #needleBaseMaster.addObject("LinearMovementProjectiveConstraint",indices =[0], keyTimes=[0,1,7,9],movements=
71- # [ [0.04, 0.04,0,0,0,0]
72- # , [0.04, 0.04,0.05,0, 3.14/2,0]
73- # , [0.04, 0.04,-0.07,0, 3.14/2,0]
74- # , [0.05, 0.04,-0.07,0, 3.14/2 + 3.14/16,0]
69+ # , position =[0.04, 0.04, 0, 0, 0, 0, 1])
70+ #needleBaseMaster.addObject("LinearMovementProjectiveConstraint",indices=[0], keyTimes=[0,1.0,1.5],movements=
71+ # [ [0.04, 0.04, 0.05, 0, 3.14/2, 0]
72+ # , [0.04, 0.04, -0.04, 0, 3.14/2, 0]
73+ # , [0.05, 0.04, -0.04, 0, 3.14/2 + 3.14/16, 0]
7574 #],relativeMovements=False)
7675 #needleBaseMaster.addObject("WriteState", name="writer", filename="RecordState/NeedleInsertion.txt"
7776 # , period=0.01, writeX=True, writeV=True, time=0)
@@ -149,8 +148,7 @@ def createScene(root):
149148
150149 volume .addObject ("MechanicalObject" , name = "mstate_gel" , template = "Vec3d" )
151150 volume .addObject ("TetrahedronGeometry" , name = "geom_tetra" , mstate = "@mstate_gel" , topology = "@TetraContainer" , draw = False )
152- volume .addObject ("AABBBroadPhase" ,name = "AABBTetra" ,geometry = "@geom_tetra" ,nbox = [3 ,3 ,3 ],thread = 1 )
153- volume .addObject ("TetrahedronFEMForceField" , name = "FF" ,** g_gelMechanicalParameters )
151+ volume .addObject ("FastTetrahedralCorotationalForceField" , name = "FF" ,** g_gelMechanicalParameters )
154152 volume .addObject ("MeshMatrixMass" , name = "Mass" ,totalMass = g_gelTotalMass )
155153
156154 volume .addObject ("BoxROI" ,name = "BoxROI" ,box = g_gelFixedBoxROI )
@@ -165,7 +163,7 @@ def createScene(root):
165163 volumeCollision .addObject ("MechanicalObject" , name = "mstate_gelColi" ,position = "@../TetraContainer.position" )
166164 volumeCollision .addObject ("TriangleGeometry" , name = "geom_tri" , mstate = "@mstate_gelColi" , topology = "@TriContainer" ,draw = False )
167165 volumeCollision .addObject ("PhongTriangleNormalHandler" , name = "SurfaceTriangles" , geometry = "@geom_tri" )
168- volumeCollision .addObject ("AABBBroadPhase" ,name = "AABBTriangles" ,thread = 1 ,nbox = [2 ,2 ,3 ])
166+ volumeCollision .addObject ("AABBBroadPhase" , name = "AABBTriangles" , thread = 1 , nbox = [2 ,2 ,3 ], method = 2 )
169167
170168 volumeCollision .addObject ("IdentityMapping" , name = "identityMappingToCollision" , input = "@../mstate_gel" , output = "@mstate_gelColi" , isMechanical = True )
171169
@@ -189,7 +187,7 @@ def createScene(root):
189187 surfGeom = "@Volume/collision/geom_tri" ,
190188 shaftGeom = "@Needle/bodyCollision/geom_body" ,
191189 volGeom = "@Volume/geom_tetra" ,
192- punctureForceThreshold = 20 ,
190+ punctureForceThreshold = 16 ,
193191 tipDistThreshold = 0.003 ,
194192 drawcollision = True ,
195193 drawPointsScale = 0.0001
@@ -199,4 +197,4 @@ def createScene(root):
199197 root .addObject ("ConstraintUnilateral" ,input = "@InsertionAlgo.collisionOutput" ,directions = "@punctureDirection" ,draw_scale = 0.001 )
200198
201199 root .addObject ("FirstDirection" ,name = "bindDirection" , handler = "@Needle/bodyCollision/NeedleBeams" )
202- root .addObject ("ConstraintInsertion" ,input = "@InsertionAlgo.insertionOutput" , directions = "@bindDirection" ,draw_scale = 0.002 , frictionCoeff = 0.01 )
200+ root .addObject ("ConstraintInsertion" ,input = "@InsertionAlgo.insertionOutput" , directions = "@bindDirection" ,draw_scale = 0.002 , frictionCoeff = 0.002 )
0 commit comments