MeshTopology
Generic constant topology loaded from a mesh file.
MeshTopology manages geometric topology data in SOFA simulations, including points, edges, triangles, tetrahedra, and hexahedra, providing methods for initialization, manipulation, and visualization.
- module
- Sofa.Component.Topology.Container.Constant
- namespace
- sofa::component::topology::container::constant
- include
- sofa/component/topology/container/constant/MeshTopology.h
- inherits
-
- BaseMeshTopology
- description
The MeshTopology component in the SOFA (Simulation Open Framework Architecture) framework serves as a container for managing geometric topology data, representing various elements such as points, edges, triangles, tetrahedra, and hexahedra. This data structure is essential for defining the geometry of objects within simulations and supports different types of geometric primitives that are foundational building blocks in 3D space.
Points (Vertices)
A point or vertex is a basic element represented by coordinates $(x, y, z)$ in three-dimensional space:
egin{equation}
\mathbf{p_i} = (x_i, y_i, z_i), \quad i = 0, 1, ..., N_p
\end{equation}
where $N_p$ is the total number of points.
Edges
Edges connect pairs of vertices and can be represented by two vertex indices:
egin{equation}
\mathbf{e_j} = (v_{j_1}, v_{j_2}), \quad j = 0, 1, ..., N_e
\end{equation}
where $N_e$ is the total number of edges.
Triangles and Quads
Triangles are planar polygons with three vertices:
egin{equation}
\mathbf{T_k} = (v_{k_1}, v_{k_2}, v_{k_3}), \quad k = 0, 1, ..., N_t
\end{equation}
where $N_t$ is the total number of triangles.
Quads are planar polygons with four vertices:
egin{equation}
\mathbf{Q_l} = (v_{l_1}, v_{l_2}, v_{l_3}, v_{l_4}), \quad l = 0, 1, ..., N_q
\end{equation}
where $N_q$ is the total number of quads.
Tetrahedra and Hexahedra
Tetrahedra are three-dimensional polyhedra with four triangular faces:
egin{equation}
\mathbf{T_k} = (v_{k_1}, v_{k_2}, v_{k_3}, v_{k_4}), \quad k = 0, 1, ..., N_tet
\end{equation}
where $N_tet$ is the total number of tetrahedra.
Hexahedra are three-dimensional polyhedra with six quadrilateral faces:
egin{equation}
\mathbf{H_m} = (v_{m_1}, v_{m_2}, v_{m_3}, v_{m_4}, v_{m_5}, v_{m_6}, v_{m_7}, v_{m_8}), \quad m = 0, 1, ..., N_hex
\end{equation}
where $N_hex$ is the total number of hexahedra.
Topological Relationships
The MeshTopology component maintains topological relationships between elements. For instance:
- Edges in Tetrahedron: A tetrahedron has six edges connecting its vertices:
egin{equation}
\mathbf{T_k} \rightarrow \mathbf{E_{T}} = (e_1, e_2, e_3, e_4, e_5, e_6)
\end{equation}
- Triangles in Tetrahedron: A tetrahedron has four triangular faces:
egin{equation}
\mathbf{T_k} \rightarrow \mathbf{T_{T}} = (t_1, t_2, t_3, t_4)
\end{equation}
- Quads in Hexahedra: A hexahedron has six quadrilateral faces:
egin{equation}
\mathbf{H_m} \rightarrow \mathbf{Q_{H}} = (q_1, q_2, q_3, q_4, q_5, q_6)
\end{equation}
Connexity and Connected Components
The MeshTopology component also provides functionality to determine the connexity of a mesh. For instance:
- Connected Elements: The set of elements connected to an element $E_i$ can be computed recursively by traversing all adjacent vertices and edges.
egin{equation}
\mathbf{Conn}(E_i) = \bigcup_{v_j \in E_i} Adj(v_j)
\end{equation}
- Number of Connected Components: The number of connected components in a mesh can be determined by computing the connexity for each element and grouping them into disjoint sets.
Visualization
The component supports visualization by drawing edges, triangles, quads, tetrahedra, and hexahedra using graphical tools. It provides methods to draw lines, triangles, quads, and surfaces, which are essential for visualizing the mesh structure in simulations.
Data Fields
| Name | Type | Default | Help |
|---|---|---|---|
d_seqPoints |
SeqPoints | |
List of point positions |
d_seqUVs |
SeqUV | |
List of uv coordinates |
d_computeAllBuffers |
bool | |
Option to compute all crossed topology buffers at init. False by default |
d_drawEdges |
bool | |
if true, draw the topology Edges |
d_drawTriangles |
bool | |
if true, draw the topology Triangles |
d_drawQuads |
bool | |
if true, draw the topology Quads |
d_drawTetra |
bool | |
if true, draw the topology Tetrahedra |
d_drawHexa |
bool | |
if true, draw the topology hexahedra |
Methods
void
init
()
virtual
void
computeCrossElementBuffers
()
virtual
int
getNbPoints
()
void
setNbPoints
(int n)
const int &
getEdges
()
const int &
getTriangles
()
const int &
getQuads
()
const int &
getTetrahedra
()
const int &
getHexahedra
()
const int &
getPrisms
()
const int &
getPyramids
()
const SeqUV &
getUVs
()
virtual
int
getNbUVs
()
const UV
getUV
(UVID i)
virtual
void
addUV
(SReal u, SReal v)
const EdgesAroundVertex &
getEdgesAroundVertex
(PointID i)
virtual
const int &
getEdgesAroundVertexArray
()
const TrianglesAroundVertex &
getTrianglesAroundVertex
(PointID i)
virtual
const int &
getTrianglesAroundVertexArray
()
const EdgesInTriangle &
getEdgesInTriangle
(TriangleID i)
virtual
const int &
getEdgesInTriangleArray
()
const TrianglesAroundEdge &
getTrianglesAroundEdge
(EdgeID i)
virtual
const int &
getTrianglesAroundEdgeArray
()
const QuadsAroundVertex &
getQuadsAroundVertex
(PointID i)
virtual
const int &
getQuadsAroundVertexArray
()
const EdgesInQuad &
getEdgesInQuad
(QuadID i)
virtual
const int &
getEdgesInQuadArray
()
const QuadsAroundEdge &
getQuadsAroundEdge
(EdgeID i)
virtual
const int &
getQuadsAroundEdgeArray
()
const TetrahedraAroundVertex &
getTetrahedraAroundVertex
(PointID i)
virtual
const int &
getTetrahedraAroundVertexArray
()
const EdgesInTetrahedron &
getEdgesInTetrahedron
(TetraID i)
virtual
const int &
getEdgesInTetrahedronArray
()
const TetrahedraAroundEdge &
getTetrahedraAroundEdge
(EdgeID i)
virtual
const int &
getTetrahedraAroundEdgeArray
()
const TrianglesInTetrahedron &
getTrianglesInTetrahedron
(TetraID i)
virtual
const int &
getTrianglesInTetrahedronArray
()
const TetrahedraAroundTriangle &
getTetrahedraAroundTriangle
(TriangleID i)
virtual
const int &
getTetrahedraAroundTriangleArray
()
const HexahedraAroundVertex &
getHexahedraAroundVertex
(PointID i)
virtual
const int &
getHexahedraAroundVertexArray
()
const EdgesInHexahedron &
getEdgesInHexahedron
(HexaID i)
virtual
const int &
getEdgesInHexahedronArray
()
const HexahedraAroundEdge &
getHexahedraAroundEdge
(EdgeID i)
virtual
const int &
getHexahedraAroundEdgeArray
()
const QuadsInHexahedron &
getQuadsInHexahedron
(HexaID i)
virtual
const int &
getQuadsInHexahedronArray
()
const HexahedraAroundQuad &
getHexahedraAroundQuad
(QuadID i)
virtual
const int &
getHexahedraAroundQuadArray
()
bool
checkConnexity
()
virtual
int
getNumberOfConnectedComponent
()
const int
getConnectedElement
(Index elem)
const int
getElementAroundElement
(Index elem)
const int
getElementAroundElements
(int elems)
SReal
getPosX
(Index i)
SReal
getPosY
(Index i)
SReal
getPosZ
(Index i)
bool
hasPos
()
virtual
SReal
getPX
(Index i)
virtual
SReal
getPY
(Index i)
virtual
SReal
getPZ
(Index i)
virtual
void
clear
()
virtual
void
addPoint
(SReal px, SReal py, SReal pz)
virtual
void
addEdge
(Index a, Index b)
virtual
void
addTriangle
(Index a, Index b, Index c)
virtual
void
addQuad
(Index a, Index b, Index c, Index d)
virtual
void
addTetra
(Index a, Index b, Index c, Index d)
virtual
void
addHexa
(Index a, Index b, Index c, Index d, Index e, Index f, Index g, Index h)
virtual
int
getRevision
()
virtual
void
draw
(const core::visual::VisualParams * vparams)
virtual
bool
hasVolume
()
virtual
bool
hasSurface
()
virtual
bool
hasLines
()
virtual
bool
isVolume
()
virtual
bool
isSurface
()
virtual
bool
isLines
()
virtual
const EdgesAroundVertex &
getOrientedEdgesAroundVertex
(PointID i)
virtual
const TrianglesAroundVertex &
getOrientedTrianglesAroundVertex
(PointID i)
virtual
const QuadsAroundVertex &
getOrientedQuadsAroundVertex
(PointID i)
virtual
int
computeRelativeOrientationInTri
(const PointID ind_p0, const PointID ind_p1, const PointID ind_t)
int
computeRelativeOrientationInQuad
(const PointID ind_p0, const PointID ind_p1, const PointID ind_q)
void
reOrientateTriangle
(TriangleID id)
virtual
void
createEdgesAroundVertexArray
()
void
createEdgesInTriangleArray
()
void
createEdgesInQuadArray
()
void
createEdgesInTetrahedronArray
()
void
createEdgesInHexahedronArray
()
void
createTrianglesAroundVertexArray
()
void
createOrientedTrianglesAroundVertexArray
()
void
createTrianglesAroundEdgeArray
()
void
createTrianglesInTetrahedronArray
()
void
createQuadsAroundVertexArray
()
void
createOrientedQuadsAroundVertexArray
()
void
createQuadsAroundEdgeArray
()
void
createQuadsInHexahedronArray
()
void
createTetrahedraAroundVertexArray
()
void
createTetrahedraAroundEdgeArray
()
void
createTetrahedraAroundTriangleArray
()
void
createHexahedraAroundVertexArray
()
void
createHexahedraAroundEdgeArray
()
void
createHexahedraAroundQuadArray
()
EdgeID
getEdgeIndex
(PointID v1, PointID v2)
virtual
TriangleID
getTriangleIndex
(PointID v1, PointID v2, PointID v3)
virtual
QuadID
getQuadIndex
(PointID v1, PointID v2, PointID v3, PointID v4)
virtual
TetrahedronID
getTetrahedronIndex
(PointID v1, PointID v2, PointID v3, PointID v4)
virtual
HexahedronID
getHexahedronIndex
(PointID v1, PointID v2, PointID v3, PointID v4, PointID v5, PointID v6, PointID v7, PointID v8)
virtual
int
getVertexIndexInTriangle
(const Triangle & t, PointID vertexIndex)
virtual
int
getEdgeIndexInTriangle
(const EdgesInTriangle & t, EdgeID edgeIndex)
virtual
int
getVertexIndexInQuad
(const Quad & t, PointID vertexIndex)
virtual
int
getEdgeIndexInQuad
(const EdgesInQuad & t, EdgeID edgeIndex)
virtual
int
getVertexIndexInTetrahedron
(const Tetra & t, PointID vertexIndex)
virtual
int
getEdgeIndexInTetrahedron
(const EdgesInTetrahedron & t, EdgeID edgeIndex)
virtual
int
getTriangleIndexInTetrahedron
(const TrianglesInTetrahedron & t, TriangleID triangleIndex)
virtual
int
getVertexIndexInHexahedron
(const Hexa & t, PointID vertexIndex)
virtual
int
getEdgeIndexInHexahedron
(const EdgesInHexahedron & t, EdgeID edgeIndex)
virtual
int
getQuadIndexInHexahedron
(const QuadsInHexahedron & t, QuadID quadIndex)
virtual
Edge
getLocalEdgesInTetrahedron
(const HexahedronID i)
virtual
Edge
getLocalEdgesInHexahedron
(const HexahedronID i)
virtual
sofa::geometry::ElementType
getTopologyType
()
virtual
void
invalidate
()
void
updateTetrahedra
()
virtual
void
updateHexahedra
()
virtual
{
"name": "MeshTopology",
"namespace": "sofa::component::topology::container::constant",
"module": "Sofa.Component.Topology.Container.Constant",
"include": "sofa/component/topology/container/constant/MeshTopology.h",
"doc": "Generic constant topology loaded from a mesh file.",
"inherits": [
"BaseMeshTopology"
],
"templates": [],
"data_fields": [
{
"name": "d_seqPoints",
"type": "SeqPoints",
"xmlname": "position",
"help": "List of point positions"
},
{
"name": "d_seqUVs",
"type": "SeqUV",
"xmlname": "uv",
"help": "List of uv coordinates"
},
{
"name": "d_computeAllBuffers",
"type": "bool",
"xmlname": "computeAllBuffers",
"help": "Option to compute all crossed topology buffers at init. False by default"
},
{
"name": "d_drawEdges",
"type": "bool",
"xmlname": "drawEdges",
"help": "if true, draw the topology Edges"
},
{
"name": "d_drawTriangles",
"type": "bool",
"xmlname": "drawTriangles",
"help": "if true, draw the topology Triangles"
},
{
"name": "d_drawQuads",
"type": "bool",
"xmlname": "drawQuads",
"help": "if true, draw the topology Quads"
},
{
"name": "d_drawTetra",
"type": "bool",
"xmlname": "drawTetrahedra",
"help": "if true, draw the topology Tetrahedra"
},
{
"name": "d_drawHexa",
"type": "bool",
"xmlname": "drawHexahedra",
"help": "if true, draw the topology hexahedra"
}
],
"links": [],
"methods": [
{
"name": "init",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "computeCrossElementBuffers",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getNbPoints",
"return_type": "int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setNbPoints",
"return_type": "void",
"params": [
{
"name": "n",
"type": "int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getEdges",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTriangles",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getQuads",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTetrahedra",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getHexahedra",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getPrisms",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getPyramids",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getUVs",
"return_type": "const SeqUV &",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getNbUVs",
"return_type": "int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getUV",
"return_type": "const UV",
"params": [
{
"name": "i",
"type": "UVID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addUV",
"return_type": "void",
"params": [
{
"name": "u",
"type": "SReal"
},
{
"name": "v",
"type": "SReal"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getEdgesAroundVertex",
"return_type": "const EdgesAroundVertex &",
"params": [
{
"name": "i",
"type": "PointID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getEdgesAroundVertexArray",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTrianglesAroundVertex",
"return_type": "const TrianglesAroundVertex &",
"params": [
{
"name": "i",
"type": "PointID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTrianglesAroundVertexArray",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getEdgesInTriangle",
"return_type": "const EdgesInTriangle &",
"params": [
{
"name": "i",
"type": "TriangleID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getEdgesInTriangleArray",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTrianglesAroundEdge",
"return_type": "const TrianglesAroundEdge &",
"params": [
{
"name": "i",
"type": "EdgeID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTrianglesAroundEdgeArray",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getQuadsAroundVertex",
"return_type": "const QuadsAroundVertex &",
"params": [
{
"name": "i",
"type": "PointID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getQuadsAroundVertexArray",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getEdgesInQuad",
"return_type": "const EdgesInQuad &",
"params": [
{
"name": "i",
"type": "QuadID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getEdgesInQuadArray",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getQuadsAroundEdge",
"return_type": "const QuadsAroundEdge &",
"params": [
{
"name": "i",
"type": "EdgeID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getQuadsAroundEdgeArray",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTetrahedraAroundVertex",
"return_type": "const TetrahedraAroundVertex &",
"params": [
{
"name": "i",
"type": "PointID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTetrahedraAroundVertexArray",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getEdgesInTetrahedron",
"return_type": "const EdgesInTetrahedron &",
"params": [
{
"name": "i",
"type": "TetraID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getEdgesInTetrahedronArray",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTetrahedraAroundEdge",
"return_type": "const TetrahedraAroundEdge &",
"params": [
{
"name": "i",
"type": "EdgeID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTetrahedraAroundEdgeArray",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTrianglesInTetrahedron",
"return_type": "const TrianglesInTetrahedron &",
"params": [
{
"name": "i",
"type": "TetraID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTrianglesInTetrahedronArray",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTetrahedraAroundTriangle",
"return_type": "const TetrahedraAroundTriangle &",
"params": [
{
"name": "i",
"type": "TriangleID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTetrahedraAroundTriangleArray",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getHexahedraAroundVertex",
"return_type": "const HexahedraAroundVertex &",
"params": [
{
"name": "i",
"type": "PointID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getHexahedraAroundVertexArray",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getEdgesInHexahedron",
"return_type": "const EdgesInHexahedron &",
"params": [
{
"name": "i",
"type": "HexaID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getEdgesInHexahedronArray",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getHexahedraAroundEdge",
"return_type": "const HexahedraAroundEdge &",
"params": [
{
"name": "i",
"type": "EdgeID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getHexahedraAroundEdgeArray",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getQuadsInHexahedron",
"return_type": "const QuadsInHexahedron &",
"params": [
{
"name": "i",
"type": "HexaID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getQuadsInHexahedronArray",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getHexahedraAroundQuad",
"return_type": "const HexahedraAroundQuad &",
"params": [
{
"name": "i",
"type": "QuadID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getHexahedraAroundQuadArray",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "checkConnexity",
"return_type": "bool",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getNumberOfConnectedComponent",
"return_type": "int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getConnectedElement",
"return_type": "const int",
"params": [
{
"name": "elem",
"type": "Index"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getElementAroundElement",
"return_type": "const int",
"params": [
{
"name": "elem",
"type": "Index"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getElementAroundElements",
"return_type": "const int",
"params": [
{
"name": "elems",
"type": "int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getPosX",
"return_type": "SReal",
"params": [
{
"name": "i",
"type": "Index"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getPosY",
"return_type": "SReal",
"params": [
{
"name": "i",
"type": "Index"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getPosZ",
"return_type": "SReal",
"params": [
{
"name": "i",
"type": "Index"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "hasPos",
"return_type": "bool",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getPX",
"return_type": "SReal",
"params": [
{
"name": "i",
"type": "Index"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getPY",
"return_type": "SReal",
"params": [
{
"name": "i",
"type": "Index"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getPZ",
"return_type": "SReal",
"params": [
{
"name": "i",
"type": "Index"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "clear",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addPoint",
"return_type": "void",
"params": [
{
"name": "px",
"type": "SReal"
},
{
"name": "py",
"type": "SReal"
},
{
"name": "pz",
"type": "SReal"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addEdge",
"return_type": "void",
"params": [
{
"name": "a",
"type": "Index"
},
{
"name": "b",
"type": "Index"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addTriangle",
"return_type": "void",
"params": [
{
"name": "a",
"type": "Index"
},
{
"name": "b",
"type": "Index"
},
{
"name": "c",
"type": "Index"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addQuad",
"return_type": "void",
"params": [
{
"name": "a",
"type": "Index"
},
{
"name": "b",
"type": "Index"
},
{
"name": "c",
"type": "Index"
},
{
"name": "d",
"type": "Index"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addTetra",
"return_type": "void",
"params": [
{
"name": "a",
"type": "Index"
},
{
"name": "b",
"type": "Index"
},
{
"name": "c",
"type": "Index"
},
{
"name": "d",
"type": "Index"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addHexa",
"return_type": "void",
"params": [
{
"name": "a",
"type": "Index"
},
{
"name": "b",
"type": "Index"
},
{
"name": "c",
"type": "Index"
},
{
"name": "d",
"type": "Index"
},
{
"name": "e",
"type": "Index"
},
{
"name": "f",
"type": "Index"
},
{
"name": "g",
"type": "Index"
},
{
"name": "h",
"type": "Index"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getRevision",
"return_type": "int",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "draw",
"return_type": "void",
"params": [
{
"name": "vparams",
"type": "const core::visual::VisualParams *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "hasVolume",
"return_type": "bool",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "hasSurface",
"return_type": "bool",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "hasLines",
"return_type": "bool",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "isVolume",
"return_type": "bool",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "isSurface",
"return_type": "bool",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "isLines",
"return_type": "bool",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getOrientedEdgesAroundVertex",
"return_type": "const EdgesAroundVertex &",
"params": [
{
"name": "i",
"type": "PointID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getOrientedTrianglesAroundVertex",
"return_type": "const TrianglesAroundVertex &",
"params": [
{
"name": "i",
"type": "PointID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getOrientedQuadsAroundVertex",
"return_type": "const QuadsAroundVertex &",
"params": [
{
"name": "i",
"type": "PointID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "computeRelativeOrientationInTri",
"return_type": "int",
"params": [
{
"name": "ind_p0",
"type": "const PointID"
},
{
"name": "ind_p1",
"type": "const PointID"
},
{
"name": "ind_t",
"type": "const PointID"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "computeRelativeOrientationInQuad",
"return_type": "int",
"params": [
{
"name": "ind_p0",
"type": "const PointID"
},
{
"name": "ind_p1",
"type": "const PointID"
},
{
"name": "ind_q",
"type": "const PointID"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "reOrientateTriangle",
"return_type": "void",
"params": [
{
"name": "id",
"type": "TriangleID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "createEdgesAroundVertexArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createEdgesInTriangleArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createEdgesInQuadArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createEdgesInTetrahedronArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createEdgesInHexahedronArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createTrianglesAroundVertexArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createOrientedTrianglesAroundVertexArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createTrianglesAroundEdgeArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createTrianglesInTetrahedronArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createQuadsAroundVertexArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createOrientedQuadsAroundVertexArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createQuadsAroundEdgeArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createQuadsInHexahedronArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createTetrahedraAroundVertexArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createTetrahedraAroundEdgeArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createTetrahedraAroundTriangleArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createHexahedraAroundVertexArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createHexahedraAroundEdgeArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "createHexahedraAroundQuadArray",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "getEdgeIndex",
"return_type": "EdgeID",
"params": [
{
"name": "v1",
"type": "PointID"
},
{
"name": "v2",
"type": "PointID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTriangleIndex",
"return_type": "TriangleID",
"params": [
{
"name": "v1",
"type": "PointID"
},
{
"name": "v2",
"type": "PointID"
},
{
"name": "v3",
"type": "PointID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getQuadIndex",
"return_type": "QuadID",
"params": [
{
"name": "v1",
"type": "PointID"
},
{
"name": "v2",
"type": "PointID"
},
{
"name": "v3",
"type": "PointID"
},
{
"name": "v4",
"type": "PointID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTetrahedronIndex",
"return_type": "TetrahedronID",
"params": [
{
"name": "v1",
"type": "PointID"
},
{
"name": "v2",
"type": "PointID"
},
{
"name": "v3",
"type": "PointID"
},
{
"name": "v4",
"type": "PointID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getHexahedronIndex",
"return_type": "HexahedronID",
"params": [
{
"name": "v1",
"type": "PointID"
},
{
"name": "v2",
"type": "PointID"
},
{
"name": "v3",
"type": "PointID"
},
{
"name": "v4",
"type": "PointID"
},
{
"name": "v5",
"type": "PointID"
},
{
"name": "v6",
"type": "PointID"
},
{
"name": "v7",
"type": "PointID"
},
{
"name": "v8",
"type": "PointID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getVertexIndexInTriangle",
"return_type": "int",
"params": [
{
"name": "t",
"type": "const Triangle &"
},
{
"name": "vertexIndex",
"type": "PointID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getEdgeIndexInTriangle",
"return_type": "int",
"params": [
{
"name": "t",
"type": "const EdgesInTriangle &"
},
{
"name": "edgeIndex",
"type": "EdgeID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getVertexIndexInQuad",
"return_type": "int",
"params": [
{
"name": "t",
"type": "const Quad &"
},
{
"name": "vertexIndex",
"type": "PointID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getEdgeIndexInQuad",
"return_type": "int",
"params": [
{
"name": "t",
"type": "const EdgesInQuad &"
},
{
"name": "edgeIndex",
"type": "EdgeID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getVertexIndexInTetrahedron",
"return_type": "int",
"params": [
{
"name": "t",
"type": "const Tetra &"
},
{
"name": "vertexIndex",
"type": "PointID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getEdgeIndexInTetrahedron",
"return_type": "int",
"params": [
{
"name": "t",
"type": "const EdgesInTetrahedron &"
},
{
"name": "edgeIndex",
"type": "EdgeID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTriangleIndexInTetrahedron",
"return_type": "int",
"params": [
{
"name": "t",
"type": "const TrianglesInTetrahedron &"
},
{
"name": "triangleIndex",
"type": "TriangleID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getVertexIndexInHexahedron",
"return_type": "int",
"params": [
{
"name": "t",
"type": "const Hexa &"
},
{
"name": "vertexIndex",
"type": "PointID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getEdgeIndexInHexahedron",
"return_type": "int",
"params": [
{
"name": "t",
"type": "const EdgesInHexahedron &"
},
{
"name": "edgeIndex",
"type": "EdgeID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getQuadIndexInHexahedron",
"return_type": "int",
"params": [
{
"name": "t",
"type": "const QuadsInHexahedron &"
},
{
"name": "quadIndex",
"type": "QuadID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getLocalEdgesInTetrahedron",
"return_type": "Edge",
"params": [
{
"name": "i",
"type": "const HexahedronID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getLocalEdgesInHexahedron",
"return_type": "Edge",
"params": [
{
"name": "i",
"type": "const HexahedronID"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTopologyType",
"return_type": "sofa::geometry::ElementType",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "invalidate",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "updateTetrahedra",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "updateHexahedra",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
}
],
"description": "This component is responsible for managing the topology data (points, edges, triangles, tetrahedra, hexahedra) in SOFA (Simulation Open Framework Architecture). It serves as a container to store and manipulate various elements that define the geometry of a mesh. The MeshTopology component supports different types of geometric primitives such as vertices, edges, triangles, quads, tetrahedra, and hexahedra, which are fundamental building blocks for representing objects in 3D space.",
"parameters": [
{
"name": "drawEdges",
"type": "bool",
"description": "Whether to visualize the edges of the mesh. Default is false."
},
{
"name": "drawTriangles",
"type": "bool",
"description": "Whether to visualize the triangles (faces) of the mesh. Default is false."
},
{
"name": "drawQuads",
"type": "bool",
"description": "Whether to visualize the quads (4-sided faces) of the mesh. Default is false."
},
{
"name": "drawTetra",
"type": "bool",
"description": "Whether to visualize the tetrahedra of the mesh. Default is false."
},
{
"name": "drawHexa",
"type": "bool",
"description": "Whether to visualize the hexahedra (cubes) of the mesh. Default is false."
}
],
"functions": [
{
"name": "getNbPoints",
"returnType": "size_t",
"parameters": [],
"description": "Returns the number of points in the topology container."
},
{
"name": "getPoint",
"returnType": "const sofa::type::Vec3&",
"parameters": [
"size_t pointID"
],
"description": "Returns a reference to the coordinates of a specified point."
},
{
"name": "getNbEdges",
"returnType": "size_t",
"parameters": [],
"description": "Returns the number of edges in the topology container."
},
{
"name": "getEdge",
"returnType": "const sofa::type::Vec2ui&",
"parameters": [
"size_t edgeID"
],
"description": "Returns a reference to the indices of the vertices forming an edge."
},
{
"name": "getNbTriangles",
"returnType": "size_t",
"parameters": [],
"description": "Returns the number of triangles in the topology container."
},
{
"name": "getTriangle",
"returnType": "const sofa::type::Vec3ui&",
"parameters": [
"size_t triangleID"
],
"description": "Returns a reference to the indices of the vertices forming a triangle."
},
{
"name": "getNbQuads",
"returnType": "size_t",
"parameters": [],
"description": "Returns the number of quads in the topology container."
},
{
"name": "getQuad",
"returnType": "const sofa::type::Vec4ui&",
"parameters": [
"size_t quadID"
],
"description": "Returns a reference to the indices of the vertices forming a quad."
},
{
"name": "getNbTetras",
"returnType": "size_t",
"parameters": [],
"description": "Returns the number of tetrahedra in the topology container."
},
{
"name": "getTetra",
"returnType": "const sofa::type::Vec4ui&",
"parameters": [
"size_t tetraID"
],
"description": "Returns a reference to the indices of the vertices forming a tetrahedron."
},
{
"name": "getNbHexahedra",
"returnType": "size_t",
"parameters": [],
"description": "Returns the number of hexahedra in the topology container."
},
{
"name": "getHexa",
"returnType": "const sofa::type::Vec8ui&",
"parameters": [
"size_t hexaID"
],
"description": "Returns a reference to the indices of the vertices forming a hexahedron."
}
],
"inputSlots": [
{
"name": "addPoint",
"type": "std::vector<sofa::type::Vec3>",
"description": "Adds new points (vertices) to the topology container."
},
{
"name": "clearEdges",
"type": "",
"description": "Removes all edges from the topology container."
},
{
"name": "addEdge",
"type": "std::vector<sofa::type::Vec2ui>",
"description": "Adds new edges to the topology container."
},
{
"name": "clearTriangles",
"type": "",
"description": "Removes all triangles (faces) from the topology container."
},
{
"name": "addTriangle",
"type": "std::vector<sofa::type::Vec3ui>",
"description": "Adds new triangles to the topology container."
},
{
"name": "clearQuads",
"type": "",
"description": "Removes all quads (4-sided faces) from the topology container."
},
{
"name": "addQuad",
"type": "std::vector<sofa::type::Vec4ui>",
"description": "Adds new quads to the topology container."
},
{
"name": "clearTetras",
"type": "",
"description": "Removes all tetrahedra from the topology container."
},
{
"name": "addTetra",
"type": "std::vector<sofa::type::Vec4ui>",
"description": "Adds new tetrahedra to the topology container."
},
{
"name": "clearHexahedra",
"type": "",
"description": "Removes all hexahedra from the topology container."
},
{
"name": "addHexa",
"type": "std::vector<sofa::type::Vec8ui>",
"description": "Adds new hexahedra to the topology container."
}
],
"outputSlots": [
{
"name": "point_added_signal",
"type": "",
"description": "Emitted when a point is added."
},
{
"name": "edge_added_signal",
"type": "",
"description": "Emitted when an edge is added."
},
{
"name": "triangle_added_signal",
"type": "",
"description": "Emitted when a triangle is added."
},
{
"name": "quad_added_signal",
"type": "",
"description": "Emitted when a quad is added."
},
{
"name": "tetra_added_signal",
"type": "",
"description": "Emitted when a tetrahedron is added."
},
{
"name": "hexa_added_signal",
"type": "",
"description": "Emitted when a hexahedron is added."
}
],
"maths": "The MeshTopology component in the SOFA (Simulation Open Framework Architecture) framework serves as a container for managing geometric topology data, representing various elements such as points, edges, triangles, tetrahedra, and hexahedra. This data structure is essential for defining the geometry of objects within simulations and supports different types of geometric primitives that are foundational building blocks in 3D space.\n\n### Points (Vertices)\nA point or vertex is a basic element represented by coordinates $(x, y, z)$ in three-dimensional space:\n\begin{equation}\n\\mathbf{p_i} = (x_i, y_i, z_i), \\quad i = 0, 1, ..., N_p\n\\end{equation}\nwhere $N_p$ is the total number of points.\n\n### Edges\nEdges connect pairs of vertices and can be represented by two vertex indices:\n\begin{equation}\n\\mathbf{e_j} = (v_{j_1}, v_{j_2}), \\quad j = 0, 1, ..., N_e\n\\end{equation}\nwhere $N_e$ is the total number of edges.\n\n### Triangles and Quads\nTriangles are planar polygons with three vertices:\n\begin{equation}\n\\mathbf{T_k} = (v_{k_1}, v_{k_2}, v_{k_3}), \\quad k = 0, 1, ..., N_t\n\\end{equation}\nwhere $N_t$ is the total number of triangles.\n\nQuads are planar polygons with four vertices:\n\begin{equation}\n\\mathbf{Q_l} = (v_{l_1}, v_{l_2}, v_{l_3}, v_{l_4}), \\quad l = 0, 1, ..., N_q\n\\end{equation}\nwhere $N_q$ is the total number of quads.\n\n### Tetrahedra and Hexahedra\nTetrahedra are three-dimensional polyhedra with four triangular faces:\n\begin{equation}\n\\mathbf{T_k} = (v_{k_1}, v_{k_2}, v_{k_3}, v_{k_4}), \\quad k = 0, 1, ..., N_tet\n\\end{equation}\nwhere $N_tet$ is the total number of tetrahedra.\n\nHexahedra are three-dimensional polyhedra with six quadrilateral faces:\n\begin{equation}\n\\mathbf{H_m} = (v_{m_1}, v_{m_2}, v_{m_3}, v_{m_4}, v_{m_5}, v_{m_6}, v_{m_7}, v_{m_8}), \\quad m = 0, 1, ..., N_hex\n\\end{equation}\nwhere $N_hex$ is the total number of hexahedra.\n\n### Topological Relationships\nThe MeshTopology component maintains topological relationships between elements. For instance:\n- **Edges in Tetrahedron**: A tetrahedron has six edges connecting its vertices:\n\begin{equation}\n\\mathbf{T_k} \\rightarrow \\mathbf{E_{T}} = (e_1, e_2, e_3, e_4, e_5, e_6)\n\\end{equation}\n- **Triangles in Tetrahedron**: A tetrahedron has four triangular faces:\n\begin{equation}\n\\mathbf{T_k} \\rightarrow \\mathbf{T_{T}} = (t_1, t_2, t_3, t_4)\n\\end{equation}\n- **Quads in Hexahedra**: A hexahedron has six quadrilateral faces:\n\begin{equation}\n\\mathbf{H_m} \\rightarrow \\mathbf{Q_{H}} = (q_1, q_2, q_3, q_4, q_5, q_6)\n\\end{equation}\n\n### Connexity and Connected Components\nThe MeshTopology component also provides functionality to determine the connexity of a mesh. For instance:\n- **Connected Elements**: The set of elements connected to an element $E_i$ can be computed recursively by traversing all adjacent vertices and edges.\n\begin{equation}\n\\mathbf{Conn}(E_i) = \\bigcup_{v_j \\in E_i} Adj(v_j)\n\\end{equation}\n- **Number of Connected Components**: The number of connected components in a mesh can be determined by computing the connexity for each element and grouping them into disjoint sets.\n\n### Visualization\nThe component supports visualization by drawing edges, triangles, quads, tetrahedra, and hexahedra using graphical tools. It provides methods to draw lines, triangles, quads, and surfaces, which are essential for visualizing the mesh structure in simulations.",
"abstract": "MeshTopology manages geometric topology data in SOFA simulations, including points, edges, triangles, tetrahedra, and hexahedra, providing methods for initialization, manipulation, and visualization.",
"sheet": "# MeshTopology\n\n## Overview\nMeshTopology is a container for managing the geometric topology data of a mesh in SOFA simulations. It supports various elements such as vertices (points), edges, triangles, quads, tetrahedra, and hexahedra, which are fundamental building blocks for representing objects in 3D space.\n\n## Mathematical Model\nThe MeshTopology component represents the geometric topology data using the following mathematical constructs:\n\n### Points (Vertices)\nA point or vertex is a basic element represented by coordinates $(x, y, z)$ in three-dimensional space:\n\\[ \\mathbf{p_i} = (x_i, y_i, z_i), \\quad i = 0, 1, ..., N_p \\]\nwhere $N_p$ is the total number of points.\n\n### Edges\nEdges connect pairs of vertices and can be represented by two vertex indices:\n\\[ \\mathbf{e_j} = (v_{j_1}, v_{j_2}), \\quad j = 0, 1, ..., N_e \\]\nwhere $N_e$ is the total number of edges.\n\n### Triangles and Quads\nTriangles are planar polygons with three vertices:\n\\[ \\mathbf{T_k} = (v_{k_1}, v_{k_2}, v_{k_3}), \\quad k = 0, 1, ..., N_t \\]\nwhere $N_t$ is the total number of triangles.\n\nQuads are planar polygons with four vertices:\n\\[ \\mathbf{Q_l} = (v_{l_1}, v_{l_2}, v_{l_3}, v_{l_4}), \\quad l = 0, 1, ..., N_q \\]\nwhere $N_q$ is the total number of quads.\n\n### Tetrahedra and Hexahedra\nTetrahedra are three-dimensional polyhedra with four triangular faces:\n\\[ \\mathbf{T_k} = (v_{k_1}, v_{k_2}, v_{k_3}, v_{k_4}), \\quad k = 0, 1, ..., N_tet \\]\nwhere $N_tet$ is the total number of tetrahedra.\n\nHexahedra are three-dimensional polyhedra with six quadrilateral faces:\n\\[ \\mathbf{H_m} = (v_{m_1}, v_{m_2}, v_{m_3}, v_{m_4}, v_{m_5}, v_{m_6}, v_{m_7}, v_{m_8}), \\quad m = 0, 1, ..., N_hex \\]\nwhere $N_hex$ is the total number of hexahedra.\n\n### Topological Relationships\nThe MeshTopology component maintains topological relationships between elements. For instance:\n- **Edges in Tetrahedron**: A tetrahedron has six edges connecting its vertices:\n\\[ \\mathbf{T_k} \\rightarrow \\mathbf{E_{T}} = (e_1, e_2, e_3, e_4, e_5, e_6) \\]\n- **Triangles in Tetrahedron**: A tetrahedron has four triangular faces:\n\\[ \\mathbf{T_k} \\rightarrow \\mathbf{T_{T}} = (t_1, t_2, t_3, t_4) \\]\n- **Quads in Hexahedra**: A hexahedron has six quadrilateral faces:\n\\[ \\mathbf{H_m} \\rightarrow \\mathbf{Q_{H}} = (q_1, q_2, q_3, q_4, q_5, q_6) \\]\n\n### Connexity and Connected Components\nThe MeshTopology component also provides functionality to determine the connexity of a mesh. For instance:\n- **Connected Elements**: The set of elements connected to an element $E_i$ can be computed recursively by traversing all adjacent vertices and edges.\n\\[ \\mathbf{Conn}(E_i) = \\bigcup_{v_j \\in E_i} Adj(v_j) \\]\n- **Number of Connected Components**: The number of connected components in a mesh can be determined by computing the connexity for each element and grouping them into disjoint sets.\n\n## Parameters and Data\nThe significant Data fields exposed by MeshTopology include:\n\n| Field Name | Type | XML Name | Description |\n|------------|------|----------|-------------|\n| d_seqPoints | SeqPoints | position | List of point positions |\n| d_seqUVs | SeqUV | uv | List of UV coordinates |\n| d_computeAllBuffers | bool | computeAllBuffers | Option to compute all crossed topology buffers at init. False by default |\n| d_drawEdges | bool | drawEdges | if true, draw the topology Edges |\n| d_drawTriangles | bool | drawTriangles | if true, draw the topology Triangles |\n| d_drawQuads | bool | drawQuads | if true, draw the topology Quads |\n| d_drawTetra | bool | drawTetrahedra | if true, draw the topology Tetrahedra |\n| d_drawHexa | bool | drawHexahedra | if true, draw the topology hexahedra |\n\n## Dependencies and Connections\nMeshTopology typically requires other SOFA components to provide point positions and UV coordinates. It fits into the scene graph by connecting with mechanical models, visualizers, and solvers that rely on its topological data.\n"
}