From 3a9297f4ac9e7b4da07461e11b762ebee558787a Mon Sep 17 00:00:00 2001 From: Paul Baksic Date: Tue, 26 Aug 2025 16:07:35 +0200 Subject: [PATCH] Apply changes from SOFA PR 5666 regarding GenericConstraintSolver --- python3/src/stlib3/communication/UDP_controller.py | 2 +- python3/src/stlib3/scene/contactheader.py | 4 ++-- python3/src/stlib3/scene/mainheader.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python3/src/stlib3/communication/UDP_controller.py b/python3/src/stlib3/communication/UDP_controller.py index 8079e74..8bee2c8 100644 --- a/python3/src/stlib3/communication/UDP_controller.py +++ b/python3/src/stlib3/communication/UDP_controller.py @@ -56,7 +56,7 @@ def createScene(rootNode): rootNode.addObject('RequiredPlugin', name='SofaPython3') rootNode.addObject('FreeMotionMasterSolver') - rootNode.addObject('GenericConstraintSolver',maxIterations=1000 ,tolerance=0.001) + rootNode.addObject('ProjectedGaussSeidelConstraintSolver',maxIterations=1000 ,tolerance=0.001) rootNode.addObject(UDP) Beam = rootNode.addChild('Beam') diff --git a/python3/src/stlib3/scene/contactheader.py b/python3/src/stlib3/scene/contactheader.py index 2d50f5c..fe6b4fe 100644 --- a/python3/src/stlib3/scene/contactheader.py +++ b/python3/src/stlib3/scene/contactheader.py @@ -41,8 +41,8 @@ def ContactHeader(applyTo, alarmDistance, contactDistance, frictionCoef=0.0): if applyTo.hasObject("FreeMotionAnimationLoop") is False: applyTo.addObject('FreeMotionAnimationLoop') - if applyTo.hasObject("GenericConstraintSolver") is False: - applyTo.addObject('GenericConstraintSolver', tolerance=1e-6, maxIterations=1000) + if applyTo.hasObject("ProjectedGaussSeidelConstraintSolver") is False: + applyTo.addObject('ProjectedGaussSeidelConstraintSolver', tolerance=1e-6, maxIterations=1000) return applyTo diff --git a/python3/src/stlib3/scene/mainheader.py b/python3/src/stlib3/scene/mainheader.py index 6b91dc4..d638a31 100644 --- a/python3/src/stlib3/scene/mainheader.py +++ b/python3/src/stlib3/scene/mainheader.py @@ -25,7 +25,7 @@ def MainHeader(node, gravity=[0.0, -9.8, 0.0], dt=0.01, plugins=[], repositoryPa RequiredPlugin, OglSceneFrame, FreeMotionAnimationLoop, - GenericConstraintSolver, + ProjectedGaussSeidelConstraintSolver, DiscreteIntersection }