From 254e6b78d8d318c03d82975b2b853691b7de3f1a Mon Sep 17 00:00:00 2001 From: Themis Skamagkis Date: Thu, 24 Jul 2025 11:33:25 +0200 Subject: [PATCH 1/3] [Needle][scene] Adjusted scene to enable friction --- scenes/NeedleInsertion.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scenes/NeedleInsertion.py b/scenes/NeedleInsertion.py index 7671bf92..3646684c 100644 --- a/scenes/NeedleInsertion.py +++ b/scenes/NeedleInsertion.py @@ -183,7 +183,7 @@ def createScene(root): fromVol="@Needle/bodyCollision/geom_body", destVol="@Volume/geom_tetra", punctureThreshold=0.05, - slideDistance=0.005, + slideDistance=0.003, drawcollision=True, sphereRadius=0.0001 #projective=True @@ -193,6 +193,4 @@ def createScene(root): root.addObject("ConstraintUnilateral",input="@InsertionAlgo.output",directions="@punctureDirection",draw_scale="0.001")#, mu="0.001") root.addObject("FirstDirection",name="bindDirection", handler="@Needle/bodyCollision/NeedleBeams") - root.addObject("ConstraintInsertion",input="@InsertionAlgo.outputList", directions="@bindDirection",draw_scale="0.005")#, mu="0.001") - - + root.addObject("ConstraintInsertion",input="@InsertionAlgo.outputList", directions="@bindDirection",draw_scale="0.002", frictionCoeff=0.1) From 1572558c4dd38c813e37fe8f266b0a53ecd66f5d Mon Sep 17 00:00:00 2001 From: Themis Skamagkis Date: Fri, 25 Jul 2025 17:09:38 +0200 Subject: [PATCH 2/3] [Needle][scene] Adjusted Gauss-Seidel tolerance - constraint solver struggled to comply --- scenes/NeedleInsertion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scenes/NeedleInsertion.py b/scenes/NeedleInsertion.py index 3646684c..1c967171 100644 --- a/scenes/NeedleInsertion.py +++ b/scenes/NeedleInsertion.py @@ -59,7 +59,7 @@ def createScene(root): root.addObject("ConstraintAttachButtonSetting") root.addObject("VisualStyle", displayFlags="showVisualModels hideBehaviorModels showCollisionModels hideMappings hideForceFields showWireframe showInteractionForceFields" ) root.addObject("FreeMotionAnimationLoop") - root.addObject("GenericConstraintSolver", tolerance=0.01, maxIt=5000, printLog=False, computeConstraintForces=True) + root.addObject("GenericConstraintSolver", tolerance=0.00001, maxIt=5000, printLog=False, computeConstraintForces=True) root.addObject("CollisionLoop") needleBaseMaster = root.addChild("NeedleBaseMaster") @@ -193,4 +193,4 @@ def createScene(root): root.addObject("ConstraintUnilateral",input="@InsertionAlgo.output",directions="@punctureDirection",draw_scale="0.001")#, mu="0.001") root.addObject("FirstDirection",name="bindDirection", handler="@Needle/bodyCollision/NeedleBeams") - root.addObject("ConstraintInsertion",input="@InsertionAlgo.outputList", directions="@bindDirection",draw_scale="0.002", frictionCoeff=0.1) + root.addObject("ConstraintInsertion",input="@InsertionAlgo.outputList", directions="@bindDirection",draw_scale="0.002", frictionCoeff=0.0) From dfc4f0b921e135df3d352bc5cf15012211362050 Mon Sep 17 00:00:00 2001 From: Themis Skamagkis Date: Fri, 25 Jul 2025 17:34:43 +0200 Subject: [PATCH 3/3] [Needle][scene] Increased stiffness of the gel volume to allow for the needle to bend --- scenes/NeedleInsertion.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scenes/NeedleInsertion.py b/scenes/NeedleInsertion.py index 1c967171..18eb747d 100644 --- a/scenes/NeedleInsertion.py +++ b/scenes/NeedleInsertion.py @@ -17,7 +17,7 @@ "max":[0.125, 0.125, -0.100] } #Again all in mm g_gelMechanicalParameters = { - "youngModulus":8000, + "youngModulus":8e5, "poissonRatio":0.45, "method":"large" } @@ -182,7 +182,7 @@ def createScene(root): destGeom="@Volume/collision/geom_tri", fromVol="@Needle/bodyCollision/geom_body", destVol="@Volume/geom_tetra", - punctureThreshold=0.05, + punctureThreshold=2., slideDistance=0.003, drawcollision=True, sphereRadius=0.0001 @@ -193,4 +193,4 @@ def createScene(root): root.addObject("ConstraintUnilateral",input="@InsertionAlgo.output",directions="@punctureDirection",draw_scale="0.001")#, mu="0.001") root.addObject("FirstDirection",name="bindDirection", handler="@Needle/bodyCollision/NeedleBeams") - root.addObject("ConstraintInsertion",input="@InsertionAlgo.outputList", directions="@bindDirection",draw_scale="0.002", frictionCoeff=0.0) + root.addObject("ConstraintInsertion",input="@InsertionAlgo.outputList", directions="@bindDirection",draw_scale="0.002", frictionCoeff=0.05)