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#include "MRVertDuplication.h"
7
8namespace MR
9{
12
13
36namespace MeshBuilder
37{
38
41MRMESH_API MeshTopology fromTriangles( const Triangulation & t, const BuildSettings & settings = {}, ProgressCallback progressCb = {} );
42
48 Triangulation & t,
49 std::vector<VertDuplication> * dups = nullptr,
50 const BuildSettings & settings = {},
51 const BetterDupContinuation & betterCont = {} );
52
55MRMESH_API Mesh fromPointTriples( const std::vector<Triangle3f> & posTriples );
56
59{
60 FaceMap fmap;
61 VertMap vmap;
63 FaceBitSet rem;
64};
65
69 const Triangulation & t, VertId maxVertId,
70 const std::vector<MeshPiece> & pieces,
71 const BuildSettings & settings = {} );
72
76MRMESH_API size_t addTriangles( MeshTopology & res, const Triangulation & t, const BuildSettings & settings = {} );
77
80MRMESH_API void addTriangles( MeshTopology & res, std::vector<VertId> & vertTriples,
81 FaceBitSet * createdFaces = nullptr );
82
84MRMESH_API MeshTopology fromFaceSoup( const std::vector<VertId> & verts, const Vector<VertSpan, FaceId> & faces,
85 const BuildSettings & settings = {}, ProgressCallback progressCb = {} );
86
91[[nodiscard]] MRMESH_API std::vector<int> computeTrianglesRepetitions( const Triangulation & t );
92
94{
96 float closeDist = 0.0f;
97
99 bool uniteOnlyBd = true;
100
102 VertBitSet* region = nullptr;
103
106
108 VertMap* optionalVertOldToNew = nullptr;
109
111 std::vector<MeshBuilder::VertDuplication>* optionalDuplications = nullptr;
112};
113
119MRMESH_API int uniteCloseVertices( Mesh & mesh, float closeDist, bool uniteOnlyBd = true,
120 VertMap * optionalVertOldToNew = nullptr );
121
125MRMESH_API int uniteCloseVertices( Mesh& mesh, const UniteCloseParams& params = {} );
126
127}
128
129}
#define MRMESH_API
Definition MRMeshFwd.h:85
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:759
VertMap vmap
vert of part -> vert of whole mesh
Definition MRMeshBuilder.h:61
std::vector< MeshBuilder::VertDuplication > * optionalDuplications
Definition MRMeshBuilder.h:111
bool uniteOnlyBd
if true, only vertices from this region can be affected
Definition MRMeshBuilder.h:99
Mesh fromPointTriples(const std::vector< Triangle3f > &posTriples)
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:102
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:108
bool duplicateNonManifold
is the mapping of vertices: before -> after
Definition MRMeshBuilder.h:105
float closeDist
< vertices located closer to each other than
Definition MRMeshBuilder.h:96
MeshTopology topology
Definition MRMeshBuilder.h:62
FaceMap fmap
face of part -> face of whole mesh
Definition MRMeshBuilder.h:60
size_t addTriangles(MeshTopology &res, const Triangulation &t, const BuildSettings &settings={})
std::function< bool(VertId e0, VertId e1, VertId vRef, VertId vCand, VertId vBest)> BetterDupContinuation
Definition MRVertDuplication.h:35
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={}, const BetterDupContinuation &betterCont={})
FaceBitSet rem
remaining triangles of part, not in topology
Definition MRMeshBuilder.h:63
std::vector< int > computeTrianglesRepetitions(const Triangulation &t)
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:59
Definition MRMeshBuilder.h:94
Definition MRMesh.h:24