MeshLib C++ Docs
Loading...
Searching...
No Matches
MRMesh/MRMeshFillHole.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRMeshMetrics.h"
5#include "MRId.h"
6#include <functional>
7#include <memory>
8
9namespace MR
10{
11
25struct FillHoleParams
26{
32
38 bool smoothBd{ true };
39
41 FaceBitSet* outNewFaces{ nullptr };
42
52 {
53 None,
54 Simple,
55 Strong
56 } multipleEdgesResolveMode{ MultipleEdgesResolveMode::Simple };
57
61 bool makeDegenerateBand{ false };
62
67
74};
75
83struct StitchHolesParams
84{
91 FaceBitSet* outNewFaces{ nullptr };
92};
93
117MRMESH_API void buildCylinderBetweenTwoHoles( Mesh & mesh, EdgeId a, EdgeId b, const StitchHolesParams& params = {} );
118
121
122
145MRMESH_API void fillHole( Mesh& mesh, EdgeId a, const FillHoleParams& params = {} );
146
148MRMESH_API void fillHoles( Mesh& mesh, const std::vector<EdgeId> & as, const FillHoleParams& params = {} );
149
154[[nodiscard]] MRMESH_API bool isHoleBd( const MeshTopology & topology, const EdgeLoop & loop );
155
157{
158 // if not-negative number then it is edgeid;
159 // otherwise it refers to the edge created recently
161};
162
165{
166 std::vector<FillHoleItem> items;
167 int numTris = 0; // the number of triangles in the filling
168};
169
172MRMESH_API HoleFillPlan getHoleFillPlan( const Mesh& mesh, EdgeId e, const FillHoleParams& params = {} );
173
176MRMESH_API std::vector<HoleFillPlan> getHoleFillPlans( const Mesh& mesh, const std::vector<EdgeId>& holeRepresentativeEdges, const FillHoleParams& params = {} );
177
181
184MRMESH_API std::vector<HoleFillPlan> getPlanarHoleFillPlans( const Mesh& mesh, const std::vector<EdgeId>& holeRepresentativeEdges );
185
187MRMESH_API void executeHoleFillPlan( Mesh & mesh, EdgeId a0, HoleFillPlan & plan, FaceBitSet * outNewFaces = nullptr );
188
210MRMESH_API VertId fillHoleTrivially( Mesh& mesh, EdgeId a, FaceBitSet * outNewFaces = nullptr );
211
215MRMESH_API EdgeId extendHole( Mesh& mesh, EdgeId a, const Plane3f & plane, FaceBitSet * outNewFaces = nullptr );
216
219MRMESH_API std::vector<EdgeId> extendAllHoles( Mesh& mesh, const Plane3f & plane, FaceBitSet * outNewFaces = nullptr );
220
224MRMESH_API EdgeId extendHole( Mesh& mesh, EdgeId a, std::function<Vector3f(const Vector3f &)> getVertPos, FaceBitSet * outNewFaces = nullptr );
225
229MRMESH_API EdgeId buildBottom( Mesh& mesh, EdgeId a, Vector3f dir, float holeExtension, FaceBitSet* outNewFaces = nullptr );
230
233MRMESH_API EdgeId makeDegenerateBandAroundHole( Mesh& mesh, EdgeId a, FaceBitSet * outNewFaces = nullptr );
234
236{
238 int newFaces = 0;
239
242 EdgeId na, nb;
243
245 explicit operator bool() const { return newFaces > 0; }
246};
247
251MRMESH_API MakeBridgeResult makeQuadBridge( MeshTopology & topology, EdgeId a, EdgeId b, FaceBitSet * outNewFaces = nullptr );
252
256MRMESH_API MakeBridgeResult makeBridge( MeshTopology & topology, EdgeId a, EdgeId b, FaceBitSet * outNewFaces = nullptr );
257
263MRMESH_API MakeBridgeResult makeSmoothBridge( Mesh & mesh, EdgeId a, EdgeId b, float samplingStep, FaceBitSet * outNewFaces = nullptr );
264
267MRMESH_API EdgeId makeBridgeEdge( MeshTopology & topology, EdgeId a, EdgeId b );
268
270MRMESH_API void splitQuad( MeshTopology & topology, EdgeId a, FaceBitSet * outNewFaces = nullptr );
271
273
274} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:80
Definition MRMesh/MRMeshTopology.h:19
MRMESH_API VertId fillHoleTrivially(Mesh &mesh, EdgeId a, FaceBitSet *outNewFaces=nullptr)
Triangulates face of hole in mesh trivially .
MRMESH_API EdgeId makeDegenerateBandAroundHole(Mesh &mesh, EdgeId a, FaceBitSet *outNewFaces=nullptr)
MRMESH_API HoleFillPlan getPlanarHoleFillPlan(const Mesh &mesh, EdgeId e)
MRMESH_API MakeBridgeResult makeQuadBridge(MeshTopology &topology, EdgeId a, EdgeId b, FaceBitSet *outNewFaces=nullptr)
MRMESH_API std::vector< HoleFillPlan > getPlanarHoleFillPlans(const Mesh &mesh, const std::vector< EdgeId > &holeRepresentativeEdges)
MRMESH_API EdgeId extendHole(Mesh &mesh, EdgeId a, const Plane3f &plane, FaceBitSet *outNewFaces=nullptr)
MRMESH_API std::vector< HoleFillPlan > getHoleFillPlans(const Mesh &mesh, const std::vector< EdgeId > &holeRepresentativeEdges, const FillHoleParams &params={})
MRMESH_API bool isHoleBd(const MeshTopology &topology, const EdgeLoop &loop)
MRMESH_API EdgeId buildBottom(Mesh &mesh, EdgeId a, Vector3f dir, float holeExtension, FaceBitSet *outNewFaces=nullptr)
MRMESH_API void fillHoles(Mesh &mesh, const std::vector< EdgeId > &as, const FillHoleParams &params={})
fill all holes given by their representative edges in
MRMESH_API EdgeId makeBridgeEdge(MeshTopology &topology, EdgeId a, EdgeId b)
MRMESH_API std::vector< EdgeId > extendAllHoles(Mesh &mesh, const Plane3f &plane, FaceBitSet *outNewFaces=nullptr)
MRMESH_API void buildCylinderBetweenTwoHoles(Mesh &mesh, EdgeId a, EdgeId b, const StitchHolesParams &params={})
Stitches two holes in Mesh .
MRMESH_API HoleFillPlan getHoleFillPlan(const Mesh &mesh, EdgeId e, const FillHoleParams &params={})
MRMESH_API void executeHoleFillPlan(Mesh &mesh, EdgeId a0, HoleFillPlan &plan, FaceBitSet *outNewFaces=nullptr)
quickly triangulates the face or hole to the left of (e) given the plan (quickly compared to fillHole...
MRMESH_API void fillHole(Mesh &mesh, EdgeId a, const FillHoleParams &params={})
Fills hole in mesh .
MRMESH_API MakeBridgeResult makeBridge(MeshTopology &topology, EdgeId a, EdgeId b, FaceBitSet *outNewFaces=nullptr)
MRMESH_API void splitQuad(MeshTopology &topology, EdgeId a, FaceBitSet *outNewFaces=nullptr)
given quadrangle face to the left of a, splits it in two triangles with new diagonal edge via dest(a)
MRMESH_API MakeBridgeResult makeSmoothBridge(Mesh &mesh, EdgeId a, EdgeId b, float samplingStep, FaceBitSet *outNewFaces=nullptr)
Definition MRCameraOrientationPlugin.h:8
std::vector< EdgeId > EdgeLoop
Definition MRMesh/MRMeshFwd.h:141
Definition MRMesh/MRMeshFillHole.h:157
int edgeCode2
Definition MRMesh/MRMeshFillHole.h:160
int edgeCode1
Definition MRMesh/MRMeshFillHole.h:160
Holds metrics for fillHole and buildCylinderBetweenTwoHoles triangulation .
Parameters structure for MR::fillHole Structure has some options to control MR::fillHole.
FaceBitSet * outNewFaces
If not nullptr accumulate new faces.
Definition MRMesh/MRMeshFillHole.h:41
enum MR::FillHoleParams::MultipleEdgesResolveMode Simple
int maxPolygonSubdivisions
Definition MRMesh/MRMeshFillHole.h:66
bool makeDegenerateBand
Definition MRMesh/MRMeshFillHole.h:61
bool * stopBeforeBadTriangulation
Definition MRMesh/MRMeshFillHole.h:73
FillHoleMetric metric
Definition MRMesh/MRMeshFillHole.h:31
bool smoothBd
Definition MRMesh/MRMeshFillHole.h:38
MultipleEdgesResolveMode
Definition MRMesh/MRMeshFillHole.h:52
concise representation of proposed hole triangulation
Definition MRMesh/MRMeshFillHole.h:165
int numTris
Definition MRMesh/MRMeshFillHole.h:167
std::vector< FillHoleItem > items
Definition MRMesh/MRMeshFillHole.h:166
Definition MRMesh/MRMeshFillHole.h:236
int newFaces
the number of faces added to the mesh
Definition MRMesh/MRMeshFillHole.h:238
EdgeId na
Definition MRMesh/MRMeshFillHole.h:242
EdgeId nb
Definition MRMesh/MRMeshFillHole.h:242
Definition MRMesh/MRMesh.h:23
Parameters structure for MR::buildCylinderBetweenTwoHoles Structure has some options to control MR::b...
FaceBitSet * outNewFaces
If not nullptr accumulate new faces.
Definition MRMesh/MRMeshFillHole.h:91
FillHoleMetric metric
Definition MRMesh/MRMeshFillHole.h:89