Home › Forum › SOFA › Using SOFA › [SOLVED] LMConstraints with Flexible simulation
Tagged: 64_bits, Flexible, Linux_ubuntu, LMConstraint, SOFA_1608
- This topic has 3 replies, 2 voices, and was last updated 7 years, 9 months ago by Hugo.
-
AuthorPosts
-
10 February 2017 at 17:04 #8563jjcasmarBlocked
Hi,
I’m doing some experiments involving constraints. I have created a scene which contains a fixed torus simulated with the Flexible plugin components. The fixed constraint is added with a FixedLMConstraint in the master DOF level.
<?xml version="1.0"?> <Node name="Root" gravity="0 -0.5 0" dt="0.3" > <RequiredPlugin name="requiredPlugin1" printLog="1" pluginName="Flexible" /> <VisualStyle name="visualStyle1" displayFlags="showBehaviorModels showForceFields" /> <DefaultAnimationLoop name="defaultAnimationLoop1" /> <DefaultVisualManagerLoop name="defaultVisualManagerLoop1" /> <LMConstraintSolver name="lMConstraintSolver0" listening="1" /> <CGLinearSolver template="GraphScattered" name="cGLinearSolver2" /> <EulerImplicitSolver name="eulerImplicitSolver2" /> <Node name="Flexible" > <MeshGmshLoader name="loader" filename="mesh/torus_low_res.msh" edgesGroups=" -1 0 200" trianglesGroups=" -1 0 408" tetrahedraGroups=" -1 0 862" /> <MeshTopology name="mesh" position="@loader.position" edges="@loader.edges" triangles="@loader.triangles" quads="@loader.quads" tetrahedra="@loader.tetras" hexahedra="@loader.hexas" /> <MechanicalObject template="Vec3d" name="parent" position="0 0 0" velocity="0 0 0" force="0 0 0" externalForce="0 0 0" restScale="1" showObject="0" showObjectScale="0.05" /> <BoxROI template="Vec3d" name="FixedROI" box="0 -2 0 5 2 5" position="@mesh.position" indices="0" /> <BarycentricShapeFunction template="ShapeFunctiond" name="barycentricShapeFunction1" /> <FixedLMConstraint template="Vec3d" name="fixedLMConstraint1" indices="@FixedROI.indices" /> <Node name="behavior" > <TopologyGaussPointSampler name="sampler" method="0 - Gauss-Legendre" order="1" showSamplesScale="0" inPosition="@../mesh.position" /> <MechanicalObject template="F331" name="F" position=" 0 0 0 0 0 0 0 0 0" velocity=" 0 0 0 0 0 0 0 0 0" force=" 0 0 0 0 0 0 0 0 0" externalForce=" 0 0 0 0 0 0 0 0 0" restScale="1" showObject="0" showObjectScale="0.05" /> <LinearMapping template="Vec3d,F331" name="linearMap1" showDeformationGradientStyle="0 - All axis" showColorOnTopology="0 - None" input="@../" output="@./" /> <Node name="Strain" > <MechanicalObject template="E331" name="E" position="0 0 0 0 0 0" velocity="0 0 0 0 0 0" force="0 0 0 0 0 0" externalForce="0 0 0 0 0 0" restScale="1" /> <CorotationalStrainMapping template="F331,E331" name="corotationalStrainMap1" method="svd" input="@../" output="@./" /> <HookeForceField template="E331" name="ff" youngModulus="2000" poissonRatio="0.2" viscosity="0" /> </Node> </Node> <Node name="mass" > <MechanicalObject template="Vec3d" name="mObject1" position="@../mesh.position" velocity="0 0 0" force="0 0 0" externalForce="0 0 0" restScale="1" /> <UniformMass template="Vec3d" name="uniformMass2" totalmass="250" /> <LinearMapping template="Vec3d,Vec3d" name="linearMap2" showDeformationGradientStyle="0 - All axis" showColorOnTopology="0 - None" input="@../" output="@./" /> </Node> <Node name="collision" > <MeshObjLoader name="loader" filename="mesh/torus.obj" /> <MeshTopology name="meshTopology1" position="@loader.position" edges="@loader.edges" triangles="@loader.triangles" quads="@loader.quads" tetrahedra="@loader.tetras" hexahedra="@loader.hexas" /> <MechanicalObject template="Vec3d" name="mObject2" position="0 0 0" velocity="0 0 0" force="0 0 0" externalForce="0 0 0" restScale="1" /> <TTriangleModel template="Vec3d" name="tTriangleModel1" /> <LinearMapping template="Vec3d,Vec3d" name="linearMap3" showDeformationGradientStyle="0 - All axis" showColorOnTopology="0 - None" input="@../" output="@./" /> </Node> <Node name="visual" > <MeshObjLoader name="loader" filename="mesh/torus.obj" /> <MeshTopology name="meshTopology1" position="@loader.position" edges="@loader.edges" triangles="@loader.triangles" quads="@loader.quads" tetrahedra="@loader.tetras" hexahedra="@loader.hexas" /> <MechanicalObject template="Vec3d" name="mObject2" position="0 0 0" velocity="0 0 0" force="0 0 0" externalForce="0 0 0" restScale="1" /> <LinearMapping template="Vec3d,Vec3d" name="linearMap3" showDeformationGradientStyle="0 - All axis" showColorOnTopology="0 - None" input="@../" output="@./" /> <Node name="model" > <OglModel template="ExtVec3f" name="oglModel0" primitiveType="DEFAULT" blendEquation="GL_FUNC_ADD" sfactor="GL_SRC_ALPHA" dfactor="GL_ONE_MINUS_SRC_ALPHA" /> <BarycentricMapping template="Vec3d,ExtVec3f" name="barycentricMap1" input="@../" output="@./" /> </Node> </Node> </Node> <Node name="RigidFloor" > </Node> </Node>
The problem is that the constraint are not being satisfied. When I simulate this scene, the torus falls due to gravity and the constraint are violated. Any idea?
20 February 2017 at 14:28 #8637HugoKeymasterHi Juan,
This sounds redundant with the end of your thread about Floor as projective constraint. Just to get how both discussions are linked to each other.
Cheers,
Hugo
20 February 2017 at 17:52 #8641jjcasmarBlockedHi Hugo,
in fact it have some relationship as I’m simply trying to understand how constraints work.
The main issue I’m facing in this example is that the LMConstraints are not being applied, but the solver is added in the scene :-s
Thanks!
16 March 2017 at 17:26 #8786HugoKeymasterHi Juan,
As you noticed, the collision and constraints in SOFA are not well documented.
Any progress on your LMConstraints ?Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.