@@ -94,14 +94,15 @@ def createScene(root):
9494 needleBodyCollision = needle .addChild ("bodyCollision" )
9595 needleBodyCollision .addObject ("EdgeSetTopologyContainer" , name = "Container_body" , src = "@../Container" )
9696 needleBodyCollision .addObject ("MechanicalObject" ,name = "mstate_body" , template = "Vec3d" ,)
97- needleBodyCollision .addObject ("EdgeGeometry" ,name = "geom" ,mstate = "@mstate_body" , topology = "@Container_body" )
97+ needleBodyCollision .addObject ("EdgeGeometry" ,name = "geom_body" ,mstate = "@mstate_body" , topology = "@Container_body" )
98+ needleBodyCollision .addObject ("EdgeNormalHandler" , name = "NeedleBeams" , geometry = "@geom_body" )
9899
99100 needleBodyCollision .addObject ("IdentityMapping" )
100101
101102
102103 needleTipCollision = needle .addChild ("tipCollision" )
103104 needleTipCollision .addObject ("MechanicalObject" ,name = "mstate_tip" ,position = [g_needleLength + g_needleBaseOffset [0 ], g_needleBaseOffset [1 ], g_needleBaseOffset [2 ]],template = "Vec3d" ,)
104- needleTipCollision .addObject ("PointGeometry" ,name = "geom " ,mstate = "@mstate_tip" )
105+ needleTipCollision .addObject ("PointGeometry" ,name = "geom_tip " ,mstate = "@mstate_tip" )
105106 needleTipCollision .addObject ("RigidMapping" ,globalToLocalCoords = True ,index = g_needleNumberOfElems )
106107
107108
@@ -177,21 +178,21 @@ def createScene(root):
177178
178179
179180 root .addObject ("InsertionAlgorithm" , name = "InsertionAlgo" ,
180- fromGeom = "@Needle/tipCollision/geom " ,
181+ fromGeom = "@Needle/tipCollision/geom_tip " ,
181182 destGeom = "@Volume/collision/geom_tri" ,
182- fromVol = "@Needle/bodyCollision/geom " ,
183+ fromVol = "@Needle/bodyCollision/geom_body " ,
183184 destVol = "@Volume/geom_tetra" ,
184- punctureThreshold = 0.1 ,
185- slideDistance = 0.005
185+ punctureThreshold = 0.05 ,
186+ slideDistance = 0.005 ,
187+ drawcollision = True ,
188+ sphereRadius = 0.0001
186189 #projective=True
187190 )
188191 root .addObject ("DistanceFilter" ,algo = "@InsertionAlgo" ,distance = 0.01 )
189192 root .addObject ("SecondDirection" ,name = "punctureDirection" ,handler = "@Volume/collision/SurfaceTriangles" )
190193 root .addObject ("ConstraintUnilateral" ,input = "@InsertionAlgo.output" ,directions = "@punctureDirection" ,draw_scale = "0.001" )#, mu="0.001")
191194
195+ root .addObject ("FirstDirection" ,name = "bindDirection" , handler = "@Needle/bodyCollision/NeedleBeams" )
196+ root .addObject ("ConstraintInsertion" ,input = "@InsertionAlgo.outputList" , directions = "@bindDirection" ,draw_scale = "0.005" )#, mu="0.001")
192197
193- #root.addObject("InsertionAlgorithm",name="InsertionAlgo",fromGeom="@Needle/tipCollision/geom", destGeom="@Volume/tri_geom")
194- #root.addObject("DistanceFilter",algo="@InsertionAlgo",distance=0.005)
195- #root.addObject("BindDirection",name="insertionDirection")#,handler="@Volume/InternalTriangles")
196- #root.addObject("ConstraintBilateral",input="@InsertionAlgo.output",directions="@punctureDirection",draw_scale="0.001")
197198
0 commit comments