Skip to content
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 GmshTutorial/SurfacePressureConstraint_Accordion.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def createScene(rootNode):
bunny.addObject('TetrahedronFEMForceField', template='Vec3', name='FEM', method='large', poissonRatio=0.3, youngModulus=18000)

bunny.addObject('BoxROI', name='boxROI', box=[-15, -7, -15, 15, -3, 15], drawBoxes=True, position="@tetras.rest_position", tetrahedra="@container.tetrahedra")
bunny.addObject('RestShapeSpringsForceField', points='@boxROI.indices', stiffness=1e12)
bunny.addObject('FixedWeakConstraint', indices='@boxROI.indices', stiffness=1e12)

bunny.addObject('SparseLDLSolver', name='preconditioner')
bunny.addObject('LinearSolverConstraintCorrection', solverName='preconditioner')
Expand Down
4 changes: 2 additions & 2 deletions Models/CabledTrunk/CabledTrunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def createScene(rootNode, config):
# Fix base of the Trunk
trunk.addObject('BoxROI', name='boxROI', box=[[-20*config.mm, -20*config.mm, -config.d_ext-(config.d_in/2)], [20*config.mm, 20*config.mm, 0]], drawBoxes=True)
#trunk.addObject('PartialFixedConstraint', fixedDirections=[1, 1, 1], indices='@boxROI.indices')
trunk.addObject('RestShapeSpringsForceField', points='@boxROI.indices', stiffness=1e10)
trunk.addObject('FixedWeakConstraint', indices='@boxROI.indices', stiffness=1e10)


##################
Expand Down Expand Up @@ -334,7 +334,7 @@ def createScene(rootNode, config):
corridor = simulation.addChild("Corridor_" + str(i))
corridor.addObject('MechanicalObject', template="Rigid3", scale="0.001", dx="0.0", dy="0.0", dz="0.0")
#corridor.addObject("UniformMass", totalMass = 100.0)
corridor.addObject('RestShapeSpringsForceField', stiffness=1e10)
corridor.addObject('FixedWeakConstraint', stiffness=1e10, fixAll=True)


contacts_corridor = corridor.addChild("CollisionModel")
Expand Down
4 changes: 2 additions & 2 deletions Models/SensorFinger/SensorFinger.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def createScene(rootNode, config):
model = rootNode.addChild('model')
model.addObject('EulerImplicitSolver', name='odesolver', firstOrder=0, rayleighMass=0.1, rayleighStiffness=0.1)
model.addObject('SparseLDLSolver', name='precond', template = "CompressedRowSparseMatrixd")
model.addObject('GenericConstraintCorrection')
model.addObject('GenericConstraintCorrection', solverName="precond")

##################
### Load model ###
Expand All @@ -159,7 +159,7 @@ def createScene(rootNode, config):
BoxMargin = 3
BoxCoords = [-(config.Thickness/2+BoxMargin), -BoxMargin, BoxMargin, config.Thickness/2+BoxMargin,config.Height+2*BoxMargin, -BoxMargin]
model.addObject('BoxROI', name='boxROI', box=BoxCoords, drawBoxes=True)
model.addObject('RestShapeSpringsForceField', points='@boxROI.indices', stiffness=1e10)
model.addObject('FixedWeakConstraint', indices='@boxROI.indices', stiffness=1e10)

FollowingMONode = model.addChild('FollowingMONode')
FollowingMONode.addObject("MechanicalObject", name="FollowingMO", template="Vec3d", position=[0.0, 0, -3.0*config.Length], showObject=True, showObjectScale=20, showColor="0 0 1")
Expand Down
2 changes: 1 addition & 1 deletion Models/SensorFinger4Cavities/SensorFinger4Cavities.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def createScene(rootNode, config):
BoxMargin = 3
BoxCoords = [-(config.Thickness/2+BoxMargin), -BoxMargin, BoxMargin, config.Thickness/2+BoxMargin,config.Height+2*BoxMargin, -BoxMargin]
model.addObject('BoxROI', name='boxROI', box=BoxCoords, drawBoxes=True)
model.addObject('RestShapeSpringsForceField', points='@boxROI.indices', stiffness=1e10)
model.addObject('FixedWeakConstraint', indices='@boxROI.indices', stiffness=1e10)

FollowingMONode = model.addChild('FollowingMONode')
FollowingMONode.addObject("MechanicalObject", name="FollowingMO", template="Vec3d", position=[0.0, 0, -3.0*config.Length], showObject=True, showObjectScale=20, showColor="0 0 1")
Expand Down
4 changes: 2 additions & 2 deletions Models/TripodFinger/Components/fixing_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ def __init__(self, parent, target, name='FixingBox',
c = self.node.addChild('Constraint')
target.addChild(c)

c.addObject('RestShapeSpringsForceField',
points=self.node.BoxROI.getData('indices').getLinkPath(),
c.addObject('FixedWeakConstraint',
indices=self.node.BoxROI.getData('indices').getLinkPath(),
stiffness=1e12)
2 changes: 1 addition & 1 deletion Models/TripodFinger/Components/s90_servo.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def init(self):
angle = self.addChild('Articulation')
angle.addObject('MechanicalObject', name='dofs', template='Vec1', position=[[self.getData('angleIn')]],
rest_position=self.getData('angleIn').getLinkPath())
angle.addObject('RestShapeSpringsForceField', points=0, stiffness=1e9)
angle.addObject('FixedWeakConstraint', indices=0, stiffness=1e9)
angle.addObject('UniformMass', totalMass=0.01)

servoWheel = angle.addChild('ServoWheel')
Expand Down
2 changes: 1 addition & 1 deletion Models/TripodFinger/TripodFinger.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def onAnimateBeginEvent(self, dt):

def evaluate_torque(self):
# As the torque is modeled as a Spring, we compute the torque as k * (theta - theta_0)
k = self.actuator.ServoMotor.Articulation.RestShapeSpringsForceField.stiffness.value
k = self.actuator.ServoMotor.Articulation.FixedWeakConstraint.stiffness.value
theta_0 = self.actuator.ServoMotor.Articulation.dofs.rest_position.value
theta = self.actuator.ServoMotor.Articulation.dofs.position.value
return k * (theta - theta_0)
Expand Down