diff --git a/examples/python3/useful/header.py b/examples/python3/useful/header.py index f3b2da3..a106879 100644 --- a/examples/python3/useful/header.py +++ b/examples/python3/useful/header.py @@ -146,7 +146,7 @@ def addSolverNode(parent_node, name='solverNode', template='CompressedRowSparseM if iterative: solver_node.addObject('CGLinearSolver', name='Solver', template=template) else: - solver_node.addObject('SparseLDLSolver', name='Solver', template=template, printLog=True) + solver_node.addObject('SparseLDLSolver', name='Solver', template=template, printLog=False) if isConstrained: solver_node.addObject('GenericConstraintCorrection', linearSolver=solver_node.Solver.getLinkPath()) diff --git a/tutorial/tuto_scenes/tuto_5.py b/tutorial/tuto_scenes/tuto_5.py index 3aab112..b37662f 100644 --- a/tutorial/tuto_scenes/tuto_5.py +++ b/tutorial/tuto_scenes/tuto_5.py @@ -34,7 +34,7 @@ Params = Parameters(beam_geo_params=geoParams, beam_physics_params=physicsParams, simu_params=simuParams) femPos = [[0.0, 0, 0], [15., 0, 0], [30., 0, 0], [45., 0, 0], [60., 0, 0], [66., 0, 0], [81., 0.0, 0.0]] - +is_constrained = False class ForceController(Sofa.Core.Controller): def __init__(self, *args, **kwargs): @@ -101,9 +101,9 @@ def onKeypressedEvent(self, event): def createScene(root_node): addHeader(root_node, is_constrained=True) - root_node.gravity = [0, 0., 0.] + root_node.gravity = [0, -9.81, 0.] - solver_node = addSolverNode(root_node, name="cable_node", isConstrained=True) + solver_node = addSolverNode(root_node, name="cable_node", isConstrained=is_constrained) # create cosserat Beam cosserat_beam = solver_node.addChild(CosseratBase(parent=solver_node, params=Params)) @@ -117,6 +117,8 @@ def createScene(root_node): finger_node, fem_points_node = addFEMObject(root_node, path=path, name="Finger") + return root_node + # This creates a new node in the scene. This node is appended to the finger's node. cable_state_node = cosserat_frames_node.addChild('cable_state_node')