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{
33 FaceBitSet* outNewFaces{ nullptr };
43 {
44 None,
45 Simple,
46 Strong
47 } multipleEdgesResolveMode{ MultipleEdgesResolveMode::Simple };
48
52 bool makeDegenerateBand{ false };
53
58
65};
66
74struct StitchHolesParams
75{
82 FaceBitSet* outNewFaces{ nullptr };
83};
84
106MRMESH_API void buildCylinderBetweenTwoHoles( Mesh & mesh, EdgeId a, EdgeId b, const StitchHolesParams& params = {} );
107
110
111
134MRMESH_API void fillHole( Mesh& mesh, EdgeId a, const FillHoleParams& params = {} );
135
137MRMESH_API void fillHoles( Mesh& mesh, const std::vector<EdgeId> & as, const FillHoleParams& params = {} );
138
143[[nodiscard]] MRMESH_API bool isHoleBd( const MeshTopology & topology, const EdgeLoop & loop );
144
146{
147 // if not-negative number then it is edgeid;
148 // otherwise it refers to the edge created recently
150};
151
154{
155 std::vector<FillHoleItem> items;
156 int numTris = 0; // the number of triangles in the filling
157};
158
161MRMESH_API HoleFillPlan getHoleFillPlan( const Mesh& mesh, EdgeId e, const FillHoleParams& params = {} );
162
166
168MRMESH_API void executeHoleFillPlan( Mesh & mesh, EdgeId a0, HoleFillPlan & plan, FaceBitSet * outNewFaces = nullptr );
169
191MRMESH_API VertId fillHoleTrivially( Mesh& mesh, EdgeId a, FaceBitSet * outNewFaces = nullptr );
192
196MRMESH_API EdgeId extendHole( Mesh& mesh, EdgeId a, const Plane3f & plane, FaceBitSet * outNewFaces = nullptr );
197
200MRMESH_API std::vector<EdgeId> extendAllHoles( Mesh& mesh, const Plane3f & plane, FaceBitSet * outNewFaces = nullptr );
201
205MRMESH_API EdgeId extendHole( Mesh& mesh, EdgeId a, std::function<Vector3f(const Vector3f &)> getVertPos, FaceBitSet * outNewFaces = nullptr );
206
210MRMESH_API EdgeId buildBottom( Mesh& mesh, EdgeId a, Vector3f dir, float holeExtension, FaceBitSet* outNewFaces = nullptr );
211
214MRMESH_API EdgeId makeDegenerateBandAroundHole( Mesh& mesh, EdgeId a, FaceBitSet * outNewFaces = nullptr );
215
217{
219 int newFaces = 0;
220
223 EdgeId na, nb;
224
226 explicit operator bool() const { return newFaces > 0; }
227};
228
232MRMESH_API MakeBridgeResult makeQuadBridge( MeshTopology & topology, EdgeId a, EdgeId b, FaceBitSet * outNewFaces = nullptr );
233
237MRMESH_API MakeBridgeResult makeBridge( MeshTopology & topology, EdgeId a, EdgeId b, FaceBitSet * outNewFaces = nullptr );
238
244MRMESH_API MakeBridgeResult makeSmoothBridge( Mesh & mesh, EdgeId a, EdgeId b, float samplingStep, FaceBitSet * outNewFaces = nullptr );
245
248MRMESH_API EdgeId makeBridgeEdge( MeshTopology & topology, EdgeId a, EdgeId b );
249
251MRMESH_API void splitQuad( MeshTopology & topology, EdgeId a, FaceBitSet * outNewFaces = nullptr );
252
254
255} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:79
Definition MRMesh/MRMeshTopology.h:18
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 EdgeId extendHole(Mesh &mesh, EdgeId a, const Plane3f &plane, FaceBitSet *outNewFaces=nullptr)
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)
std::vector< EdgeId > EdgeLoop
Definition MRMesh/MRMeshFwd.h:132
Definition MRMesh/MRMeshFillHole.h:146
int edgeCode2
Definition MRMesh/MRMeshFillHole.h:149
int edgeCode1
Definition MRMesh/MRMeshFillHole.h:149
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:33
enum MR::FillHoleParams::MultipleEdgesResolveMode Simple
int maxPolygonSubdivisions
Definition MRMesh/MRMeshFillHole.h:57
bool makeDegenerateBand
Definition MRMesh/MRMeshFillHole.h:52
bool * stopBeforeBadTriangulation
Definition MRMesh/MRMeshFillHole.h:64
FillHoleMetric metric
Definition MRMesh/MRMeshFillHole.h:31
MultipleEdgesResolveMode
Definition MRMesh/MRMeshFillHole.h:43
concise representation of proposed hole triangulation
Definition MRMesh/MRMeshFillHole.h:154
int numTris
Definition MRMesh/MRMeshFillHole.h:156
std::vector< FillHoleItem > items
Definition MRMesh/MRMeshFillHole.h:155
Definition MRMesh/MRMeshFillHole.h:217
int newFaces
the number of faces added to the mesh
Definition MRMesh/MRMeshFillHole.h:219
EdgeId na
Definition MRMesh/MRMeshFillHole.h:223
EdgeId nb
Definition MRMesh/MRMeshFillHole.h:223
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:82
FillHoleMetric metric
Definition MRMesh/MRMeshFillHole.h:80