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 "MRHoleFillPlan.h"
7#include <functional>
8#include <memory>
9
10namespace MR
11{
12
18
27{
33
39 bool smoothBd{ true };
40
42 FaceBitSet* outNewFaces{ nullptr };
43
58
62 bool makeDegenerateBand{ false };
63
68
75};
76
85{
92 FaceBitSet* outNewFaces{ nullptr };
93};
94
118MRMESH_API void stitchHoles( Mesh& mesh, EdgeId a, EdgeId b, const StitchHolesParams& params = {} );
119[[deprecated( "Use stitchHoles( mesh, a, b, params )" )]]
120MRMESH_API void buildCylinderBetweenTwoHoles( Mesh & mesh, EdgeId a, EdgeId b, const StitchHolesParams& params = {} );
121
123MRMESH_API bool stitchHoles( Mesh& mesh, const StitchHolesParams& params = {} );
124[[deprecated( "Use stitchHoles( mesh, params )" )]]
126
127
150MRMESH_API void fillHole( Mesh& mesh, EdgeId a, const FillHoleParams& params = {} );
151
153MRMESH_API void fillHoles( Mesh& mesh, const std::vector<EdgeId> & as, const FillHoleParams& params = {} );
154
159[[nodiscard]] MRMESH_API bool isHoleBd( const MeshTopology & topology, const EdgeLoop & loop );
160
163[[nodiscard]] MRMESH_API HoleFillPlan getHoleFillPlan( const Mesh& mesh, EdgeId e, const FillHoleParams& params = {} );
164
167[[nodiscard]] MRMESH_API std::vector<HoleFillPlan> getHoleFillPlans( const Mesh& mesh, const std::vector<EdgeId>& holeRepresentativeEdges, const FillHoleParams& params = {} );
168
172[[nodiscard]] MRMESH_API HoleFillPlan getPlanarHoleFillPlan( const Mesh& mesh, EdgeId e, bool allowSweptLine = true );
173
176[[nodiscard]] MRMESH_API std::vector<HoleFillPlan> getPlanarHoleFillPlans( const Mesh& mesh, const std::vector<EdgeId>& holeRepresentativeEdges );
177
179MRMESH_API void executeHoleFillPlan( Mesh & mesh, EdgeId a0, HoleFillPlan & plan, FaceBitSet * outNewFaces = nullptr );
180
184[[nodiscard]] MRMESH_API bool isFillingMultipleEdgeFree( const MeshTopology & topology, const HoleFillPlan & plan );
185
207MRMESH_API VertId fillHoleTrivially( Mesh& mesh, EdgeId a, FaceBitSet * outNewFaces = nullptr );
208
212MRMESH_API EdgeId extendHole( Mesh& mesh, EdgeId a, const Plane3f & plane, FaceBitSet * outNewFaces = nullptr );
213
216MRMESH_API std::vector<EdgeId> extendAllHoles( Mesh& mesh, const Plane3f & plane, FaceBitSet * outNewFaces = nullptr );
217
221MRMESH_API EdgeId extendHole( Mesh& mesh, EdgeId a, std::function<Vector3f(const Vector3f &)> getVertPos, FaceBitSet * outNewFaces = nullptr );
222
226MRMESH_API EdgeId buildBottom( Mesh& mesh, EdgeId a, Vector3f dir, float holeExtension, FaceBitSet* outNewFaces = nullptr );
227
230MRMESH_API EdgeId makeDegenerateBandAroundHole( Mesh& mesh, EdgeId a, FaceBitSet * outNewFaces = nullptr );
231
233{
235 int newFaces = 0;
236
239 EdgeId na, nb;
240
242 explicit operator bool() const { return newFaces > 0; }
243};
244
248MRMESH_API MakeBridgeResult makeQuadBridge( MeshTopology & topology, EdgeId a, EdgeId b, FaceBitSet * outNewFaces = nullptr );
249
253MRMESH_API MakeBridgeResult makeBridge( MeshTopology & topology, EdgeId a, EdgeId b, FaceBitSet * outNewFaces = nullptr );
254
260MRMESH_API MakeBridgeResult makeSmoothBridge( Mesh & mesh, EdgeId a, EdgeId b, float samplingStep, FaceBitSet * outNewFaces = nullptr );
261
264MRMESH_API EdgeId makeBridgeEdge( MeshTopology & topology, EdgeId a, EdgeId b );
265
267MRMESH_API void splitQuad( MeshTopology & topology, EdgeId a, FaceBitSet * outNewFaces = nullptr );
268
270
271}
#define MRMESH_API
Definition MRMeshFwd.h:82
Definition MRMeshTopology.h:30
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)
bool isFillingMultipleEdgeFree(const MeshTopology &topology, const HoleFillPlan &plan)
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)
HoleFillPlan getPlanarHoleFillPlan(const Mesh &mesh, EdgeId e, bool allowSweptLine=true)
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:153
Plane3f
Definition MRMeshFwd.h:388
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
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:27
FaceBitSet * outNewFaces
If not nullptr accumulate new faces.
Definition MRMeshFillHole.h:42
enum MR::FillHoleParams::MultipleEdgesResolveMode Simple
int maxPolygonSubdivisions
Definition MRMeshFillHole.h:67
bool makeDegenerateBand
Definition MRMeshFillHole.h:62
bool * stopBeforeBadTriangulation
Definition MRMeshFillHole.h:74
FillHoleMetric metric
Definition MRMeshFillHole.h:32
bool smoothBd
Definition MRMeshFillHole.h:39
MultipleEdgesResolveMode
Definition MRMeshFillHole.h:53
@ Simple
Definition MRMeshFillHole.h:55
@ None
Definition MRMeshFillHole.h:54
@ Strong
Definition MRMeshFillHole.h:56
concise representation of proposed hole triangulation
Definition MRHoleFillPlan.h:19
Definition MRMeshFillHole.h:233
int newFaces
the number of faces added to the mesh
Definition MRMeshFillHole.h:235
EdgeId na
Definition MRMeshFillHole.h:239
EdgeId nb
Definition MRMeshFillHole.h:239
Definition MRMesh.h:23
Parameters structure for MR::stitchHoles Structure has some options to control MR::stitchHoles.
Definition MRMeshFillHole.h:85
FaceBitSet * outNewFaces
If not nullptr accumulate new faces.
Definition MRMeshFillHole.h:92
FillHoleMetric metric
Definition MRMeshFillHole.h:90