From 7b9b4929fed4d2ecd49d36eb20b126b83f7e57ba Mon Sep 17 00:00:00 2001 From: Paul Baksic Date: Tue, 10 Dec 2024 15:33:29 +0100 Subject: [PATCH 1/2] Change data names --- python3/src/stlib3/physics/constraints/fixedbox.py | 2 +- python3/src/stlib3/physics/constraints/fixedbox_prefab.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python3/src/stlib3/physics/constraints/fixedbox.py b/python3/src/stlib3/physics/constraints/fixedbox.py index 0a43319..421663e 100644 --- a/python3/src/stlib3/physics/constraints/fixedbox.py +++ b/python3/src/stlib3/physics/constraints/fixedbox.py @@ -35,7 +35,7 @@ def FixedBox(applyTo=None, atPositions=[-1.0, -1.0, -1.0, 1.0, 1.0, 1.0], else: c.addObject('BoxROI', position=position, name='BoxROI', box=atPositions, drawBoxes=doVisualization, doUpdate=doRecomputeDuringSimulation) - c.addObject('RestShapeSpringsForceField', points='@BoxROI.indices', stiffness=1e12) + c.addObject('RestShapeSpringsForceField', indices='@BoxROI.indices', stiffness=1e12) return c def createScene(rootNode): diff --git a/python3/src/stlib3/physics/constraints/fixedbox_prefab.py b/python3/src/stlib3/physics/constraints/fixedbox_prefab.py index a8b537f..d34ecbd 100644 --- a/python3/src/stlib3/physics/constraints/fixedbox_prefab.py +++ b/python3/src/stlib3/physics/constraints/fixedbox_prefab.py @@ -41,7 +41,7 @@ def __init__(self, *args, **kwargs): def init(self): self.addObject('BoxROI', name='BoxROI', box=self.boxCoords, drawBoxes=self.showBox) - self.addObject('RestShapeSpringsForceField', points='@BoxROI.indices', stiffness=1e12) + self.addObject('RestShapeSpringsForceField', indices='@BoxROI.indices', stiffness=1e12) def createScene(rootnode): From ed1fa05ea2b3e41b6db16702407f74fa28202ef0 Mon Sep 17 00:00:00 2001 From: Paul Baksic Date: Tue, 4 Mar 2025 17:26:29 +0100 Subject: [PATCH 2/2] Use FixedweakConstraint instead when possible --- python3/src/stlib3/physics/constraints/fixedbox.py | 2 +- python3/src/stlib3/physics/constraints/fixedbox_prefab.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python3/src/stlib3/physics/constraints/fixedbox.py b/python3/src/stlib3/physics/constraints/fixedbox.py index 421663e..9cc9f28 100644 --- a/python3/src/stlib3/physics/constraints/fixedbox.py +++ b/python3/src/stlib3/physics/constraints/fixedbox.py @@ -35,7 +35,7 @@ def FixedBox(applyTo=None, atPositions=[-1.0, -1.0, -1.0, 1.0, 1.0, 1.0], else: c.addObject('BoxROI', position=position, name='BoxROI', box=atPositions, drawBoxes=doVisualization, doUpdate=doRecomputeDuringSimulation) - c.addObject('RestShapeSpringsForceField', indices='@BoxROI.indices', stiffness=1e12) + c.addObject('FixedWeakConstraint', indices='@BoxROI.indices', stiffness=1e12) return c def createScene(rootNode): diff --git a/python3/src/stlib3/physics/constraints/fixedbox_prefab.py b/python3/src/stlib3/physics/constraints/fixedbox_prefab.py index d34ecbd..84c7acc 100644 --- a/python3/src/stlib3/physics/constraints/fixedbox_prefab.py +++ b/python3/src/stlib3/physics/constraints/fixedbox_prefab.py @@ -41,7 +41,7 @@ def __init__(self, *args, **kwargs): def init(self): self.addObject('BoxROI', name='BoxROI', box=self.boxCoords, drawBoxes=self.showBox) - self.addObject('RestShapeSpringsForceField', indices='@BoxROI.indices', stiffness=1e12) + self.addObject('FixedWeakConstraint', indices='@BoxROI.indices', stiffness=1e12) def createScene(rootnode):