MeshLib
 
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 <functional>
6#include <memory>
7
8namespace MR
9{
10
24struct FillHoleParams
25{
42 {
43 None,
44 Simple,
45 Strong
46 } multipleEdgesResolveMode{ MultipleEdgesResolveMode::Simple };
47
51 bool makeDegenerateBand{ false };
52
57
64};
65
73struct StitchHolesParams
74{
82};
83
106
109
110
133MRMESH_API void fillHole( Mesh& mesh, EdgeId a, const FillHoleParams& params = {} );
134
136MRMESH_API void fillHoles( Mesh& mesh, const std::vector<EdgeId> & as, const FillHoleParams& params = {} );
137
142[[nodiscard]] MRMESH_API bool isHoleBd( const MeshTopology & topology, const EdgeLoop & loop );
143
145{
146 // if not-negative number then it is edgeid;
147 // otherwise it refers to the edge created recently
149};
150
153{
154 std::vector<FillHoleItem> items;
155 int numTris = 0; // the number of triangles in the filling
156};
157
160MRMESH_API HoleFillPlan getHoleFillPlan( const Mesh& mesh, EdgeId e, const FillHoleParams& params = {} );
161
165
167MRMESH_API void executeHoleFillPlan( Mesh & mesh, EdgeId a0, HoleFillPlan & plan, FaceBitSet * outNewFaces = nullptr );
168
190MRMESH_API VertId fillHoleTrivially( Mesh& mesh, EdgeId a, FaceBitSet * outNewFaces = nullptr );
191
195MRMESH_API EdgeId extendHole( Mesh& mesh, EdgeId a, const Plane3f & plane, FaceBitSet * outNewFaces = nullptr );
196
199MRMESH_API std::vector<EdgeId> extendAllHoles( Mesh& mesh, const Plane3f & plane, FaceBitSet * outNewFaces = nullptr );
200
204MRMESH_API EdgeId extendHole( Mesh& mesh, EdgeId a, std::function<Vector3f(const Vector3f &)> getVertPos, FaceBitSet * outNewFaces = nullptr );
205
209MRMESH_API EdgeId buildBottom( Mesh& mesh, EdgeId a, Vector3f dir, float holeExtension, FaceBitSet* outNewFaces = nullptr );
210
214
218MRMESH_API bool makeBridge( MeshTopology & topology, EdgeId a, EdgeId b, FaceBitSet * outNewFaces = nullptr );
219
223
225
226} // namespace MR
int VertId
Definition MRDotNet/MRMeshFwd.h:51
int EdgeId
Definition MRDotNet/MRMeshFwd.h:52
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRDotNet/MRBitSet.h:39
Definition MRMesh/MRMeshTopology.h:18
represents a 3-dimentional float-typed vector
Definition MRDotNet/MRVector3.h:8
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 EdgeId extendHole(Mesh &mesh, EdgeId a, const Plane3f &plane, FaceBitSet *outNewFaces=nullptr)
MRMESH_API bool makeBridge(MeshTopology &topology, EdgeId a, EdgeId b, 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 .
Definition MRCameraOrientationPlugin.h:7
std::vector< EdgeId > EdgeLoop
Definition MRMesh/MRMeshFwd.h:99
Vector3< float > Vector3f
Definition MRDotNet/MRMeshFwd.h:8
Definition MRMesh/MRMeshFillHole.h:145
int edgeCode2
Definition MRMesh/MRMeshFillHole.h:148
int edgeCode1
Definition MRMesh/MRMeshFillHole.h:148
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:32
enum MR::FillHoleParams::MultipleEdgesResolveMode Simple
int maxPolygonSubdivisions
Definition MRMesh/MRMeshFillHole.h:56
bool makeDegenerateBand
Definition MRMesh/MRMeshFillHole.h:51
bool * stopBeforeBadTriangulation
Definition MRMesh/MRMeshFillHole.h:63
FillHoleMetric metric
Definition MRMesh/MRMeshFillHole.h:30
MultipleEdgesResolveMode
Definition MRMesh/MRMeshFillHole.h:42
concise representation of proposed hole triangulation
Definition MRMesh/MRMeshFillHole.h:153
int numTris
Definition MRMesh/MRMeshFillHole.h:155
std::vector< FillHoleItem > items
Definition MRMesh/MRMeshFillHole.h:154
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:81
FillHoleMetric metric
Definition MRMesh/MRMeshFillHole.h:79