MeshLib C++ Docs
Loading...
Searching...
No Matches
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
17
26{
32
38 bool smoothBd{ true };
39
41 FaceBitSet* outNewFaces{ nullptr };
42
57
61 bool makeDegenerateBand{ false };
62
67
74};
75
84{
91 FaceBitSet* outNewFaces{ nullptr };
92};
93
117MRMESH_API void stitchHoles( Mesh& mesh, EdgeId a, EdgeId b, const StitchHolesParams& params = {} );
118[[deprecated( "Use stitchHoles( mesh, a, b, params )" )]]
119MRMESH_API void buildCylinderBetweenTwoHoles( Mesh & mesh, EdgeId a, EdgeId b, const StitchHolesParams& params = {} );
120
122MRMESH_API bool stitchHoles( Mesh& mesh, const StitchHolesParams& params = {} );
123[[deprecated( "Use stitchHoles( mesh, params )" )]]
125
126
149MRMESH_API void fillHole( Mesh& mesh, EdgeId a, const FillHoleParams& params = {} );
150
152MRMESH_API void fillHoles( Mesh& mesh, const std::vector<EdgeId> & as, const FillHoleParams& params = {} );
153
158[[nodiscard]] MRMESH_API bool isHoleBd( const MeshTopology & topology, const EdgeLoop & loop );
159
161{
165};
166
169{
170 std::vector<FillHoleItem> items;
171 int numTris = 0;
172};
173
176MRMESH_API HoleFillPlan getHoleFillPlan( const Mesh& mesh, EdgeId e, const FillHoleParams& params = {} );
177
180MRMESH_API std::vector<HoleFillPlan> getHoleFillPlans( const Mesh& mesh, const std::vector<EdgeId>& holeRepresentativeEdges, const FillHoleParams& params = {} );
181
185
188MRMESH_API std::vector<HoleFillPlan> getPlanarHoleFillPlans( const Mesh& mesh, const std::vector<EdgeId>& holeRepresentativeEdges );
189
191MRMESH_API void executeHoleFillPlan( Mesh & mesh, EdgeId a0, HoleFillPlan & plan, FaceBitSet * outNewFaces = nullptr );
192
214MRMESH_API VertId fillHoleTrivially( Mesh& mesh, EdgeId a, FaceBitSet * outNewFaces = nullptr );
215
219MRMESH_API EdgeId extendHole( Mesh& mesh, EdgeId a, const Plane3f & plane, FaceBitSet * outNewFaces = nullptr );
220
223MRMESH_API std::vector<EdgeId> extendAllHoles( Mesh& mesh, const Plane3f & plane, FaceBitSet * outNewFaces = nullptr );
224
228MRMESH_API EdgeId extendHole( Mesh& mesh, EdgeId a, std::function<Vector3f(const Vector3f &)> getVertPos, FaceBitSet * outNewFaces = nullptr );
229
233MRMESH_API EdgeId buildBottom( Mesh& mesh, EdgeId a, Vector3f dir, float holeExtension, FaceBitSet* outNewFaces = nullptr );
234
237MRMESH_API EdgeId makeDegenerateBandAroundHole( Mesh& mesh, EdgeId a, FaceBitSet * outNewFaces = nullptr );
238
240{
242 int newFaces = 0;
243
246 EdgeId na, nb;
247
249 explicit operator bool() const { return newFaces > 0; }
250};
251
255MRMESH_API MakeBridgeResult makeQuadBridge( MeshTopology & topology, EdgeId a, EdgeId b, FaceBitSet * outNewFaces = nullptr );
256
260MRMESH_API MakeBridgeResult makeBridge( MeshTopology & topology, EdgeId a, EdgeId b, FaceBitSet * outNewFaces = nullptr );
261
267MRMESH_API MakeBridgeResult makeSmoothBridge( Mesh & mesh, EdgeId a, EdgeId b, float samplingStep, FaceBitSet * outNewFaces = nullptr );
268
271MRMESH_API EdgeId makeBridgeEdge( MeshTopology & topology, EdgeId a, EdgeId b );
272
274MRMESH_API void splitQuad( MeshTopology & topology, EdgeId a, FaceBitSet * outNewFaces = nullptr );
275
277
278}
#define MRMESH_API
Definition MRMeshFwd.h:80
Definition MRMeshTopology.h:23
HoleFillPlan getPlanarHoleFillPlan(const Mesh &mesh, EdgeId e)
void stitchHoles(Mesh &mesh, EdgeId a, EdgeId b, const StitchHolesParams &params={})
Stitches two holes in Mesh .
void fillHoles(Mesh &mesh, const std::vector< EdgeId > &as, const FillHoleParams &params={})
fill all holes given by their representative edges in
EdgeId makeBridgeEdge(MeshTopology &topology, EdgeId a, EdgeId b)
EdgeId extendHole(Mesh &mesh, EdgeId a, const Plane3f &plane, FaceBitSet *outNewFaces=nullptr)
void buildCylinderBetweenTwoHoles(Mesh &mesh, EdgeId a, EdgeId b, const StitchHolesParams &params={})
bool isHoleBd(const MeshTopology &topology, const EdgeLoop &loop)
MakeBridgeResult makeQuadBridge(MeshTopology &topology, EdgeId a, EdgeId b, FaceBitSet *outNewFaces=nullptr)
VertId fillHoleTrivially(Mesh &mesh, EdgeId a, FaceBitSet *outNewFaces=nullptr)
Triangulates face of hole in mesh trivially .
std::vector< HoleFillPlan > getHoleFillPlans(const Mesh &mesh, const std::vector< EdgeId > &holeRepresentativeEdges, const FillHoleParams &params={})
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)
HoleFillPlan getHoleFillPlan(const Mesh &mesh, EdgeId e, const FillHoleParams &params={})
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...
EdgeId makeDegenerateBandAroundHole(Mesh &mesh, EdgeId a, FaceBitSet *outNewFaces=nullptr)
std::vector< HoleFillPlan > getPlanarHoleFillPlans(const Mesh &mesh, const std::vector< EdgeId > &holeRepresentativeEdges)
MakeBridgeResult makeBridge(MeshTopology &topology, EdgeId a, EdgeId b, FaceBitSet *outNewFaces=nullptr)
std::vector< EdgeId > extendAllHoles(Mesh &mesh, const Plane3f &plane, FaceBitSet *outNewFaces=nullptr)
EdgeId buildBottom(Mesh &mesh, EdgeId a, Vector3f dir, float holeExtension, FaceBitSet *outNewFaces=nullptr)
void fillHole(Mesh &mesh, EdgeId a, const FillHoleParams &params={})
Fills hole in mesh .
MakeBridgeResult makeSmoothBridge(Mesh &mesh, EdgeId a, EdgeId b, float samplingStep, FaceBitSet *outNewFaces=nullptr)
std::vector< EdgeId > EdgeLoop
Definition MRMeshFwd.h:148
Plane3f
Definition MRMeshFwd.h:393
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRMeshFillHole.h:161
int edgeCode2
Definition MRMeshFillHole.h:164
int edgeCode1
Definition MRMeshFillHole.h:164
Holds metrics for fillHole and stitchHoles triangulation .
Definition MRMeshMetrics.h:40
Parameters structure for MR::fillHole Structure has some options to control MR::fillHole.
Definition MRMeshFillHole.h:26
FaceBitSet * outNewFaces
If not nullptr accumulate new faces.
Definition MRMeshFillHole.h:41
enum MR::FillHoleParams::MultipleEdgesResolveMode Simple
int maxPolygonSubdivisions
Definition MRMeshFillHole.h:66
bool makeDegenerateBand
Definition MRMeshFillHole.h:61
bool * stopBeforeBadTriangulation
Definition MRMeshFillHole.h:73
FillHoleMetric metric
Definition MRMeshFillHole.h:31
bool smoothBd
Definition MRMeshFillHole.h:38
MultipleEdgesResolveMode
Definition MRMeshFillHole.h:52
@ Simple
Definition MRMeshFillHole.h:54
@ None
Definition MRMeshFillHole.h:53
@ Strong
Definition MRMeshFillHole.h:55
concise representation of proposed hole triangulation
Definition MRMeshFillHole.h:169
int numTris
Definition MRMeshFillHole.h:171
std::vector< FillHoleItem > items
Definition MRMeshFillHole.h:170
Definition MRMeshFillHole.h:240
int newFaces
the number of faces added to the mesh
Definition MRMeshFillHole.h:242
EdgeId na
Definition MRMeshFillHole.h:246
EdgeId nb
Definition MRMeshFillHole.h:246
Definition MRMesh.h:23
Parameters structure for MR::stitchHoles Structure has some options to control MR::stitchHoles.
Definition MRMeshFillHole.h:84
FaceBitSet * outNewFaces
If not nullptr accumulate new faces.
Definition MRMeshFillHole.h:91
FillHoleMetric metric
Definition MRMeshFillHole.h:89