Home › Forum › SOFA › Using SOFA › How to connect two rigid parts while one would separate from the other halfway?
- This topic has 1 reply, 2 voices, and was last updated 6 years, 1 month ago by Hugo.
-
AuthorPosts
-
29 August 2018 at 03:39 #11750WongBlocked
I need to model an object containing two connected rigid parts, A and B. A is usually used to collide with other bodies while B’s position is controlled by a controller designed by myself. When B is moving controlled by the controller, A would be following the B. And if I trigger an event from the controller, A would separate from B and be a freely falling body.
I tried to use “BilateralInteractionConstraint” component, but relative movement between A and B would happen when A is colliding with a rigid body. And the force feedback component could not compute the contact force at the same time.
I have thought some methods to solve this problem but I think they are cumbersome and clumsy. So I want to know if there’s any simple methods to model such an object.
21 September 2018 at 11:32 #11979HugoKeymasterHi Wong,
I used one single particle for your object.
Then I map a collision model (any mesh that you want) on this particle.
And I can still control the particle (here using a LinearMovementConstraint.Here is the scene:
<Node name="root" gravity="0 0 0" dt="0.01" > <CollisionPipeline verbose="0" draw="0" /> <BruteForceDetection name="N2" /> <MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" /> <CollisionResponse name="Response" response="default" /> <VisualStyle name="visualStyle1" displayFlags="showBehaviorModels showCollisionModels" /> <EulerImplicitSolver rayleighStiffness="0.01"/> <CGLinearSolver iterations="50" tolerance="1e-06" threshold="1e-06"/> <Node name="Sphere"> <EulerImplicitSolver rayleighStiffness="0"/> <CGLinearSolver iterations="200" tolerance="1e-06" threshold="1e-06"/> <MechanicalObject template="Rigid" name="myParticle" position="-2 10 0 0 0 0 1" showObject="1" showObjectScale="0.5" /> <UniformMass totalmass="1" /> <ConstantForceField force="0 -1 0 0 0 0" /> <!-- <Sphere name="Floor" listRadius="1" simulated="1" moving="1" contactStiffness="100" /> --> <Node name="object1_surf" activated="1" > <MeshObjLoader name="loader" filename="mesh/cube.obj" scale="10"/> <Mesh src="@loader" drawTriangles="0"/> <MechanicalObject name="MO_object1_surf" src="@loader" showObject="1"/> <Triangle /> <Line /> <Point /> <RigidMapping input="@.." output="@MO_object1_surf"/> </Node> <LinearMovementConstraint template="Rigid" keyTimes="0 1 5 10 12" movements="0 0 0 0 0 0 0 0 0 0 0 0 0 0 -20 0 0 0 0 0 -20 0 0 60.3 0 0 0 0 0 60.3" /> </Node> </Node>
Is this want you want to do?
Cheers,
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.