Home › Forum › SOFA › Using SOFA › How to apply Displacement on object
Tagged: SOFA_2106, Windows_10
- This topic has 9 replies, 2 voices, and was last updated 2 years, 9 months ago by bani.
-
AuthorPosts
-
19 November 2021 at 18:02 #20830baniBlocked
Is there a way to apply displacement on an object (like force can be applied on an object)
Thanks
Vani9 December 2021 at 15:53 #21100HugoKeymasterHey @vanisri
You can use a TranformEngine.
You can find an example scene in: examples/Components/engine/TransformEngine.scnBest wishes,
Hugo
20 December 2021 at 17:40 #21186baniBlockedThank you, what does [-1] refer to in the example?
10 January 2022 at 17:05 #21345HugoKeymasterHey @vanisri
Good point, it’s an old notation still working though.
[-1] means the previous component (above in the graph).In the above example of the TransformeEngine.scn,
input_position="@[-1].position"
in the TransformEngine means that it gets the position data field from the SparseGridTopology which is defined just before in the node.I hope this clarifies the example scene.
Best wishes,Hugo
21 January 2022 at 16:58 #21418baniBlockedI used Transform Engine similar to the example but it has not been working for me, could you please explain it a little more,
22 January 2022 at 08:36 #21419HugoKeymaster22 January 2022 at 17:50 #2142024 January 2022 at 09:51 #21421HugoKeymasterHey @vanisri
Could you please test changing the lines using the TransformEngine:
# WALL: childw=node.addChild('child wall') childw.addObject('MeshGmshLoader', name='wall', filename='E:\Softwares\GmSH\gmsh-4.8.4-Windows64\gmsh-4.8.4-Windows64\wallbig') childw.addObject('MeshTopology', name='topology-w', src='@wall') childw.addObject('TransformEngine', name='transfengine', template="Vec3d", translation=[-2, 0, 0], input_position='@topology-w.position') childw.addObject('MechanicalObject', name='mechobj-w', position="@transfengine.output_position", template='Vec3d', showObject='1') childw.addObject('UniformMass', totalMass='1') childw.addObject('TriangleFEMForceField', youngModulus='10000000') childw.addObject('TriangleCollisionModel') childw.addObject('LineCollisionModel') childw.addObject('PointCollisionModel')
Two remarks:
– always put the collision models in subnodes for each object and use a mapping to connect the physics to the collision model
– we usually apply forces or enforce the position of few points of a deformable object. Why would you like to apply rigid motion to your deformable body?Best wishes,
Hugo
—
NOTE: we are now moving the forum to GitHub Discussions. Do not hesitate to start using it already!
More information on the migration process can be found online.24 January 2022 at 17:14 #21430baniBlockedThank you @Hugo, I may have misunderstood the functionality of transform engine, I want to apply a series of displacements one after another, I have tried by applying velocity on the mechanical object, but instead of the complete object moving, just one edge of the wall moves, could you tell me how to correct that
24 January 2022 at 18:01 #21433baniBlockedOr if there is some other method to apply a series of displacements to the wall so that it collides with the cube object accordingly, kindly let me know.
-
AuthorPosts
- You must be logged in to reply to this topic.