MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::MeshBuilder Namespace Reference

Building topologies by triangles. More...

Classes

struct  BuildSettings
 
struct  equalVector3f
 this makes bit-wise comparison of two Vector3f's thus making two NaNs equal More...
 
struct  MeshPiece
 a part of a whole mesh to be constructed More...
 
struct  Triangle
 mesh triangle represented by its three vertices and by its face ID More...
 
struct  UniteCloseParams
 
struct  VertDuplication
 
class  VertexIdentifier
 
struct  VertSpan
 each face is surrounded by a closed contour of vertices [fistVertex, lastVertex) More...
 

Functions

MRMESH_API MeshTopology fromTriangles (const Triangulation &t, const BuildSettings &settings={}, ProgressCallback progressCb={})
 
MRMESH_API size_t duplicateNonManifoldVertices (Triangulation &t, FaceBitSet *region=nullptr, std::vector< VertDuplication > *dups=nullptr, VertId lastValidVert={})
 
MRMESH_API MeshTopology fromTrianglesDuplicatingNonManifoldVertices (Triangulation &t, std::vector< VertDuplication > *dups=nullptr, const BuildSettings &settings={})
 
MRMESH_API Mesh fromPointTriples (const std::vector< Triangle3f > &posTriples)
 
MRMESH_API MeshTopology fromDisjointMeshPieces (const Triangulation &t, VertId maxVertId, const std::vector< MeshPiece > &pieces, const BuildSettings &settings={})
 
MRMESH_API void addTriangles (MeshTopology &res, const Triangulation &t, const BuildSettings &settings={})
 
MRMESH_API void addTriangles (MeshTopology &res, std::vector< VertId > &vertTriples, FaceBitSet *createdFaces=nullptr)
 
MRMESH_API MeshTopology fromFaceSoup (const std::vector< VertId > &verts, const Vector< VertSpan, FaceId > &faces, const BuildSettings &settings={}, ProgressCallback progressCb={})
 < this set receives indices of added triangles
 
MRMESH_API int uniteCloseVertices (Mesh &mesh, float closeDist, bool uniteOnlyBd=true, VertMap *optionalVertOldToNew=nullptr)
 
MRMESH_API int uniteCloseVertices (Mesh &mesh, const UniteCloseParams &params={})
 

Detailed Description

Building topologies by triangles.

This namespace provides API for building meshes.

Simple example with key steps

MR::Triangulation t;
t.push_back({0_v,1_v,2_v});
t.push_back({2_v,1_v,3_v});
auto topology = MR::MeshBuilder::fromTriangles(t);
MRMESH_API MeshTopology fromTriangles(const Triangulation &t, const BuildSettings &settings={}, ProgressCallback progressCb={})
Warning
Vertices of triangles should have consistent bypass direction
Note
It is better to store topology directly in mesh
See also
MeshTopology