Skip to content

Commit 59534fb

Browse files
committed
[scene] Added puncture layers with acceptable FPS levels
1 parent 1c7197c commit 59534fb

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

scenes/NeedleInsertionLayers.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313

1414
g_gelRegularGridParameters = [
1515
{
16-
"n":[12, 4, 6],
16+
"n":[6, 4, 4],
1717
"min":[-0.350, -0.050, -0.350],
18-
"max":[0.350, 0.049, -0.100]
18+
"max":[0.350, 0.0499, -0.100]
1919
},
2020
{
21-
"n":[12, 4, 6],
22-
"min":[-0.350, 0.051, -0.350],
21+
"n":[6, 4, 4],
22+
"min":[-0.350, 0.0501, -0.350],
2323
"max":[0.350, 0.150, -0.100]
2424
}
2525
] #Again all in mm
2626
g_gelMechanicalParameters = {
27-
"youngModulus":8e5,
27+
"youngModulus":8e7,
2828
"poissonRatio":0.45,
2929
"method":"large"
3030
}
@@ -163,7 +163,8 @@ def createScene(root):
163163
volume.addObject("MeshMatrixMass", name="Mass",totalMass=g_gelTotalMass)
164164

165165
volume.addObject("BoxROI",name="BoxROI",box=g_gelFixedBoxROI)
166-
volume.addObject("RestShapeSpringsForceField", stiffness=1e6,points="@BoxROI.indices" )
166+
volume.addObject("RestShapeSpringsForceField", stiffness=1e6, points="@BoxROI.indices" )
167+
volume.addObject("FixedLagrangianConstraint", indices="@BoxROI.indices" )
167168

168169
volume.addObject("LinearSolverConstraintCorrection", printLog=False, linearSolver="@LinearSolver")
169170

@@ -197,6 +198,12 @@ def createScene(root):
197198
color=g_wireColor[i],name="volume_visu",template="Vec3d")
198199
volumeVisuWire.addObject("IdentityMapping")
199200

201+
root.addObject("NearestPointROI", template="Vec3d", name="attachROI", radius=0.0025,
202+
object1="@Layer0/mstate_gel", object2="@Layer1/mstate_gel")
203+
root.addObject("BilateralLagrangianConstraint", name="layerAttachment",
204+
first_point="@attachROI.indices1", second_point="@attachROI.indices2",
205+
object1="@Layer0/mstate_gel", object2="@Layer1/mstate_gel")
206+
200207

201208
#root.addObject("InsertionAlgorithm", name="InsertionAlgo",
202209
# tipGeom="@Needle/tipCollision/geom_tip",

0 commit comments

Comments
 (0)