Added some basic holefiller doc

This commit is contained in:
Jan Möbius
2024-02-21 10:53:01 +01:00
parent 7820ccd258
commit fa465cb05e
5 changed files with 41 additions and 19 deletions

21
Doc/holefiller.docu Normal file
View File

@@ -0,0 +1,21 @@
//-----------------------------------------------------------------------------
/** \page holefiller_docu Mesh Hole Filler
\section HoleFillerAlgo The holefilling algorithm
The holefiller (OpenMesh::HoleFiller::HoleFillerT) provides a
hole filling algorith based on the Filling Holes in Meshes paper
by Liepa in 2003.
\code
// Initialize holefiller
OpenMesh::HoleFiller::HoleFillerT<Mesh> filler(mesh_);
// Execute the algorithm and fill all holes
filler.fill_all_holes();
\endcode
*/

View File

@@ -6,6 +6,7 @@
\li \subpage subdivider_docu \li \subpage subdivider_docu
\li \subpage vdpm_docu \li \subpage vdpm_docu
\li \subpage smoother_docu \li \subpage smoother_docu
\li \subpage holefiller_docu
\li \subpage smarttagger_docu \li \subpage smarttagger_docu
\li Miscellaneous \li Miscellaneous
OpenMesh::StripifierT OpenMesh::StripifierT

View File

@@ -50,7 +50,7 @@ namespace OpenMesh {
namespace HoleFiller { namespace HoleFiller {
template< class MeshT > template< class MeshT >
class HoleFiller class HoleFillerT
{ {
typedef typename MeshT::Point Point; typedef typename MeshT::Point Point;
typedef typename MeshT::Scalar Scalar; typedef typename MeshT::Scalar Scalar;
@@ -58,8 +58,8 @@ class HoleFiller
public: public:
// Ctors // Ctors
explicit HoleFiller( MeshT & _mesh ); explicit HoleFillerT( MeshT & _mesh );
~HoleFiller(); ~HoleFillerT();
/** Identify and fill all holes of the mesh. /** Identify and fill all holes of the mesh.
* *

View File

@@ -53,7 +53,7 @@ namespace OpenMesh {
namespace HoleFiller { namespace HoleFiller {
template< class MeshT > template< class MeshT >
HoleFiller< MeshT >::HoleFiller(MeshT &_mesh ) HoleFillerT< MeshT >::HoleFillerT(MeshT &_mesh )
: mesh_( _mesh ) : mesh_( _mesh )
{ {
mesh_.request_vertex_status(); mesh_.request_vertex_status();
@@ -69,7 +69,7 @@ HoleFiller< MeshT >::HoleFiller(MeshT &_mesh )
template< class MeshT > template< class MeshT >
HoleFiller< MeshT >::~HoleFiller() HoleFillerT< MeshT >::~HoleFillerT()
{ {
mesh_.release_vertex_status(); mesh_.release_vertex_status();
mesh_.release_edge_status(); mesh_.release_edge_status();
@@ -88,7 +88,7 @@ HoleFiller< MeshT >::~HoleFiller()
template< class MeshT > template< class MeshT >
void void
HoleFiller< MeshT >::fill_all_holes( int _stages ) HoleFillerT< MeshT >::fill_all_holes( int _stages )
{ {
@@ -134,7 +134,7 @@ HoleFiller< MeshT >::fill_all_holes( int _stages )
template< class MeshT > template< class MeshT >
void void
HoleFiller< MeshT >::fill_hole(typename MeshT::EdgeHandle _eh, int _stages ) HoleFillerT< MeshT >::fill_hole(typename MeshT::EdgeHandle _eh, int _stages )
{ {
omlog() << " Stage 1 : Computing a minimal triangulation ... "; omlog() << " Stage 1 : Computing a minimal triangulation ... ";
@@ -248,7 +248,7 @@ HoleFiller< MeshT >::fill_hole(typename MeshT::EdgeHandle _eh, int _stages )
/// path fairing /// path fairing
template< class MeshT > template< class MeshT >
void void
HoleFiller< MeshT >::fairing( std::vector< OpenMesh::SmartFaceHandle >& _faceHandles ){ HoleFillerT< MeshT >::fairing( std::vector< OpenMesh::SmartFaceHandle >& _faceHandles ){
//generate vector of all edges //generate vector of all edges
hole_edge_.clear(); hole_edge_.clear();
@@ -374,7 +374,7 @@ HoleFiller< MeshT >::fairing( std::vector< OpenMesh::SmartFaceHandle >& _faceHan
template< class MeshT > template< class MeshT >
bool bool
HoleFiller< MeshT >::refine(typename MeshT::FaceHandle _fh ) HoleFillerT< MeshT >::refine(typename MeshT::FaceHandle _fh )
{ {
// Collect the three edges of the face into e0, e1, e2 // Collect the three edges of the face into e0, e1, e2
@@ -462,7 +462,7 @@ HoleFiller< MeshT >::refine(typename MeshT::FaceHandle _fh )
template< class MeshT > template< class MeshT >
bool bool
HoleFiller< MeshT >::relax_edge( OpenMesh::SmartEdgeHandle _eh ) HoleFillerT< MeshT >::relax_edge( OpenMesh::SmartEdgeHandle _eh )
{ {
if ( mesh_.status( _eh ).locked() ) if ( mesh_.status( _eh ).locked() )
return false; return false;
@@ -508,7 +508,7 @@ HoleFiller< MeshT >::relax_edge( OpenMesh::SmartEdgeHandle _eh )
template< class MeshT > template< class MeshT >
bool bool
HoleFiller< MeshT >::in_circumsphere( const Point & _x, HoleFillerT< MeshT >::in_circumsphere( const Point & _x,
const Point & _a, const Point & _a,
const Point & _b, const Point & _b,
const Point & _c ) const const Point & _c ) const
@@ -550,7 +550,7 @@ HoleFiller< MeshT >::in_circumsphere( const Point & _x,
template< class MeshT > template< class MeshT >
bool bool
HoleFiller< MeshT >::fill( int _i, int _j ) HoleFillerT< MeshT >::fill( int _i, int _j )
{ {
// If the two vertices _i and _j are adjacent, there is nothing to do. // If the two vertices _i and _j are adjacent, there is nothing to do.
@@ -595,8 +595,8 @@ HoleFiller< MeshT >::fill( int _i, int _j )
template< class MeshT > template< class MeshT >
typename HoleFiller< MeshT >::Weight typename HoleFillerT< MeshT >::Weight
HoleFiller< MeshT >::weight( int _i, int _j, int _k ) HoleFillerT< MeshT >::weight( int _i, int _j, int _k )
{ {
// Return an infinite weight if the insertion of this triangle // Return an infinite weight if the insertion of this triangle
// would create complex edges. // would create complex edges.
@@ -665,7 +665,7 @@ HoleFiller< MeshT >::weight( int _i, int _j, int _k )
template< class MeshT > template< class MeshT >
bool bool
HoleFiller< MeshT >::exists_edge( OpenMesh::SmartVertexHandle _u, typename MeshT::VertexHandle _w ) HoleFillerT< MeshT >::exists_edge( OpenMesh::SmartVertexHandle _u, typename MeshT::VertexHandle _w )
{ {
for ( auto vohi : _u.outgoing_halfedges() ) for ( auto vohi : _u.outgoing_halfedges() )
if ( ! vohi.edge().is_boundary() ) if ( ! vohi.edge().is_boundary() )
@@ -686,7 +686,7 @@ HoleFiller< MeshT >::exists_edge( OpenMesh::SmartVertexHandle _u, typename MeshT
template< class MeshT > template< class MeshT >
typename MeshT::Scalar typename MeshT::Scalar
HoleFiller< MeshT >::area( typename MeshT::VertexHandle _a, typename MeshT::VertexHandle _b, typename MeshT::VertexHandle _c ) HoleFillerT< MeshT >::area( typename MeshT::VertexHandle _a, typename MeshT::VertexHandle _b, typename MeshT::VertexHandle _c )
{ {
Point a( mesh_.point( _a ) ); Point a( mesh_.point( _a ) );
Point b( mesh_.point( _b ) ); Point b( mesh_.point( _b ) );
@@ -711,7 +711,7 @@ HoleFiller< MeshT >::area( typename MeshT::VertexHandle _a, typename MeshT::Vert
template< class MeshT > template< class MeshT >
typename MeshT::Scalar typename MeshT::Scalar
HoleFiller< MeshT >::dihedral_angle( typename MeshT::VertexHandle _u, typename MeshT::VertexHandle _v, typename MeshT::VertexHandle _a, typename MeshT::VertexHandle _b ) HoleFillerT< MeshT >::dihedral_angle( typename MeshT::VertexHandle _u, typename MeshT::VertexHandle _v, typename MeshT::VertexHandle _a, typename MeshT::VertexHandle _b )
{ {
Point u( mesh_.point( _u ) ); Point u( mesh_.point( _u ) );
Point v( mesh_.point( _v ) ); Point v( mesh_.point( _v ) );
@@ -731,7 +731,7 @@ HoleFiller< MeshT >::dihedral_angle( typename MeshT::VertexHandle _u, typename M
/// remove degenerated faces /// remove degenerated faces
template< class MeshT > template< class MeshT >
void void
HoleFiller< MeshT >::removeDegeneratedFaces( std::vector< typename MeshT::FaceHandle >& _faceHandles ){ HoleFillerT< MeshT >::removeDegeneratedFaces( std::vector< typename MeshT::FaceHandle >& _faceHandles ){
for (int i = _faceHandles.size()-1; i >= 0 ; i--){ for (int i = _faceHandles.size()-1; i >= 0 ; i--){

View File

@@ -48,7 +48,7 @@ TEST_F(OpenMeshHoleFiller_Triangle,Triangle_Hole_Filling) {
// Initialize subdivider // Initialize subdivider
OpenMesh::HoleFiller::HoleFiller<Mesh> filler(mesh_); OpenMesh::HoleFiller::HoleFillerT<Mesh> filler(mesh_);
// Execute the algorithm // Execute the algorithm