MeshLib Documentation
Loading...
Searching...
No Matches
MRMesh/MRMeshFixer.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRId.h"
5#include <cfloat>
6#include "MRExpected.h"
7#include <string>
8
9namespace MR
10{
11
15
18
22[[nodiscard]] inline bool hasMultipleEdges( const MeshTopology & topology ) { return !findMultipleEdges( topology ).value().empty(); }
23
25MRMESH_API void fixMultipleEdges( Mesh & mesh, const std::vector<MultipleEdge> & multipleEdges );
28
30[[nodiscard]] MRMESH_API Expected<FaceBitSet> findDegenerateFaces( const MeshPart& mp, float criticalAspectRatio = FLT_MAX, ProgressCallback cb = {} );
31
33[[nodiscard]] MRMESH_API Expected<UndirectedEdgeBitSet> findShortEdges( const MeshPart& mp, float criticalLength, ProgressCallback cb = {} );
34
36[[nodiscard]] MRMESH_API VertBitSet findNRingVerts( const MeshTopology& topology, int n, const VertBitSet* region = nullptr );
37
39[[nodiscard]] MRMESH_API bool isEdgeBetweenDoubleTris( const MeshTopology& topology, EdgeId e );
40
45MRMESH_API EdgeId eliminateDoubleTris( MeshTopology& topology, EdgeId e, FaceBitSet * region = nullptr );
46
49MRMESH_API void eliminateDoubleTrisAround( MeshTopology & topology, VertId v, FaceBitSet * region = nullptr );
50
52[[nodiscard]] MRMESH_API bool isDegree3Dest( const MeshTopology& topology, EdgeId e );
53
58MRMESH_API EdgeId eliminateDegree3Dest( MeshTopology& topology, EdgeId e, FaceBitSet * region = nullptr );
59
63MRMESH_API int eliminateDegree3Vertices( MeshTopology& topology, VertBitSet & region, FaceBitSet * fs = nullptr );
64
67[[nodiscard]] MRMESH_API EdgeId isVertexRepeatedOnHoleBd( const MeshTopology& topology, VertId v );
68
70[[nodiscard]] MRMESH_API VertBitSet findRepeatedVertsOnHoleBd( const MeshTopology& topology );
71
75[[nodiscard]] MRMESH_API FaceBitSet findHoleComplicatingFaces( const Mesh & mesh );
76
78
79} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRMesh/MRMeshTopology.h:18
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:576
MRMESH_API int duplicateMultiHoleVertices(Mesh &mesh)
Duplicates all vertices having more than two boundary edges (and returns the number of duplications);...
bool hasMultipleEdges(const MeshTopology &topology)
Definition MRMesh/MRMeshFixer.h:22
MRMESH_API Expected< FaceBitSet > findDegenerateFaces(const MeshPart &mp, float criticalAspectRatio=FLT_MAX, ProgressCallback cb={})
finds faces having aspect ratio >= criticalAspectRatio
MRMESH_API VertBitSet findNRingVerts(const MeshTopology &topology, int n, const VertBitSet *region=nullptr)
finds vertices in region with complete ring of N edges
MRMESH_API FaceBitSet findHoleComplicatingFaces(const Mesh &mesh)
MRMESH_API bool isDegree3Dest(const MeshTopology &topology, EdgeId e)
returns true if the destination of given edge has degree 3 and 3 incident triangles
MRMESH_API bool isEdgeBetweenDoubleTris(const MeshTopology &topology, EdgeId e)
returns true if the edge e has both left and right triangular faces and the degree of dest( e ) is 2
MRMESH_API int eliminateDegree3Vertices(MeshTopology &topology, VertBitSet &region, FaceBitSet *fs=nullptr)
MRMESH_API VertBitSet findRepeatedVertsOnHoleBd(const MeshTopology &topology)
returns set bits for all vertices present on the boundary of a hole several times;
MRMESH_API EdgeId isVertexRepeatedOnHoleBd(const MeshTopology &topology, VertId v)
MRMESH_API EdgeId eliminateDoubleTris(MeshTopology &topology, EdgeId e, FaceBitSet *region=nullptr)
VertPair MultipleEdge
finds multiple edges in the mesh
Definition MRMesh/MRMeshFixer.h:20
MRMESH_API EdgeId eliminateDegree3Dest(MeshTopology &topology, EdgeId e, FaceBitSet *region=nullptr)
MRMESH_API Expected< std::vector< MultipleEdge > > findMultipleEdges(const MeshTopology &topology, ProgressCallback cb={})
MRMESH_API Expected< UndirectedEdgeBitSet > findShortEdges(const MeshPart &mp, float criticalLength, ProgressCallback cb={})
finds edges having length <= criticalLength
MRMESH_API void fixMultipleEdges(Mesh &mesh, const std::vector< MultipleEdge > &multipleEdges)
resolves given multiple edges, but splitting all but one edge in each group
MRMESH_API void eliminateDoubleTrisAround(MeshTopology &topology, VertId v, FaceBitSet *region=nullptr)
Definition MRCameraOrientationPlugin.h:8
tl::expected< T, E > Expected
Definition MRExpected.h:58
std::pair< VertId, VertId > VertPair
Definition MRMesh/MRMeshFwd.h:359
Definition MRMesh/MRMesh.h:23