Skip to content

Commit

Permalink
Fix needle insertion due to module path not updated (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxbilger authored Nov 29, 2024
1 parent 6fcce88 commit 05d1dd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions examples/python3/NeedleInsertion.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from cosserat.usefulFunctions import pluginList
from cosserat.createFemRegularGrid import createFemCubeWithParams
from cosserat.cosseratObject import Cosserat
from cosserat.utils import addConstraintPoint
from useful.utils import addConstraintPoint
import sys

# params = NeedleParameters()
Expand Down Expand Up @@ -57,10 +57,9 @@ def createScene(rootNode):
solverNode.addObject('SparseLDLSolver', name='solver', template="CompressedRowSparseMatrixd")
solverNode.addObject('GenericConstraintCorrection')

needle = solverNode.addChild(
Cosserat(parent=solverNode, cosseratGeometry=needleGeometryConfig, radius=GeometryParams.radius,
name="needle", youngModulus=PhysicsParams.youngModulus, poissonRatio=PhysicsParams.poissonRatio,
rayleighStiffness=PhysicsParams.rayleighStiffness))
needle = Cosserat(parent=solverNode, cosseratGeometry=needleGeometryConfig, radius=GeometryParams.radius,
name="needle", youngModulus=PhysicsParams.youngModulus, poissonRatio=PhysicsParams.poissonRatio,
rayleighStiffness=PhysicsParams.rayleighStiffness)
needleCollisionModel = needle.addPointCollisionModel("needleCollision")

# These state is mapped on the needle and used to compute the distance between the needle and the
Expand Down
2 changes: 1 addition & 1 deletion examples/python3/cosserat/needle/needleController.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import Sofa
import Cosserat
from cosserat.needle.params import ConstraintsParams
from cosserat.utils import computePositiveAlongXDistanceBetweenPoints, computeNegativeAlongXDistanceBetweenPoints
from useful.utils import computePositiveAlongXDistanceBetweenPoints, computeNegativeAlongXDistanceBetweenPoints


class Animation(Sofa.Core.Controller):
Expand Down

0 comments on commit 05d1dd8

Please sign in to comment.