Home › Forum › SOFA › Using SOFA › [SOLVED] making models move with each other and not separate
Tagged: 64_bits, SOFA_1806, Windows_10
- This topic has 5 replies, 3 voices, and was last updated 6 years, 1 month ago by
Anonymous.
-
AuthorPosts
-
3 January 2019 at 12:38 #12717
Anonymous
InactiveI have a scissor model that is mapped to a collision model. I want the scissors to stay intact, but the they collide with each other and fly away, I still want them to collide with other objects but not with each other.
<Node name="Left_Tip" > <EulerImplicitSolver name="ODE solver" rayleighStiffness="0.05" rayleighMass="1.0" /> <CGLinearSolver name="linear solver" iterations="25" tolerance="1e-10" threshold="10e-10" /> <MechanicalObject name="instrumentState" template="Rigid" /> <UniformMass name="mass" totalmass="0.05" /> <LCPForceFeedback activate="true" forceCoef="0.001"/> <UncoupledConstraintCorrection/> <Node name="VisualModel" > <OglModel name="InstrumentVisualModel" fileMesh="C:\Users\Fayad\Documents\sofa\scissor_very_low_left_tip.obj" color="blue" scale="0.05" /> <RigidMapping name="MM->VM mapping" input="@instrumentState" output="@InstrumentVisualModel" /> </Node> <Node name="CollisionModel" > <MeshObjLoader filename="C:\Users\Fayad\Documents\sofa\scissor_very_low_left_tip.obj" name="loader"/> <Mesh src="@loader" name="InstrumentCollisionModel" /> <MechanicalObject src="@loader" name="instrumentCollisionState" scale="0.05" /> <Line name="instrument" tags="CarvingTool" contactStiffness="2" /> <Point name="instrument" tags="CarvingTool" contactStiffness="2" /> <Triangle name="instrument" tags="CarvingTool" contactStiffness="2" /> <RigidMapping name="MM->CM mapping" input="@instrumentState" output="@instrumentCollisionState" /> </Node> </Node> <Node name="Right_Tip" > <EulerImplicitSolver name="ODE solver" rayleighStiffness="0.05" rayleighMass="1.0" /> <CGLinearSolver name="linear solver" iterations="25" tolerance="1e-10" threshold="10e-10" /> <MechanicalObject name="instrumentState" template="Rigid" /> <UniformMass name="mass" totalmass="0.05" /> <LCPForceFeedback activate="true" forceCoef="0.001"/> <UncoupledConstraintCorrection/> <Node name="VisualModel" > <OglModel name="InstrumentVisualModel" fileMesh="C:\Users\Fayad\Documents\sofa\scissor_very_low_right_tip.obj" color="blue" scale="0.05" /> <RigidMapping name="MM->VM mapping" input="@instrumentState" output="@InstrumentVisualModel" /> </Node> <Node name="CollisionModel" > <MeshObjLoader filename="C:\Users\Fayad\Documents\sofa\scissor_very_low_right_tip.obj" name="loader"/> <Mesh src="@loader" name="InstrumentCollisionModel" /> <MechanicalObject src="@loader" name="instrumentCollisionState" scale="0.05" /> <Line name="instrument" tags="CarvingTool" contactStiffness="2" /> <Point name="instrument" tags="CarvingTool" contactStiffness="2" /> <Triangle name="instrument" tags="CarvingTool" contactStiffness="2" /> <RigidMapping name="MM->CM mapping" input="@instrumentState" output="@instrumentCollisionState" /> </Node> </Node> <Node name="Connector" > <EulerImplicitSolver name="ODE solver" rayleighStiffness="0.05" rayleighMass="1.0" /> <CGLinearSolver name="linear solver" iterations="25" tolerance="1e-10" threshold="10e-10" /> <MechanicalObject name="instrumentState" template="Rigid" /> <UniformMass name="mass" totalmass="0.05" /> <LCPForceFeedback activate="true" forceCoef="0.001"/> <UncoupledConstraintCorrection/> <Node name="VisualModel" > <OglModel name="InstrumentVisualModel" fileMesh="C:\Users\Fayad\Documents\sofa\scissor_very_low_connector.obj" color="blue" scale="0.05" /> <RigidMapping name="MM->VM mapping" input="@instrumentState" output="@InstrumentVisualModel" /> </Node> <Node name="CollisionModel" > <MeshObjLoader filename="C:\Users\Fayad\Documents\sofa\scissor_very_low_connector.obj" name="loader"/> <Mesh src="@loader" name="InstrumentCollisionModel" /> <MechanicalObject src="@loader" name="instrumentCollisionState" scale="0.05" /> <Line name="instrument" tags="CarvingTool" contactStiffness="2" /> <Point name="instrument" tags="CarvingTool" contactStiffness="2" /> <Triangle name="instrument" tags="CarvingTool" contactStiffness="2" /> <RigidMapping name="MM->CM mapping" input="@instrumentState" output="@instrumentCollisionState" /> </Node> </Node> <Node name="Base" > <EulerImplicitSolver name="ODE solver" rayleighStiffness="0.05" rayleighMass="1.0" /> <CGLinearSolver name="linear solver" iterations="25" tolerance="1e-10" threshold="10e-10" /> <MechanicalObject name="instrumentState" template="Rigid" /> <UniformMass name="mass" totalmass="0.05" /> <LCPForceFeedback activate="true" forceCoef="0.001"/> <UncoupledConstraintCorrection/> <Node name="VisualModel" > <OglModel name="InstrumentVisualModel" fileMesh="C:\Users\Fayad\Documents\sofa\scissor_very_low_base.obj" color="blue" scale="0.05" /> <RigidMapping name="MM->VM mapping" input="@instrumentState" output="@InstrumentVisualModel" /> </Node> <Node name="CollisionModel" > <MeshObjLoader filename="C:\Users\Fayad\Documents\sofa\scissor_very_low_base.obj" name="loader"/> <Mesh src="@loader" name="InstrumentCollisionModel" /> <MechanicalObject src="@loader" name="instrumentCollisionState" scale="0.05" /> <Line name="instrument" tags="CarvingTool" contactStiffness="2" /> <Point name="instrument" tags="CarvingTool" contactStiffness="2" /> <Triangle name="instrument" tags="CarvingTool" contactStiffness="2" /> <RigidMapping name="MM->CM mapping" input="@instrumentState" output="@instrumentCollisionState" /> </Node> </Node>
3 January 2019 at 18:10 #12718Hugo
KeymasterDear @fayad !
Nice to see you active on the forum. And I saw that you already got some help from @secretdevil in other topics. Great to see and thank you Binesh.
Regarding your current topic, all you need is to create groups of contacts. In your scene, you can:
– add group=”1″ to all scissor parts
– add group=”2″ to any additional object you want to collide with
Thus, the collision between scissor parts won’t be computed. The group datafield has to be specified in all collision models (Point, Line, Triangle).Hope this helps.
BestHugo
3 January 2019 at 19:47 #12720Anonymous
InactiveYup that works. Thanks Hugo š
Best,
Fayad5 January 2019 at 05:53 #12723Anonymous
InactiveI also would like to know how to move all the individual parts together, so when I try moving them with my mouse or keyboard, I dont move only the part I am selecting, but all of them at the same time.
Best,
Fayad5 January 2019 at 09:47 #12725Binesh
BlockedDear @fayad
For move all part of instrument you must implement your code for your instrument,
For Example, Forceps Instrument can implement by three part and you must handle Left and Right and tube by Quaternion5 January 2019 at 10:06 #12726Anonymous
InactiveThanks @Binesh.
Best,
Fayad -
AuthorPosts
- You must be logged in to reply to this topic.