Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply SOFA PR 4750 changes #148

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/python3/NeedleInsertion-predefinedPath.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def createScene(rootNode):
RigidBaseMO = rigidBaseNode.addObject('MechanicalObject', template='Rigid3d', name="RigidBaseMO",
position="0 0 0 0 0 0 1", showObject='1', showObjectScale='5.')
rigidBaseNode.addObject('RestShapeSpringsForceField', name='spring', stiffness="50000",
angularStiffness="50000", external_points="0", mstate="@RigidBaseMO", points="0",
angularStiffness="50000", externalIndices="0", mstate="@RigidBaseMO", indices="0",
template="Rigid3d")

###############
Expand Down
4 changes: 2 additions & 2 deletions examples/python3/PNLS_Example3.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def createScene(rootNode):
showObjectScale=0.3, position=[length, 0, 0, 0, 0, 0, 1], showObject=True)

beamFrame.addObject('RestShapeSpringsForceField', name='spring',
stiffness=1e8, angularStiffness=1e8, external_points=0,
external_rest_shape=controlMo.getLinkPath(), points=nbFrames, template="Rigid3d")
stiffness=1e8, angularStiffness=1e8, externalIndices=0,
external_rest_shape=controlMo.getLinkPath(), indices=nbFrames, template="Rigid3d")

cosseratNode = nonLinearCosserat.legendreControlPointsNode

Expand Down
4 changes: 2 additions & 2 deletions examples/python3/cosserat/CosseratBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ def _addRigidBaseNode(self):
name="spring",
stiffness=1e8,
angularStiffness=1.0e8,
external_points=0,
externalIndices=0,
mstate="@RigidBaseMO",
points=0,
indices=0,
template="Rigid3d",
)
return rigidBaseNode
Expand Down
4 changes: 2 additions & 2 deletions examples/python3/cosserat/cosseratObject.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ def addRigidBaseNode(self):
name="spring",
stiffness=1e8,
angularStiffness=1.0e8,
external_points=0,
externalIndices=0,
mstate="@RigidBaseMO",
points=0,
indices=0,
template="Rigid3d",
)
return rigidBaseNode
Expand Down
4 changes: 2 additions & 2 deletions examples/python3/cosserat/createFemRegularGrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def createFemCube(parentNode):
gelNode.addObject('TetrahedronFEMForceField', template='Vec3d', name='FEM', method='large',
poissonRatio='0.45', youngModulus='100')
gelNode.addObject('BoxROI', name='ROI1', box='40 -17 -10 100 -14 10', drawBoxes='true')
gelNode.addObject('RestShapeSpringsForceField', points='@ROI1.indices', stiffness='1e12')
gelNode.addObject('RestShapeSpringsForceField', indices='@ROI1.indices', stiffness='1e12')

surfaceNode = gelNode.addChild("surfaceNode")
surfaceNode.addObject('TriangleSetTopologyContainer', name="surfContainer", src="@../../GelSurface/Container")
Expand Down Expand Up @@ -72,7 +72,7 @@ def createFemCubeWithParams(parentNode, geometry):
gelNode.addObject('TetrahedronFEMForceField', template='Vec3d', name='FEM', method='large',
poissonRatio=geometry.poissonRatio, youngModulus=geometry.youngModulus)
gelNode.addObject('BoxROI', name='ROI1', box=geometry.box, drawBoxes='true')
gelNode.addObject('RestShapeSpringsForceField', points='@ROI1.indices', stiffness='1e12')
gelNode.addObject('RestShapeSpringsForceField', indices='@ROI1.indices', stiffness='1e12')

surfaceNode = gelNode.addChild("surfaceNode")
surfaceNode.addObject('TriangleSetTopologyContainer', name="surfContainer",
Expand Down
4 changes: 2 additions & 2 deletions examples/python3/cosserat/nonLinearCosserat.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ def addRigidBaseNode(self):
# to a control object in order to be able to drive it.
if int(self.attachingToLink.value):
rigidBaseNode.addObject('RestShapeSpringsForceField', name='spring',
stiffness=1e14, angularStiffness=1.e14, external_points=0,
mstate="@RigidBaseMO", points=0, template="Rigid3d")
stiffness=1e14, angularStiffness=1.e14, externalIndices=0,
mstate="@RigidBaseMO", indices=0, template="Rigid3d")
return rigidBaseNode

def addLegendrePolynomialsNode(self):
Expand Down
2 changes: 1 addition & 1 deletion examples/python3/tutorial/formation/chiba/Actuator.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def createScene(rootNode):
finger.addObject('BoxROI', name='boxROISubTopo', box=[23, -10, -8, 26, 10, 8], strict=False, drawBoxes=True)
finger.addObject('BoxROI', name='boxROISubTopo2', box=[0, -10, -4, 28, 10, -2], strict=False, drawBoxes=True)
finger.addObject('BoxROI', name='boxROI', box=[-2, -10, -20, 2, 10, 20], drawBoxes=True)
finger.addObject('RestShapeSpringsForceField', points='@boxROI.indices', stiffness=1e12, angularStiffness=1e12)
finger.addObject('RestShapeSpringsForceField', indices='@boxROI.indices', stiffness=1e12, angularStiffness=1e12)
finger.addObject('LinearSolverConstraintCorrection')
#Plastic Part
modelSubTopo = finger.addChild('modelSubTopo')
Expand Down
2 changes: 1 addition & 1 deletion examples/python3/tutorial/formation/chiba/actuator_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def createScene(root_node):
finger.addObject('BoxROI', name='boxROISubTopo', box=[23, -10, -8, 26, 10, 8], strict=False, drawBoxes=True)
finger.addObject('BoxROI', name='boxROISubTopo2', box=[0, -10, -4, 28, 10, -2], strict=False, drawBoxes=True)
finger.addObject('BoxROI', name='boxROI', box=[-2, -10, -20, 2, 10, 20], drawBoxes=True)
finger.addObject('RestShapeSpringsForceField', points='@boxROI.indices', stiffness=1e12, angularStiffness=1e12)
finger.addObject('RestShapeSpringsForceField', indices='@boxROI.indices', stiffness=1e12, angularStiffness=1e12)
finger.addObject('LinearSolverConstraintCorrection')
# Plastic Part
modelSubTopo = finger.addChild('modelSubTopo')
Expand Down
2 changes: 1 addition & 1 deletion examples/python3/tutorial/scene_w9991.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def _add_rigid_base(p_node):
position="0 0 0 0 0 0. 1", showObject=1, showObjectScale="0.1")
rigid_base_node.addObject('RestShapeSpringsForceField', template="Rigid3d", name="spring",
stiffness=stiffness_param, angularStiffness=stiffness_param,
mstate="@cosserat_base_mo", external_points="0", points="0")
mstate="@cosserat_base_mo", externalIndices="0", indices="0")
return rigid_base_node


Expand Down
2 changes: 1 addition & 1 deletion examples/python3/useful/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def addFEMObject(parentNode, path):

fingerSolver.addObject('BoxROI', name='ROI1', box='-18 -15 -8 2 -3 8', drawBoxes='true')
fingerSolver.addObject('RestShapeSpringsForceField',
points='@ROI1.indices', stiffness='1e12')
indices='@ROI1.indices', stiffness='1e12')
##########################################
# Cable points #
##########################################
Expand Down
2 changes: 1 addition & 1 deletion examples/python3/wip/completDirectNeedleInsertion.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def createScene(rootNode):
position="0 0 0 0 0 0 1", translation="-40. 0. 0.", showObject='1',
showObjectScale='5.')
rigidBaseNode.addObject('RestShapeSpringsForceField', name='spring', stiffness="50000",
angularStiffness="50000", external_points="0", mstate="@RigidBaseMO", points="0",
angularStiffness="50000", externalIndices="0", mstate="@RigidBaseMO", indices="0",
template="Rigid3d")

#############################################
Expand Down
2 changes: 1 addition & 1 deletion tutorial/text/cosserat_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Now, we'll dive into the essential part – configuring the Cosserat plugin with
def _add_rigid_base(p_node):
rigid_base_node = p_node.addChild('rigid_base')
rigid_base_node.addObject('MechanicalObject', template='Rigid3d', name="cosserat_base_mo", position="0 0 0 0 0 0. 1", showObject=1, showObjectScale='0.1')
rigid_base_node.addObject('RestShapeSpringsForceField', name='spring', stiffness=stiffness_param, angularStiffness=stiffness_param, external_points="0", mstate="@cosserat_base_mo", points="0", template="Rigid3d")
rigid_base_node.addObject('RestShapeSpringsForceField', name='spring', stiffness=stiffness_param, angularStiffness=stiffness_param, externalIndices="0", mstate="@cosserat_base_mo", indices="0", template="Rigid3d")
return rigid_base_node
```

Expand Down
4 changes: 2 additions & 2 deletions tutorial/tuto_scenes/step1.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def _add_rigid_base(p_node):
position="0 0 0 0 0 0. 1",
showObject=1, showObjectScale='0.1')
rigid_base_node.addObject('RestShapeSpringsForceField', name='spring', stiffness=stiffness_param,
angularStiffness=stiffness_param, external_points="0", mstate="@cosserat_base_mo",
points="0", template="Rigid3d")
angularStiffness=stiffness_param, externalIndices="0", mstate="@cosserat_base_mo",
indices="0", template="Rigid3d")
return rigid_base_node


Expand Down
4 changes: 2 additions & 2 deletions tutorial/tuto_scenes/tuto_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ def _add_rigid_base(p_node):
name="spring",
stiffness=stiffness_param,
angularStiffness=stiffness_param,
external_points="0",
externalIndices="0",
mstate="@cosserat_base_mo",
points="0",
indices="0",
template="Rigid3d",
)
return rigid_base_node
Expand Down
4 changes: 2 additions & 2 deletions tutorial/tuto_scenes/tuto_1_6dofs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def _add_rigid_base(p_node):
position="0 0 0 0 0 0. 1",
showObject=1, showObjectScale='0.1')
rigid_base_node.addObject('RestShapeSpringsForceField', name='spring', stiffness=stiffness_param,
angularStiffness=stiffness_param, external_points="0", mstate="@cosserat_base_mo",
points="0", template="Rigid3d")
angularStiffness=stiffness_param, externalIndices="0", mstate="@cosserat_base_mo",
indices="0", template="Rigid3d")
return rigid_base_node


Expand Down
4 changes: 2 additions & 2 deletions tutorial/tuto_scenes/tuto_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ def _add_rigid_base(p_node):
name="spring",
stiffness=stiffness_param,
angularStiffness=stiffness_param,
external_points="0",
externalIndices="0",
mstate="@cosserat_base_mo",
points="0",
indices="0",
template="Rigid3d",
)
return rigid_base_node
Expand Down
4 changes: 2 additions & 2 deletions tutorial/tuto_scenes/tuto_2_6dofs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def _add_rigid_base(p_node):
position="0 0 0 0 0 0. 1",
showObject=1, showObjectScale='0.1')
rigid_base_node.addObject('RestShapeSpringsForceField', name='spring', stiffness=stiffness_param,
angularStiffness=stiffness_param, external_points="0", mstate="@cosserat_base_mo",
points="0", template="Rigid3d", activeDirections=[0,1,1,1,1,1,1])
angularStiffness=stiffness_param, externalIndices="0", mstate="@cosserat_base_mo",
indices="0", template="Rigid3d", activeDirections=[0,1,1,1,1,1,1])
return rigid_base_node


Expand Down
4 changes: 2 additions & 2 deletions tutorial/tuto_scenes/tuto_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def createScene(root_node):
showObject=True)
if controller_type == 3:
cosserat_frames.addObject('RestShapeSpringsForceField', name='spring', stiffness=0., angularStiffness=1.e8,
external_points=0, external_rest_shape=controller_state.getLinkPath(),
points=geoParams.nbFrames, template="Rigid3d")
externalIndices=0, external_rest_shape=controller_state.getLinkPath(),
indices=geoParams.nbFrames, template="Rigid3d")

solver_node.addObject(ForceController(forceNode=const_force_node, frame_node=cosserat_frames, force_type=controller_type, tip_controller=controller_state))

Expand Down
4 changes: 2 additions & 2 deletions tutorial/tuto_scenes/tuto_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ def createScene(root_node):
# showObject=True)
#
# cosserat_frames.addObject('RestShapeSpringsForceField', name='spring', stiffness=1e8, angularStiffness=1e8,
# external_points=0, external_rest_shape=controller_state.getLinkPath(),
# points=geoParams.nbFrames, template="Rigid3d")
# externalIndices=0, external_rest_shape=controller_state.getLinkPath(),
# indices=geoParams.nbFrames, template="Rigid3d")
#
# solver_node.addObject(ForceController(forceNode=const_force_node, frame_node=cosserat_frames, force_type=3,
# tip_controller=controller_state))
Expand Down
4 changes: 2 additions & 2 deletions tutorial/tuto_scenes/tuto_compare_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def _add_rigid_base(p_node, _name='rigid_base'):
position="0 0 0 0 0 0. 1",
showObject=0, showObjectScale='0.')
rigid_base_node.addObject('RestShapeSpringsForceField', name='spring', stiffness=stiffness_param,
angularStiffness=stiffness_param, external_points="0", mstate="@cosserat_base_mo",
points="0", template="Rigid3d", activeDirections=[1,1,1,1,1,1,1])
angularStiffness=stiffness_param, externalIndices="0", mstate="@cosserat_base_mo",
indices="0", template="Rigid3d", activeDirections=[1,1,1,1,1,1,1])
return rigid_base_node


Expand Down
Loading