ROI defined by a complex mesh #3028
-
Hi, Is there any way to define ROI not by a box/plane/sphereROI but by using a more complex mesh? Zahra |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Hi @zbounik ! |
Beta Was this translation helpful? Give feedback.
-
Hi @zbounik, I think you can use the MeshROI component. EDIT: @hugtalbot was faster than me ;) |
Beta Was this translation helpful? Give feedback.
-
Hi again, I am trying to use MeshROI as you suggest but I don't get what I want. i am not sure if I am doing anything wrong? (I want to get the part of the white mesh that is inside the yellow one as the region of interest): <Node name="root" gravity="0 -9.81 0" dt="0.02">
<RequiredPlugin name="SofaOpenglVisual"/>
<VisualStyle displayFlags="showForceFields" />
<DefaultPipeline name="CollisionPipeline" verbose="0" />
<BruteForceBroadPhase/>
<BVHNarrowPhase/>
<DefaultContactManager name="collision response" response="PenalityContactForceField" />
<DiscreteIntersection />
<Node name="LiverFEM" gravity="0 -9.81 0">
<!--<EulerImplicitSolver name="cg_odesolver" printLog="0" rayleighStiffness="0.1" rayleighMass="0.1" />-->
<CGLinearSolver name="linear solver" iterations="25" tolerance="1e-09" threshold="1e-09" />
<MeshOBJLoader name="meshLoader0" filename="mesh/liver.obj" />
<TriangleSetTopologyContainer name="mesh" src="@meshLoader0" />
<!--<MeshTopology name="mesh" src="@meshLoader0" />-->
<MechanicalObject template="Vec3d" name="mecaObj"/>
<!--<TetrahedronFEMForceField template="Vec3d" name="FEM" youngModulus="50" poissonRatio="0.45" />-->
<UniformMass name="mass" totalMass="1" />
<OglModel name="VisualModel" color="1.0 1.0 1.0 0.5" />
<BarycentricMapping name="visualmapping" input="@mecaObj" output="@VisualModel" />
</Node>
<Node name="MeshROI" >
<MeshOBJLoader name="ROIloader" filename="mesh/liver.obj" translation="3 0 0"/>
<MechanicalObject template="Vec3d" name="mecaObj2"/>
<TriangleSetTopologyContainer name="mesh2" src="@ROIloader" />
<OglModel name="VisualModel2" color="1.0 1.0 0.2 0.5"/>
<MeshROI name="ROIm" drawMesh="1" drawBox="1" drawEdges="0" drawTriangles="1" drawTetrahedra="1" drawOut="1" computeMeshROI="1" doUpdate="0"
position="@../LiverFEM/mecaObj.position" triangles="@../LiverFEM/mecaObj.triangles" ROIposition="@ROIloader.position" ROItriangles="@ROIloader.triangles" />
<FixedConstraint indices="ROIm.indices" />
</Node>
</Node> |
Beta Was this translation helpful? Give feedback.
-
Hi @zbounik This works fine for me using these surface meshes: my scene: <Node name="root" gravity="0 -9.81 0" dt="0.02">
<RequiredPlugin name="SofaOpenglVisual"/>
<VisualStyle displayFlags="showForceFields" />
<DefaultPipeline name="CollisionPipeline" verbose="0" />
<BruteForceBroadPhase/>
<BVHNarrowPhase/>
<DefaultContactManager name="collision response" response="PenalityContactForceField" />
<DiscreteIntersection />
<Node name="LiverFEM" gravity="0 -9.81 0">
<!--<EulerImplicitSolver name="cg_odesolver" printLog="0" rayleighStiffness="0.1" rayleighMass="0.1" />-->
<CGLinearSolver name="linear solver" iterations="25" tolerance="1e-09" threshold="1e-09" />
<MeshOBJLoader name="meshLoader0" filename="mesh/liver.obj" />
<TriangleSetTopologyContainer name="mesh" src="@meshLoader0" />
<!--<MeshTopology name="mesh" src="@meshLoader0" />-->
<MechanicalObject template="Vec3d" name="mecaObj"/>
<!--<TetrahedronFEMForceField template="Vec3d" name="FEM" youngModulus="50" poissonRatio="0.45" />-->
<UniformMass name="mass" totalMass="1" />
<OglModel name="VisualModel" color="1.0 1.0 1.0 0.5" />
<BarycentricMapping name="visualmapping" input="@mecaObj" output="@VisualModel" />
</Node>
<Node name="MeshROI" >
<MeshOBJLoader name="ROIloader" filename="mesh/liver.obj" translation="3 0 0"/>
<MechanicalObject template="Vec3d" name="mecaObj2"/>
<TriangleSetTopologyContainer name="mesh2" src="@ROIloader" />
<OglModel name="VisualModel2" color="1.0 1.0 0.2 0.5"/>
<MeshROI name="ROIm" drawMesh="0" drawBox="1" drawEdges="0" drawTriangles="1" drawTetrahedra="0" drawOut="0" computeMeshROI="1" doUpdate="0" drawSize="0.8"
position="@../LiverFEM/mecaObj.position" triangles="@../LiverFEM/mecaObj.triangles" ROIposition="@ROIloader.position" ROItriangles="@ROIloader.triangles" />
<FixedConstraint indices="ROIm.indices" />
</Node>
</Node>
``` |
Beta Was this translation helpful? Give feedback.
Hi @zbounik !
You can find an example of a MeshROI here.
Else I recently made a tutorial about this online: https://www.youtube.com/watch?v=52JSucavJhI&list=PLL2-UDGHPj0iLCieVkrv3OvAme0jsWl91