diff --git a/examples/python3/NeedleInsertion.py b/examples/python3/NeedleInsertion.py index 391914a8..9d614381 100644 --- a/examples/python3/NeedleInsertion.py +++ b/examples/python3/NeedleInsertion.py @@ -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() @@ -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 diff --git a/examples/python3/cosserat/needle/needleController.py b/examples/python3/cosserat/needle/needleController.py index 648573ee..0c029391 100644 --- a/examples/python3/cosserat/needle/needleController.py +++ b/examples/python3/cosserat/needle/needleController.py @@ -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):