MeshLib
 
Loading...
Searching...
No Matches
MRMeshBuilder.h
Go to the documentation of this file.
1#pragma once
2
4#include "MRMesh.h"
6
7namespace MR
8{
9
32namespace MeshBuilder
33{
34
37MRMESH_API MeshTopology fromTriangles( const Triangulation & t, const BuildSettings & settings = {}, ProgressCallback progressCb = {} );
38
40{
41 VertId srcVert; // original vertex before duplication
42 VertId dupVert; // new vertex after duplication
43};
44
45// resolve non-manifold vertices by creating duplicate vertices in the triangulation (which is modified)
46// return number of duplicated vertices
48 std::vector<VertDuplication>* dups = nullptr );
49
50// construct mesh topology from a set of triangles with given ids;
51// unlike simple fromTriangles() it tries to resolve non-manifold vertices by creating duplicate vertices;
52// triangulation is modified to introduce duplicates
54 Triangulation & t,
55 std::vector<VertDuplication> * dups = nullptr,
56 const BuildSettings & settings = {} );
57
58// construct mesh from point triples;
59// all coinciding points are given the same VertId in the result
60MRMESH_API Mesh fromPointTriples( const std::vector<Triangle3f> & posTriples );
61
62// a part of a whole mesh to be constructed
64{
65 FaceMap fmap; // face of part -> face of whole mesh
66 VertMap vmap; // vert of part -> vert of whole mesh
68 FaceBitSet rem; // remaining triangles of part, not in topology
69};
70
71// construct mesh topology in parallel from given disjoint mesh pieces (which do not have any shared vertex)
72// and some additional triangles (in settings) that join the pieces
74 const Triangulation & t, VertId maxVertId,
75 const std::vector<MeshPiece> & pieces,
76 const BuildSettings & settings = {} );
77
78// adds triangles in the existing topology, given face indecies must be free;
79// settings.region on output contain the remaining triangles that could not be added into the topology right now, but may be added later when other triangles appear in the mesh
80MRMESH_API void addTriangles( MeshTopology & res, const Triangulation & t, const BuildSettings & settings = {} );
81
82// adds triangles in the existing topology, auto selecting face ids for them;
83// vertTriples on output contain the remaining triangles that could not be added into the topology right now, but may be added later when other triangles appear in the mesh
84MRMESH_API void addTriangles( MeshTopology & res, std::vector<VertId> & vertTriples,
85 FaceBitSet * createdFaces = nullptr ); //< this set receives indices of added triangles
86
88MRMESH_API MeshTopology fromFaceSoup( const std::vector<VertId> & verts, const Vector<VertSpan, FaceId> & faces,
89 const BuildSettings & settings = {}, ProgressCallback progressCb = {} );
90
96MRMESH_API int uniteCloseVertices( Mesh & mesh, float closeDist, bool uniteOnlyBd = true,
97 VertMap * optionalVertOldToNew = nullptr );
98
99} //namespace MeshBuilder
100
101} //namespace MR
int VertId
Definition MRDotNet/MRMeshFwd.h:51
List< VertId > VertMap
Definition MRDotNet/MRMeshFwd.h:84
List< FaceId > FaceMap
Definition MRDotNet/MRMeshFwd.h:87
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRDotNet/MRBitSet.h:39
Definition MRMesh/MRMeshTopology.h:18
std::vector<T>-like container that requires specific indexing type,
Definition MRMesh/MRVector.h:19
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:589
MRMESH_API void addTriangles(MeshTopology &res, const Triangulation &t, const BuildSettings &settings={})
MRMESH_API size_t duplicateNonManifoldVertices(Triangulation &t, FaceBitSet *region=nullptr, std::vector< VertDuplication > *dups=nullptr)
MRMESH_API Mesh fromPointTriples(const std::vector< Triangle3f > &posTriples)
MRMESH_API MeshTopology fromTrianglesDuplicatingNonManifoldVertices(Triangulation &t, std::vector< VertDuplication > *dups=nullptr, const BuildSettings &settings={})
MRMESH_API MeshTopology fromFaceSoup(const std::vector< VertId > &verts, const Vector< VertSpan, FaceId > &faces, const BuildSettings &settings={}, ProgressCallback progressCb={})
construct mesh topology from face soup, where each face can have arbitrary degree (not only triangles...
MRMESH_API MeshTopology fromDisjointMeshPieces(const Triangulation &t, VertId maxVertId, const std::vector< MeshPiece > &pieces, const BuildSettings &settings={})
MRMESH_API MeshTopology fromTriangles(const Triangulation &t, const BuildSettings &settings={}, ProgressCallback progressCb={})
MRMESH_API int uniteCloseVertices(Mesh &mesh, float closeDist, bool uniteOnlyBd=true, VertMap *optionalVertOldToNew=nullptr)
Definition MRCameraOrientationPlugin.h:7
Definition Triangulation.dox.py:1
Definition MRMeshBuilderTypes.h:30
Definition MRMeshBuilder.h:64
VertMap vmap
Definition MRMeshBuilder.h:66
MeshTopology topology
Definition MRMeshBuilder.h:67
FaceMap fmap
Definition MRMeshBuilder.h:65
FaceBitSet rem
Definition MRMeshBuilder.h:68
Definition MRMeshBuilder.h:40
VertId dupVert
Definition MRMeshBuilder.h:42
VertId srcVert
Definition MRMeshBuilder.h:41
Definition MRMesh/MRMesh.h:23