A class representing a 3D mesh.
More...
#include <mesh.h>
|
| size_t | countUniqueEdges () const |
| | Count the number of unique edges in the mesh by iterating through all triangles and adding their edges to an unordered_set.
|
| float | calculateAspectRatio (const Triangle &t) const |
| | Calculate the aspect ratio of a triangle defined by its vertex indices. An aspect ratio near to 1 indicates a more equilateral triangle.
|
|
void | calculateAspectRatios () |
| | Calculate the aspect ratio for all triangles in the mesh and store them in the ratios vector.
|
|
void | analyzeMesh () |
| | Analyze the mesh by printing out the number of vertices, triangles, and unique edges. Optionally, it could also calculate and print the aspect ratio of each triangle for quality analysis.
|
| bool | loadObj (const std::string &path) |
| | Load a mesh from an OBJ file using tinyobjloader.
|
| std::unordered_map< Edge, int, EdgeHash > | getEdgeValences () const |
| | Get the Edge Valences object.
|
| std::vector< Edge > | getBoundaryEdges () const |
| | Get the boundary edges of the mesh.
|
| void | smooth (int iterations, float lambda) |
| | Smooth the mesh by iteratively moving each vertex towards the centroid of its neighbors.
|
|
|
std::vector< Point > | vertices |
| | List of vertices in the mesh.
|
|
std::vector< Triangle > | triangles |
| | List of triangles defined by vertex indices.
|
|
std::vector< float > | ratios |
| | aspect ratios of triangles (for quality analysis)
|
A class representing a 3D mesh.
◆ calculateAspectRatio()
| float Mesh::calculateAspectRatio |
( |
const Triangle & | t | ) |
const |
Calculate the aspect ratio of a triangle defined by its vertex indices. An aspect ratio near to 1 indicates a more equilateral triangle.
- Parameters
-
- Returns
- float
◆ countUniqueEdges()
| size_t Mesh::countUniqueEdges |
( |
| ) |
const |
Count the number of unique edges in the mesh by iterating through all triangles and adding their edges to an unordered_set.
- Returns
- number of unique edges in the mesh
◆ getBoundaryEdges()
| std::vector< Edge > Mesh::getBoundaryEdges |
( |
| ) |
const |
Get the boundary edges of the mesh.
- Returns
- A vector containing the boundary edges
◆ getEdgeValences()
| std::unordered_map< Edge, int, EdgeHash > Mesh::getEdgeValences |
( |
| ) |
const |
Get the Edge Valences object.
- Returns
- std::unordered_map<Edge, int, EdgeHash>
◆ loadObj()
| bool Mesh::loadObj |
( |
const std::string & | path | ) |
|
Load a mesh from an OBJ file using tinyobjloader.
- Parameters
-
| path | Path to the OBJ file to load |
- Returns
- true
-
false
◆ smooth()
| void Mesh::smooth |
( |
int | iterations, |
|
|
float | lambda ) |
Smooth the mesh by iteratively moving each vertex towards the centroid of its neighbors.
- Parameters
-
| iterations | Number of smoothing iterations to perform |
| lambda | Smoothing parameter (0 < lambda < 1) |
The documentation for this class was generated from the following files:
- include/geometry/mesh.h
- src/geometry/mesh.cpp