Class representing the connectivity of edges in a triangle mesh, where each edge is associated with the cells (triangles) sharing it. Provides methods to retrieve adjacent cells, vertex coordinates, normals, and other geometric properties.
More...
#include <openvdb/tools/impl/LevelSetDilatedMeshImpl.h>
template<typename ValueT>
class openvdb::v12_1::tools::lvlset::TriangleMeshEdgeConnectivity< ValueT >
Class representing the connectivity of edges in a triangle mesh, where each edge is associated with the cells (triangles) sharing it. Provides methods to retrieve adjacent cells, vertex coordinates, normals, and other geometric properties.
Constructs the TriangleMeshEdgeConnectivity object with given coordinates and cell data. Populates edge-to-cell adjacency and computes cell normals.
- Parameters
-
coords | Vector of vertex coordinates. |
cells | Vector of cell (triangle) indices. |
Retrieves the total number of cells (triangles) in the mesh.
- Returns
- The number of cells as an Index.
Retrieves the total number of coordinates in the mesh.
- Returns
- The number of coordinates as an Index.
bool getAdjacentCells |
( |
const Index & |
v1, |
|
|
const Index & |
v2, |
|
|
std::vector< Index > & |
cellIds |
|
) |
| const |
|
inline |
Retrieves the IDs of cells adjacent to an edge formed by two vertices.
- Parameters
-
v1 | First vertex index. |
v2 | Second vertex index. |
cellIds | Output vector to hold the IDs of adjacent cells. |
- Returns
- True if adjacent cells are found, false otherwise.
const Vec3I& getCell |
( |
const T & |
i | ) |
const |
|
inline |
Retrieves the cell (triangle) at a given index.
- Template Parameters
-
T | Any integral type (int, unsigned int, size_t, etc.) |
- Parameters
-
- Returns
- Constant reference to the triangle's vertex indices.
const Vec3T& getCoord |
( |
const T & |
i | ) |
const |
|
inline |
Retrieves the 3D coordinate at a given index.
- Template Parameters
-
T | Any integral type (int, unsigned int, size_t, etc.) |
- Parameters
-
- Returns
- The 3D coordinate as a constant reference to Vec3T.
Vec3T getNormal |
( |
const T & |
i | ) |
const |
|
inline |
Retrieves the unit normal vector of a cell (triangle) at a given index.
- Template Parameters
-
T | Any integral type (int, unsigned int, size_t, etc.) |
- Parameters
-
- Returns
- The normal vector of the triangle as a Vec3T.
std::vector<Vec3T> getPrimitive |
( |
const T & |
i | ) |
const |
|
inline |
Retrieves the 3D coordinates of the vertices forming a primitive (triangle) at a given cell index.
- Template Parameters
-
T | Any integral type (int, unsigned int, size_t, etc.) |
- Parameters
-
i | Index of the cell (triangle). |
- Returns
- A vector of three Vec3T representing the coordinates of the triangle's vertices.