Skip to content

Commit 0aa3b2a

Browse files
committed
[scene] Placed attachment between the impermeable ground and the middle layer
1 parent 24c5ea1 commit 0aa3b2a

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

scenes/NeedleInsertionLayers.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"max":[0.150, 0.060, -0.100]
2525
},
2626
{
27-
"n":[12, 4, 8],
27+
"n":[6, 4, 4],
2828
"min":[-0.150, -0.080, -0.250],
2929
"max":[0.150, -0.0501, -0.100]
3030
}
@@ -73,7 +73,7 @@ def createScene(root):
7373
root.addObject("ConstraintAttachButtonSetting")
7474
root.addObject("VisualStyle", displayFlags="showVisualModels hideBehaviorModels showCollisionModels hideMappings hideForceFields showWireframe showInteractionForceFields")
7575
root.addObject("FreeMotionAnimationLoop")
76-
root.addObject("GenericConstraintSolver", tolerance=0.00001, maxIt=5000, regularizationTerm=0.001)
76+
root.addObject("GenericConstraintSolver", tolerance=1e-5, maxIt=5000, regularizationTerm=1e-5)
7777
root.addObject("CollisionLoop")
7878

7979
needleBaseMaster = root.addChild("NeedleBaseMaster")
@@ -138,7 +138,7 @@ def createScene(root):
138138

139139

140140

141-
for i in range(0,2):
141+
for i in range(0,3):
142142
gelGridTopoName = "GelGridTopo" + str(i)
143143
gelTopo = root.addChild(gelGridTopoName)
144144
gelTopo.addObject("RegularGridTopology", name="HexaTop", **g_gelRegularGridParameters[i])
@@ -186,14 +186,20 @@ def createScene(root):
186186
color=g_wireColor[i],name="volume_visu",template="Vec3d")
187187
volumeVisuWire.addObject("IdentityMapping")
188188

189-
root.addObject("NearestPointROI", template="Vec3d", name="attachROI", radius=0.0025,
189+
root.addObject("NearestPointROI", template="Vec3d", name="RedYellow", radius=0.0025,
190190
object1="@Layer0/mstate_gel", object2="@Layer1/mstate_gel")
191-
root.addObject("BilateralLagrangianConstraint", name="layerAttachment",
192-
first_point="@attachROI.indices1", second_point="@attachROI.indices2",
191+
root.addObject("BilateralLagrangianConstraint", name="RedYellowAttachment",
192+
first_point="@RedYellow.indices1", second_point="@RedYellow.indices2",
193193
object1="@Layer0/mstate_gel", object2="@Layer1/mstate_gel")
194194

195+
root.addObject("NearestPointROI", template="Vec3d", name="RedWhite", radius=0.0025,
196+
object1="@Layer0/mstate_gel", object2="@Layer2/mstate_gel")
197+
root.addObject("BilateralLagrangianConstraint", name="RedWhiteAttachment",
198+
first_point="@RedWhite.indices1", second_point="@RedWhite.indices2",
199+
object1="@Layer0/mstate_gel", object2="@Layer2/mstate_gel")
200+
195201

196-
for i in range(0,2):
202+
for i in range(0,3):
197203
algo = root.addChild("algo"+str(i))
198204
punctureForce = 1.5 if i < 2 else 2000
199205
algo.addObject("InsertionAlgorithm", name="InsertionAlgo"+str(i),
@@ -202,7 +208,7 @@ def createScene(root):
202208
shaftGeom="@/Needle/bodyCollision/geom_body",
203209
volGeom="@/Layer"+str(i)+"/geom_tetra",
204210
punctureForceThreshold=punctureForce,
205-
tipDistThreshold=0.005,
211+
tipDistThreshold=0.009,
206212
drawcollision=True,
207213
drawPointsScale=0.0001
208214
)

0 commit comments

Comments
 (0)