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
85MRMESH_API size_t addTriangles( MeshTopology & res, const Triangulation & t, const BuildSettings & settings = {} );
86
89MRMESH_API void addTriangles( MeshTopology & res, std::vector<VertId> & vertTriples,
90 FaceBitSet * createdFaces = nullptr );
91
93MRMESH_API MeshTopology fromFaceSoup( const std::vector<VertId> & verts, const Vector<VertSpan, FaceId> & faces,
94 const BuildSettings & settings = {}, ProgressCallback progressCb = {} );
95
97{
99 float closeDist = 0.0f;
100
102 bool uniteOnlyBd = true;
103
105 VertBitSet* region = nullptr;
106
109
111 VertMap* optionalVertOldToNew = nullptr;
112
114 std::vector<MeshBuilder::VertDuplication>* optionalDuplications = nullptr;
115};
116
122MRMESH_API int uniteCloseVertices( Mesh & mesh, float closeDist, bool uniteOnlyBd = true,
123 VertMap * optionalVertOldToNew = nullptr );
124
128MRMESH_API int uniteCloseVertices( Mesh& mesh, const UniteCloseParams& params = {} );
129
130}
131
132}
#define MRMESH_API
Definition MRMeshFwd.h:82
Definition MRMeshTopology.h:30
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:23
std::function< bool(float)> ProgressCallback
Definition MRMeshFwd.h:751
VertMap vmap
vert of part -> vert of whole mesh
Definition MRMeshBuilder.h:70
std::vector< MeshBuilder::VertDuplication > * optionalDuplications
Definition MRMeshBuilder.h:114
bool uniteOnlyBd
if true, only vertices from this region can be affected
Definition MRMeshBuilder.h:102
Mesh fromPointTriples(const std::vector< Triangle3f > &posTriples)
VertId dupVert
new vertex after duplication
Definition MRMeshBuilder.h:45
MeshTopology fromTriangles(const Triangulation &t, const BuildSettings &settings={}, ProgressCallback progressCb={})
VertBitSet * region
if true - try to duplicates non-manifold vertices instead of removing faces
Definition MRMeshBuilder.h:105
MeshTopology fromDisjointMeshPieces(const Triangulation &t, VertId maxVertId, const std::vector< MeshPiece > &pieces, const BuildSettings &settings={})
VertMap * optionalVertOldToNew
this can be used to map attributes to duplicated vertices
Definition MRMeshBuilder.h:111
bool duplicateNonManifold
is the mapping of vertices: before -> after
Definition MRMeshBuilder.h:108
float closeDist
< vertices located closer to each other than
Definition MRMeshBuilder.h:99
MeshTopology topology
Definition MRMeshBuilder.h:71
FaceMap fmap
face of part -> face of whole mesh
Definition MRMeshBuilder.h:69
size_t addTriangles(MeshTopology &res, const Triangulation &t, const BuildSettings &settings={})
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...
MeshTopology fromTrianglesDuplicatingNonManifoldVertices(Triangulation &t, std::vector< VertDuplication > *dups=nullptr, const BuildSettings &settings={})
size_t duplicateNonManifoldVertices(Triangulation &t, FaceBitSet *region=nullptr, std::vector< VertDuplication > *dups=nullptr, VertId lastValidVert={})
FaceBitSet rem
remaining triangles of part, not in topology
Definition MRMeshBuilder.h:72
VertId srcVert
original vertex before duplication
Definition MRMeshBuilder.h:44
int uniteCloseVertices(Mesh &mesh, float closeDist, bool uniteOnlyBd=true, VertMap *optionalVertOldToNew=nullptr)
Building topologies by triangles.
Definition MRIdentifyVertices.h:16
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:97
Definition MRMeshBuilder.h:43
Definition MRMesh.h:23