MeshLib C++ Docs
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{
11
12
35namespace MeshBuilder
36{
37
40MRMESH_API MeshTopology fromTriangles( const Triangulation & t, const BuildSettings & settings = {}, ProgressCallback progressCb = {} );
41
43{
44 VertId srcVert;
45 VertId dupVert;
46};
47
51MRMESH_API size_t duplicateNonManifoldVertices( Triangulation & t, FaceBitSet * region = nullptr,
52 std::vector<VertDuplication>* dups = nullptr, VertId lastValidVert = {} );
53
58 Triangulation & t,
59 std::vector<VertDuplication> * dups = nullptr,
60 const BuildSettings & settings = {} );
61
64MRMESH_API Mesh fromPointTriples( const std::vector<Triangle3f> & posTriples );
65
68{
69 FaceMap fmap;
70 VertMap vmap;
72 FaceBitSet rem;
73};
74
78 const Triangulation & t, VertId maxVertId,
79 const std::vector<MeshPiece> & pieces,
80 const BuildSettings & settings = {} );
81
84MRMESH_API void addTriangles( MeshTopology & res, const Triangulation & t, const BuildSettings & settings = {} );
85
88MRMESH_API void addTriangles( MeshTopology & res, std::vector<VertId> & vertTriples,
89 FaceBitSet * createdFaces = nullptr );
90
92MRMESH_API MeshTopology fromFaceSoup( const std::vector<VertId> & verts, const Vector<VertSpan, FaceId> & faces,
93 const BuildSettings & settings = {}, ProgressCallback progressCb = {} );
94
96{
98 float closeDist = 0.0f;
99
101 bool uniteOnlyBd = true;
102
104 VertBitSet* region = nullptr;
105
108
110 VertMap* optionalVertOldToNew = nullptr;
111
113 std::vector<MeshBuilder::VertDuplication>* optionalDuplications = nullptr;
114};
115
121MRMESH_API int uniteCloseVertices( Mesh & mesh, float closeDist, bool uniteOnlyBd = true,
122 VertMap * optionalVertOldToNew = nullptr );
123
127MRMESH_API int uniteCloseVertices( Mesh& mesh, const UniteCloseParams& params = {} );
128
129}
130
131}
Definition MRMeshTopology.h:22
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:23
VertMap vmap
face of part -> face of whole mesh
Definition MRMeshBuilder.h:70
std::vector< MeshBuilder::VertDuplication > * optionalDuplications
Definition MRMeshBuilder.h:113
bool uniteOnlyBd
if true, only vertices from this region can be affected
Definition MRMeshBuilder.h:101
VertId dupVert
original vertex before duplication
Definition MRMeshBuilder.h:45
MRMESH_API void addTriangles(MeshTopology &res, const Triangulation &t, const BuildSettings &settings={})
VertBitSet * region
if true - try to duplicates non-manifold vertices instead of removing faces
Definition MRMeshBuilder.h:104
VertMap * optionalVertOldToNew
this can be used to map attributes to duplicated vertices
Definition MRMeshBuilder.h:110
MRMESH_API size_t duplicateNonManifoldVertices(Triangulation &t, FaceBitSet *region=nullptr, std::vector< VertDuplication > *dups=nullptr, VertId lastValidVert={})
bool duplicateNonManifold
is the mapping of vertices: before -> after
Definition MRMeshBuilder.h:107
MRMESH_API Mesh fromPointTriples(const std::vector< Triangle3f > &posTriples)
float closeDist
< vertices located closer to each other than
Definition MRMeshBuilder.h:98
MeshTopology topology
vert of part -> vert of whole mesh
Definition MRMeshBuilder.h:71
FaceMap fmap
Definition MRMeshBuilder.h:69
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={})
< this set receives indices of added 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)
FaceBitSet rem
Definition MRMeshBuilder.h:72
VertId srcVert
Definition MRMeshBuilder.h:44
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRMeshBuilderTypes.h:33
a part of a whole mesh to be constructed
Definition MRMeshBuilder.h:68
Definition MRMeshBuilder.h:96
Definition MRMeshBuilder.h:43
Definition MRMesh.h:23