MeshLib
 
Loading...
Searching...
No Matches
Mesh Fixer

Typedefs

using MR::MultipleEdge = VertPair
 finds multiple edges in the mesh
 

Functions

MRMESH_API int MR::duplicateMultiHoleVertices (Mesh &mesh)
 Duplicates all vertices having more than two boundary edges (and returns the number of duplications);.
 
MRMESH_API Expected< std::vector< MultipleEdge > > MR::findMultipleEdges (const MeshTopology &topology, ProgressCallback cb={})
 
bool MR::hasMultipleEdges (const MeshTopology &topology)
 
MRMESH_API void MR::fixMultipleEdges (Mesh &mesh, const std::vector< MultipleEdge > &multipleEdges)
 resolves given multiple edges, but splitting all but one edge in each group
 
MRMESH_API void MR::fixMultipleEdges (Mesh &mesh)
 finds and resolves multiple edges
 
MRMESH_API Expected< FaceBitSetMR::findDegenerateFaces (const MeshPart &mp, float criticalAspectRatio=FLT_MAX, ProgressCallback cb={})
 finds faces having aspect ratio >= criticalAspectRatio
 
MRMESH_API Expected< UndirectedEdgeBitSet > MR::findShortEdges (const MeshPart &mp, float criticalLength, ProgressCallback cb={})
 finds edges having length <= criticalLength
 
MRMESH_API VertBitSet MR::findNRingVerts (const MeshTopology &topology, int n, const VertBitSet *region=nullptr)
 finds vertices in region with complete ring of N edges
 
MRMESH_API bool MR::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 EdgeId MR::eliminateDoubleTris (MeshTopology &topology, EdgeId e, FaceBitSet *region=nullptr)
 
MRMESH_API void MR::eliminateDoubleTrisAround (MeshTopology &topology, VertId v, FaceBitSet *region=nullptr)
 
MRMESH_API bool MR::isDegree3Dest (const MeshTopology &topology, EdgeId e)
 returns true if the destination of given edge has degree 3 and 3 incident triangles
 
MRMESH_API EdgeId MR::eliminateDegree3Dest (MeshTopology &topology, EdgeId e, FaceBitSet *region=nullptr)
 
MRMESH_API int MR::eliminateDegree3Vertices (MeshTopology &topology, VertBitSet &region, FaceBitSet *fs=nullptr)
 
MRMESH_API EdgeId MR::isVertexRepeatedOnHoleBd (const MeshTopology &topology, VertId v)
 
MRMESH_API VertBitSet MR::findRepeatedVertsOnHoleBd (const MeshTopology &topology)
 returns set bits for all vertices present on the boundary of a hole several times;
 
MRMESH_API FaceBitSet MR::findHoleComplicatingFaces (const Mesh &mesh)
 

Detailed Description

Typedef Documentation

◆ MultipleEdge

finds multiple edges in the mesh

Function Documentation

◆ duplicateMultiHoleVertices()

MRMESH_API int MR::duplicateMultiHoleVertices ( Mesh & mesh)

Duplicates all vertices having more than two boundary edges (and returns the number of duplications);.

◆ eliminateDegree3Dest()

MRMESH_API EdgeId MR::eliminateDegree3Dest ( MeshTopology & topology,
EdgeId e,
FaceBitSet * region = nullptr )

if the destination of given edge has degree 3 and 3 incident triangles, then eliminates the destination vertex with all its edges and all but one faces, and returns valid remaining edge with same origin as e; if region is provided then eliminated triangles are excluded from it; otherwise returns invalid edge

◆ eliminateDegree3Vertices()

MRMESH_API int MR::eliminateDegree3Vertices ( MeshTopology & topology,
VertBitSet & region,
FaceBitSet * fs = nullptr )

eliminates from the mesh all vertices having degree 3 and 3 incident triangles from given region (which is updated); if

Parameters
fsis provided then eliminated triangles are excluded from it;
Returns
the number of vertices eliminated

◆ eliminateDoubleTris()

MRMESH_API EdgeId MR::eliminateDoubleTris ( MeshTopology & topology,
EdgeId e,
FaceBitSet * region = nullptr )

if the edge e has both left and right triangular faces and the degree of dest( e ) is 2, then eliminates left( e ), right( e ), e, e.sym(), next( e ), dest( e ), and returns prev( e ); if region is provided then eliminated faces are excluded from it; otherwise returns invalid edge

◆ eliminateDoubleTrisAround()

MRMESH_API void MR::eliminateDoubleTrisAround ( MeshTopology & topology,
VertId v,
FaceBitSet * region = nullptr )

eliminates all double triangles around given vertex preserving vertex valid; if region is provided then eliminated triangles are excluded from it

◆ findDegenerateFaces()

MRMESH_API Expected< FaceBitSet > MR::findDegenerateFaces ( const MeshPart & mp,
float criticalAspectRatio = FLT_MAX,
ProgressCallback cb = {} )
nodiscard

finds faces having aspect ratio >= criticalAspectRatio

◆ findHoleComplicatingFaces()

MRMESH_API FaceBitSet MR::findHoleComplicatingFaces ( const Mesh & mesh)
nodiscard

returns all faces that complicate one of mesh holes; hole is complicated if it passes via one vertex more than once; deleting such faces simplifies the holes and makes them easier to fill

◆ findMultipleEdges()

MRMESH_API Expected< std::vector< MultipleEdge > > MR::findMultipleEdges ( const MeshTopology & topology,
ProgressCallback cb = {} )
nodiscard

◆ findNRingVerts()

MRMESH_API VertBitSet MR::findNRingVerts ( const MeshTopology & topology,
int n,
const VertBitSet * region = nullptr )
nodiscard

finds vertices in region with complete ring of N edges

◆ findRepeatedVertsOnHoleBd()

MRMESH_API VertBitSet MR::findRepeatedVertsOnHoleBd ( const MeshTopology & topology)
nodiscard

returns set bits for all vertices present on the boundary of a hole several times;

◆ findShortEdges()

MRMESH_API Expected< UndirectedEdgeBitSet > MR::findShortEdges ( const MeshPart & mp,
float criticalLength,
ProgressCallback cb = {} )
nodiscard

finds edges having length <= criticalLength

◆ fixMultipleEdges() [1/2]

MRMESH_API void MR::fixMultipleEdges ( Mesh & mesh)

finds and resolves multiple edges

◆ fixMultipleEdges() [2/2]

MRMESH_API void MR::fixMultipleEdges ( Mesh & mesh,
const std::vector< MultipleEdge > & multipleEdges )

resolves given multiple edges, but splitting all but one edge in each group

◆ hasMultipleEdges()

bool MR::hasMultipleEdges ( const MeshTopology & topology)
inlinenodiscard

◆ isDegree3Dest()

MRMESH_API bool MR::isDegree3Dest ( const MeshTopology & topology,
EdgeId e )
nodiscard

returns true if the destination of given edge has degree 3 and 3 incident triangles

◆ isEdgeBetweenDoubleTris()

MRMESH_API bool MR::isEdgeBetweenDoubleTris ( const MeshTopology & topology,
EdgeId e )
nodiscard

returns true if the edge e has both left and right triangular faces and the degree of dest( e ) is 2

◆ isVertexRepeatedOnHoleBd()

MRMESH_API EdgeId MR::isVertexRepeatedOnHoleBd ( const MeshTopology & topology,
VertId v )
nodiscard

if given vertex is present on the boundary of some hole several times then returns an edge of this hole (without left); returns invalid edge otherwise (not a boundary vertex, or it is present only once on the boundary of each hole it pertains to)