Home › Forum › SOFA › Using SOFA › Help with Rigidification
Tagged: SOFA_2012, Windows_10
- This topic has 2 replies, 2 voices, and was last updated 2 years, 11 months ago by
Hugo.
-
AuthorPosts
-
5 July 2021 at 22:43 #19936
SergioPM23
BlockedHello everyone!
I am trying to run the Rigidify function example that @damien-marchaluniv-lille1-fr posted in this other topic: https://www.sofa-framework.org/community/forum/topic/rigidmapping-from-rigid3d-to-only-some-particles-of-fembody/
The example is the following one:def createScene(rootNode): """ """ from stlib.scene import MainHeader from stlib.physics.deformable import ElasticMaterialObject from stlib.physics.mixedmaterial import Rigidify from splib.objectmodel import setData MainHeader(rootNode, plugins=["SofaSparseSolver"]) rootNode.VisualStyle.displayFlags = "showBehavior" modelNode = rootNode.createChild("Modeling") elasticobject = ElasticMaterialObject(modelNode, "mesh/liver.msh", "ElasticMaterialObject") # Rigidification of the elasticobject for given indices with given frameOrientations. o = Rigidify(modelNode, elasticobject, name="RigidifiedStructure", frames=[[0., 0., 0], [0., 0., 0]], groupIndices=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [48, 49, 50, 51]]) # Activate some rendering on the rigidified object. setData(o.RigidParts.dofs, showObject=True, showObjectScale=1, drawMode=2) setData(o.RigidParts.RigidifiedParticules.dofs, showObject=True, showObjectScale=0.1, drawMode=1, showColor=[1., 1., 0., 1.]) setData(o.DeformableParts.dofs, showObject=True, showObjectScale=0.1, drawMode=2) o.RigidParts.createObject("FixedConstraint", indices=0) simulationNode = rootNode.createChild("Simulation") simulationNode.createObject("EulerImplicitSolver") simulationNode.createObject("CGLinearSolver") simulationNode.addChild(o) return rootNode
The problem is that when I try to run this example from Sofa, the next error appear in the terminal:
ModuleNotFoundError: No module named 'stlib' At: example.py(4): createScene
I do not know why I get this error, I have the STLIB plugin installed (because I have the v20.12.03 binaries version of Sofa, and STLIB is supposed to be included in the binaries).
I would appreciate any help. Thanks in advance.Cheers,
Sergio.12 July 2021 at 23:40 #20012SergioPM23
BlockedAny advice?
30 September 2021 at 22:48 #20461Hugo
KeymasterHey @sergiopm23
Have you the STLIB plugin well loaded in the PluginManager? (and the SofaPython plugin?)
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.