Home › Forum › SOFA › Using SOFA › How to attach a beam with a rigid body
Tagged: 64_bits, Linux_ubuntu, SOFA_1912
- This topic has 9 replies, 3 voices, and was last updated 4 years, 3 months ago by Hugo.
-
AuthorPosts
-
27 May 2020 at 16:07 #16405PengYuBlocked
Hi, everyone.
I’m working on a suturing simulation project. Then, I want to attach a flexible suture (beam) with a rigid needle by using BilateralInteractionConstraint. But the scene I created didn’t work.
The error log is
[ERROR] [MechanicalObject (mObject1)] Invalid vOp operation 1 (null (V_DERIV), 0(0), 0(0), 1)
28 May 2020 at 21:24 #16451BineshBlocked29 May 2020 at 05:06 #16454PengYuBlocked1 June 2020 at 15:08 #16501HugoKeymasterHi @rainvector
Your BilateralInteractionConstraint is overriden by the FixedConstraint which applies on the same DOFs. Remove it you’ll see the two parts of your object moving together.
Hugo
1 June 2020 at 20:07 #16507PengYuBlockedHi @Hugo. Thanks for your reply.
I’ve deleted all FixedConstraint. But the same error occurs.2 June 2020 at 08:58 #16508HugoKeymaster5 June 2020 at 08:31 #16532PengYuBlockedHi @Hugo, it’s wired that the secen doesn’t work for me.
And the console image is as below. It seems something about MechanicalObject is wrong.
After debugging, it shows that clearingx
in CGLinearSolver (line 163, CGLinearSolver.inl) goes wrong.
After removing the FixedConstraint, the content of my scene is
<?xml version="1.0"?> <Node name="root" dt="0.01" gravity="0 0 -9.81"> <RequiredPlugin name="SofaOpenglVisual"/> <VisualStyle displayFlags="showBehaviorModels showForceFields showCollisionModels" /> <DefaultPipeline depth="6" verbose="0" draw="0" /> <BruteForceDetection name="N2" /> <MinProximityIntersection name="Proximity" alarmDistance="0.03" contactDistance="0.02" /> <DefaultContactManager name="Response" response="default" /> <FreeMotionAnimationLoop /><!-- this is necessary in BilateralInteractionConstraint--> <LCPConstraintSolver tolerance="1e-3" maxIt="1000"/> <Node name="RigidNeedle"> <EulerImplicitSolver rayleighStiffness="0.01" rayleighMass="0.1" /> <CGLinearSolver iterations="25" threshold="0.00000001" /> <MechanicalObject template="Rigid3d" translation="0 0 0" rotation="0 0 0" scale3d="3 3 3"/> <UniformMass /> <LinearSolverConstraintCorrection /> <!-- this is necessary in BilateralInteractionConstraint--> <Node name="Collision"> <MeshObjLoader name="loader" filename="mesh/needle/suture_needle.obj"/> <MeshTopology src="@loader"/> <MechanicalObject src="@loader" scale3d="1 1 1"/> <TriangleCollisionModel contactStiffness="200"/> <LineCollisionModel contactStiffness="@[-1].contactStiffness"/> <PointCollisionModel contactStiffness="@[-1].contactStiffness" /> <RigidMapping/> </Node> <Node name="Visual" tags="Visual"> <OglModel name="Visual" src="@../Collision/loader" color="gray" scale3d="1 1 1" /> <RigidMapping input="@.." output="@Visual" /> </Node> <Node name="Constraints"> <MechanicalObject name="DOFs" template="Rigid3d" position="0 0 -0.1 0 0 0 0" /> <RigidRigidMapping index="0" /> </Node> </Node> <Node name="Suture"> <EulerImplicitSolver rayleighStiffness="0" printLog="false" rayleighMass="0.1" /> <BTDLinearSolver template="BTDMatrix6d" printLog="false" verbose="false" /> <MechanicalObject template="Rigid3d" name="DOFs" position="0 0 0 0 0 0 1 1 0 0 0 0 0 1 2 0 0 0 0 0 1 3 0 0 0 0 0 1 4 0 0 0 0 0 1 5 0 0 0 0 0 1 6 0 0 0 0 0 1 7 0 0 0 0 0 1" /> <MeshTopology name="lines" lines="0 1 1 2 2 3 3 4 4 5 5 6 6 7" /> <UniformMass vertexMass="1 1 0.01 0 0 0 0.1 0 0 0 0.1" printLog="false" /> <BeamFEMForceField name="FEM" radius="0.1" youngModulus="20000000" poissonRatio="0.49"/> <LinearSolverConstraintCorrection /><!-- this is necessary in BilateralInteractionConstraint--> <Node name="Collision"> <CylinderGridTopology name="coli" nx="6" ny="6" nz="7" length="7" radius=".3" axis="1 0 0" /> <MechanicalObject /> <BeamLinearMapping isMechanical="true" /> <TriangleCollisionModel /> </Node> <Node name="Visual"> <CylinderGridTopology name="vis" nx="6" ny="6" nz="7" length="7" radius=".3" axis="1 0 0" /> <OglModel color='gray'/> <BeamLinearMapping isMechanical="false" /> </Node> </Node> <BilateralInteractionConstraint template="Rigid3d" object1="@RigidNeedle/Constraints/DOFs" object2="@Suture/DOFs" first_point="0" second_point="0" /> </Node>
11 June 2020 at 16:24 #16593HugoKeymasterMy scene is:
<?xml version="1.0"?> <Node name="root" dt="0.01" gravity="0 0 -9.81"> <RequiredPlugin name="SofaOpenglVisual"/> <VisualStyle displayFlags="showBehaviorModels showForceFields showCollisionModels" /> <DefaultPipeline depth="6" verbose="0" draw="0" /> <BruteForceDetection name="N2" /> <MinProximityIntersection name="Proximity" alarmDistance="0.03" contactDistance="0.02" /> <DefaultContactManager name="Response" response="default" /> <FreeMotionAnimationLoop /><!-- this is necessary in BilateralInteractionConstraint--> <LCPConstraintSolver tolerance="1e-3" maxIt="1000"/> <Node name="RigidNeedle"> <EulerImplicitSolver rayleighStiffness="0.01" rayleighMass="0.1" /> <CGLinearSolver iterations="25" threshold="0.00000001" /> <MechanicalObject template="Rigid3d" translation="0 0 0" rotation="0 0 0" scale3d="3 3 3"/> <UniformMass /> <!-- <FixedConstraint name="FixedConstraint" indices="0" /> --> <LinearSolverConstraintCorrection /> <!-- this is necessary in BilateralInteractionConstraint--> <Node name="Collision"> <MeshObjLoader name="loader" filename="suture_needle.obj"/> <MeshTopology src="@loader"/> <MechanicalObject src="@loader" scale3d="1 1 1"/> <TriangleCollisionModel contactStiffness="200"/> <LineCollisionModel contactStiffness="@[-1].contactStiffness"/> <PointCollisionModel contactStiffness="@[-1].contactStiffness" /> <RigidMapping/> </Node> <Node name="Visual" tags="Visual"> <OglModel name="Visual" src="@../Collision/loader" color="gray" scale3d="1 1 1" /> <RigidMapping input="@.." output="@Visual" /> </Node> <Node name="Constraints"> <MechanicalObject name="DOFs" template="Rigid3d" position="0 0 -0.1 0 0 0 0" /> <RigidRigidMapping index="0" /> </Node> </Node> <Node name="Suture"> <EulerImplicitSolver rayleighStiffness="0" printLog="false" rayleighMass="0.1" /> <BTDLinearSolver template="BTDMatrix6d" printLog="false" verbose="false" /> <MechanicalObject template="Rigid3d" name="DOFs" position="0 0 0 0 0 0 1 1 0 0 0 0 0 1 2 0 0 0 0 0 1 3 0 0 0 0 0 1 4 0 0 0 0 0 1 5 0 0 0 0 0 1 6 0 0 0 0 0 1 7 0 0 0 0 0 1" /> <MeshTopology name="lines" lines="0 1 1 2 2 3 3 4 4 5 5 6 6 7" /> <!--FixedConstraint name="FixedConstraint" indices="0" /--> <UniformMass vertexMass="1 1 0.01 0 0 0 0.1 0 0 0 0.1" printLog="false" /> <BeamFEMForceField name="FEM" radius="0.1" youngModulus="20000000" poissonRatio="0.49"/> <LinearSolverConstraintCorrection /><!-- this is necessary in BilateralInteractionConstraint--> <Node name="Collision"> <CylinderGridTopology name="coli" nx="6" ny="6" nz="7" length="7" radius=".3" axis="1 0 0" /> <MechanicalObject /> <BeamLinearMapping isMechanical="true" /> <TriangleCollisionModel /> </Node> <Node name="Visual"> <CylinderGridTopology name="vis" nx="6" ny="6" nz="7" length="7" radius=".3" axis="1 0 0" /> <OglModel color='gray'/> <BeamLinearMapping isMechanical="false" /> </Node> </Node> <BilateralInteractionConstraint template="Rigid3d" object1="@RigidNeedle/Constraints/DOFs" object2="@Suture/DOFs" first_point="0" second_point="0" /> </Node>
Can you let me know if it works?
In my case I get an error, but the simulation runs:[ERROR] [MechanicalObject(mObject1)] Invalid vOp operation 1 (null(V_DERIV),0(0),0(0),1)
Hugo
12 June 2020 at 03:38 #16608PengYuBlockedHi @Hugo. Thanks for your reply.
Yes, the needle and suture can move.
However, the error keeps printing in the console which would slow down the simulation.
What’ more, I find that the BilaterialConstraints don’t work. The needle and suture can move independently as shown in the image below.Best wishes,
Peng Yu30 July 2020 at 15:14 #16993HugoKeymasterHi @rainvector
Any update?
I thought by the way, since this is supposed to be just one single object (right?), you could simply load it as one mesh (or merge the meshes) and run your simulation.Best wishes,
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.