SEARCH
TOOLBOX
LANGUAGES
BoxROI

BoxROI

From SOFAWiki

Jump to: navigation, search

Contents

Description

This engine finds the topological primitives which are inside a given box.

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

- dofs/vertices
- edges
- triangles
- tetrahedra


Input Data's

  • box
Box defined by two points (xmin,ymin,zmin, xmax,ymax,zmax).
  • 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/BoxROI.scn

or

examples/Components/Constraint/BoxConstraint.scn
examples/Components/Forcefield/BoxContactForcefield.scn

Thus one use can be to define a BoxConstraint:

<Object type="BoxConstraint" box="-5 0 -1 -2 1 2" />

IMPORTANT: BoxConstraint is not a component, it is an object described in : examples/Components/BoxConstraint.xml

where the engine is used as follow:

<Node name="Group">
	<Object type="BoxROI" name="box_roi" box="0 0 0 1 1 1" drawSize="0"/>
	<Object type="FixedConstraint" indices="@[-1].indices" drawSize="0"/>
</Node>


Other use can be to find the topology:

    <MechanicalObject template="Vec3d" name="mecaObj"  scale3d="10 10 10"  restScale="1" />
    <TriangleSetTopologyContainer name="Container" />
 
    <BoxROI template="Vec3d" box="3 3 0 6 6 1" drawBoxes="1"
                position="@mecaObj.position" drawTriangles="1"
                triangles="@Container.triangles" name="boxROI"/>