SEARCH
TOOLBOX
LANGUAGES
PlaneROI

PlaneROI

From SOFAWiki

Jump to: navigation, search

Contents

Description

This engine finds the points which are inside a given box computed from a plane defined by three points and a depth distance.

Note: PlaneROI engine new design is a merge between old design of PlaneROI concerning only vertices and TrianglesInPlaneROI. engine which was handling only triangles.
Topological primitives handle are now:

- dofs/vertices
- edges
- triangles
- tetrahedra

builds a box using a plane defined by three points (p0, p1, P2) and a depth distance (d) as showed below :

          _ _ _ _ _ _ _ _ _ _
         /|                   /|
        / |                  / |
       /  | _ _ _ _ _ _ _ _ /_ |           
      /_ _/ __ _ _ _ _ _ _ /p2/         /
     /|  /                /  /         /
    / | /                /| /         /  
   /_ |/_ __ _ _ _ _ _ _/_|/         / d
  |  p0                 | /p1       /         
  | /                   |/         /
  |/_ _ _ __ _ _ _ _ _ _/         /

Input Data's

  • planes
Plane defined by 3 points and a depth distance (as shown above).
  • position/rest_position
Rest position coordinates of the degrees of freedom


Input topology (those input are not necessary for the :

  • edges
Edge Topology array.
  • triangles
Triangle Topology array.
  • tetrahedra
Tetrahedron Topology array.

Input parameters

Concerning topology Note that those parameters are set to true by default. So it means that as default behaviour, all topological component array will be parse. Set some parameters to false if you just need a part of the information and want to speed-up your simulation.

  • computeEdges
If true, will compute edge list and index list inside the ROI.
  • computeTriangles
If true, will compute triangle list and index list inside the ROI.
  • computeTetrahedra
If true, will compute tetrahedra list and index list inside the ROI.


For display:

  • drawBoxes
If true, Draw Box(es).
  • drawPoints
If true, Draw Points.
  • drawEdges
If true, Draw Edges.
  • drawTriangle
If true, Draw Triangles.
  • drawTetrahedra
If true, Draw Tetrahedra.
  • drawSize
rendering size for box and elements.

Output Data's

  • indices
Indices of the points contained in the ROI.
  • edgeIndices
Indices of the edges contained in the ROI.
  • triangleIndices
Indices of the triangles contained in the ROI.
  • tetrahedronIndices
Indices of the tetrahedra contained in the ROI.
  • pointsInROI
Points contained in the ROI.
  • edgesInROI
Edges contained in the ROI.
  • trianglesInROI
Triangles contained in the ROI.
  • tetrahedraInROI
Tetrahedra contained in the ROI.

Examples

Examples using this engine can be found in :

Sofa/examples/Components/engine/SphereROI.scn

or

examples/Components/Constraint/PlaneConstraint.scn


Thus one use can be to define a PlaneConstraint:

<Object type="PlaneConstraint" plane="-4 3 0 1 2 1 0 0 1 2" />

where:

p0 = -4 3 0
p1 = 1 2 1
p2 = 0 0 1
d = 2

IMPORTANT: PlaneConstraint is not a component, it is an object described in : examples/Components/PlaneConstraint.xml
where the engine is used as follow:

<Node name="Group">
	<Object type="PlaneROI" name="box_roi" plane="-4 3 0 1 2 1 0 0 1 2" drawSize="0"/>
	<Object type="FixedConstraint" indices="@[-1].indices" drawSize="0"/>
</Node>


Other use can be to find the topology:
where the engine is used as follow:

<Node name="Group">
    <MechanicalObject template="Vec3d" name="mecaObj"  scale3d="10 10 10"  restScale="1" />
    <TriangleSetTopologyContainer name="Container" />
    <PlaneROI plane="0 0 0.5 0 0.3 1 0 0 1.5 0.2" drawSphere="1"
                           position="@../Volume.position" drawTriangles="1" drawTetrahedra="1"
                           triangles="@Container.triangles" tetrahedra="@../Container.tetrahedra" name="boxROI"/>
 
</Node>







Examples using this engine can be found in :