Public Member Functions | |
| void | pack () |
| tightly packs all arrays eliminating lone edges and invalid faces, vertices and points | |
| void | packOptimally () |
| number | volume () |
| number | area () |
| returns the area of given face | |
| Box3f | computeBoundingBox () |
| void | invalidateCaches () |
| void | transform (AffineXf3f xf) |
| number | averageEdgeLength () |
| computes average length of an edge in this mesh | |
| void | addMesh (Mesh from) |
| appends another mesh as separate connected component(s) to this | |
| number | edgeLength (number e) |
| returns Euclidean length of the edge | |
| number | edgeLengthSq (number e) |
| returns squared Euclidean length of the edge (faster to compute than length) | |
| Vector3f | normal (number v) |
| computes triangular face normal from its vertices | |
| Vector3f | findCenterFromPoints () |
| computes average position of all valid mesh vertices | |
| Vector3f | findCenterFromFaces () |
| computes center of mass considering that density of all triangles is the same | |
| Vector3f | findCenterFromBBox () |
| computes bounding box and returns its center | |
| MeshTriPoint | toTriPoint (number f, Vector3f p) |
| converts vertex into barycentric representation | |
Static Public Member Functions | |
| static Mesh | fromTriangles (VertCoords vertexCoordinates, Triangulation t) |
| construct mesh from vertex coordinates and a set of triangles with given ids | |
| static Mesh | fromTrianglesDuplicatingNonManifoldVertices (VertCoords vertexCoordinates, Triangulation t) |
Public Attributes | |
| MeshTopology | topology |
| VertCoords | points |
This class represents a mesh, including topology (connectivity) information and point coordinates, as well as some caches to accelerate search algorithms
| void Mesh::addMesh | ( | Mesh | from | ) |
appends another mesh as separate connected component(s) to this
| number Mesh::area | ( | ) |
returns the area of given face
| number Mesh::averageEdgeLength | ( | ) |
computes average length of an edge in this mesh
| Box3f Mesh::computeBoundingBox | ( | ) |
passes through all valid vertices and finds the minimal bounding box containing all of them; if toWorld transformation is given then returns minimal bounding box in world space
| number Mesh::edgeLength | ( | number | e | ) |
returns Euclidean length of the edge
| number Mesh::edgeLengthSq | ( | number | e | ) |
returns squared Euclidean length of the edge (faster to compute than length)
| Vector3f Mesh::findCenterFromBBox | ( | ) |
computes bounding box and returns its center
| Vector3f Mesh::findCenterFromFaces | ( | ) |
computes center of mass considering that density of all triangles is the same
| Vector3f Mesh::findCenterFromPoints | ( | ) |
computes average position of all valid mesh vertices
|
static |
construct mesh from vertex coordinates and a set of triangles with given ids
|
static |
construct mesh from vertex coordinates and a set of triangles with given ids; unlike simple fromTriangles() it tries to resolve non-manifold vertices by creating duplicate vertices
| void Mesh::invalidateCaches | ( | ) |
invalidates caches (aabb-trees) after any change in mesh geometry or topology
| pointsChanged | specifies whether points have changed (otherwise only topology has changed) |
| Vector3f Mesh::normal | ( | number | v | ) |
computes triangular face normal from its vertices
| void Mesh::pack | ( | ) |
tightly packs all arrays eliminating lone edges and invalid faces, vertices and points
| void Mesh::packOptimally | ( | ) |
packs tightly and rearranges vertices, triangles and edges to put close in space elements in close indices
| preserveAABBTree | whether to keep valid mesh's AABB tree after return (it will take longer to compute and it will occupy more memory) |
| MeshTriPoint Mesh::toTriPoint | ( | number | f, |
| Vector3f | p ) |
converts vertex into barycentric representation
| void Mesh::transform | ( | AffineXf3f | xf | ) |
applies given transformation to specified vertices if region is nullptr, all valid mesh vertices are used
| number Mesh::volume | ( | ) |
returns volume of the object surrounded by given region (or whole mesh if (region) is nullptr); if the region has holes then each hole will be virtually filled by adding triangles for each edge and the hole's geometrical center
| VertCoords Mesh::points |
| MeshTopology Mesh::topology |