Hide "remove_degenerate_faces"

This commit is contained in:
Mael Rouxel-Labbé 2018-07-25 10:51:53 +02:00
parent 5b22f7213e
commit 0417bb88d7
9 changed files with 42 additions and 117 deletions

View File

@ -134,7 +134,6 @@ and provides a list of the parameters that are used in this package.
- `CGAL::Polygon_mesh_processing::remove_isolated_vertices()` - `CGAL::Polygon_mesh_processing::remove_isolated_vertices()`
- `CGAL::Polygon_mesh_processing::is_non_manifold_vertex()` - `CGAL::Polygon_mesh_processing::is_non_manifold_vertex()`
- `CGAL::Polygon_mesh_processing::duplicate_non_manifold_vertices()` - `CGAL::Polygon_mesh_processing::duplicate_non_manifold_vertices()`
- `CGAL::Polygon_mesh_processing::remove_degenerate_faces()`
- `CGAL::Polygon_mesh_processing::merge_vertices_in_range()` - `CGAL::Polygon_mesh_processing::merge_vertices_in_range()`
- `CGAL::Polygon_mesh_processing::merge_duplicated_vertices_in_boundary_cycle()` - `CGAL::Polygon_mesh_processing::merge_duplicated_vertices_in_boundary_cycle()`
- `CGAL::Polygon_mesh_processing::merge_duplicated_vertices_in_boundary_cycles()` - `CGAL::Polygon_mesh_processing::merge_duplicated_vertices_in_boundary_cycles()`

View File

@ -463,8 +463,6 @@ This package offers a toolkit of functions to detect such undesirable elements.
- `CGAL::Polygon_mesh_processing::is_cap_triangle_face()` - `CGAL::Polygon_mesh_processing::is_cap_triangle_face()`
- `CGAL::Polygon_mesh_processing::is_needle_triangle_face()` - `CGAL::Polygon_mesh_processing::is_needle_triangle_face()`
This package offers functions to remove such undesirable elements, see Section \ref PMPRepairing.
**************************************** ****************************************
\section PMPOrientation Orientation \section PMPOrientation Orientation
@ -555,6 +553,8 @@ with duplicated border edges.
\cgalExample{Polygon_mesh_processing/stitch_borders_example.cpp} \cgalExample{Polygon_mesh_processing/stitch_borders_example.cpp}
\cond
\subsection DegenerateFaces Removing Degenerate Faces \subsection DegenerateFaces Removing Degenerate Faces
Some degenerate faces may be part of a given triangle mesh. Some degenerate faces may be part of a given triangle mesh.
@ -573,6 +573,8 @@ is output.
\cgalExample{Polygon_mesh_processing/remove_degeneracies_example.cpp} \cgalExample{Polygon_mesh_processing/remove_degeneracies_example.cpp}
\endcond
\subsection PMPManifoldness Polygon Mesh Manifoldness \subsection PMPManifoldness Polygon Mesh Manifoldness
Non-manifold vertices can be detected using the function `CGAL::Polygon_mesh_processing::is_non_manifold_vertex()`. Non-manifold vertices can be detected using the function `CGAL::Polygon_mesh_processing::is_non_manifold_vertex()`.

View File

@ -21,7 +21,5 @@
\example Polygon_mesh_processing/corefinement_mesh_union_and_intersection.cpp \example Polygon_mesh_processing/corefinement_mesh_union_and_intersection.cpp
\example Polygon_mesh_processing/corefinement_consecutive_bool_op.cpp \example Polygon_mesh_processing/corefinement_consecutive_bool_op.cpp
\example Polygon_mesh_processing/detect_features_example.cpp \example Polygon_mesh_processing/detect_features_example.cpp
\example Polygon_mesh_processing/remove_degeneracies_example.cpp
\example Polygon_mesh_processing/remove_degeneracies_example_OM.cpp
\example Polygon_mesh_processing/manifoldness_repair_example.cpp \example Polygon_mesh_processing/manifoldness_repair_example.cpp
*/ */

View File

@ -89,7 +89,7 @@ create_single_source_cgal_program( "face_filtered_graph_example.cpp")
create_single_source_cgal_program( "orient_polygon_soup_example.cpp") create_single_source_cgal_program( "orient_polygon_soup_example.cpp")
create_single_source_cgal_program( "triangulate_polyline_example.cpp") create_single_source_cgal_program( "triangulate_polyline_example.cpp")
create_single_source_cgal_program( "mesh_slicer_example.cpp") create_single_source_cgal_program( "mesh_slicer_example.cpp")
create_single_source_cgal_program( "remove_degeneracies_example.cpp") #create_single_source_cgal_program( "remove_degeneracies_example.cpp")
create_single_source_cgal_program( "isotropic_remeshing_example.cpp") create_single_source_cgal_program( "isotropic_remeshing_example.cpp")
create_single_source_cgal_program( "isotropic_remeshing_of_patch_example.cpp") create_single_source_cgal_program( "isotropic_remeshing_of_patch_example.cpp")
create_single_source_cgal_program( "surface_mesh_intersection.cpp") create_single_source_cgal_program( "surface_mesh_intersection.cpp")
@ -119,8 +119,8 @@ target_link_libraries( point_inside_example_OM PRIVATE ${OPENMESH_LIBRARIES} )
create_single_source_cgal_program( "stitch_borders_example_OM.cpp" ) create_single_source_cgal_program( "stitch_borders_example_OM.cpp" )
target_link_libraries( stitch_borders_example_OM PRIVATE ${OPENMESH_LIBRARIES} ) target_link_libraries( stitch_borders_example_OM PRIVATE ${OPENMESH_LIBRARIES} )
create_single_source_cgal_program( "remove_degeneracies_example_OM.cpp") #create_single_source_cgal_program( "remove_degeneracies_example_OM.cpp")
target_link_libraries( remove_degeneracies_example_OM PRIVATE ${OPENMESH_LIBRARIES} ) #target_link_libraries( remove_degeneracies_example_OM PRIVATE ${OPENMESH_LIBRARIES} )
create_single_source_cgal_program( "triangulate_faces_example_OM.cpp") create_single_source_cgal_program( "triangulate_faces_example_OM.cpp")
target_link_libraries( triangulate_faces_example_OM PRIVATE ${OPENMESH_LIBRARIES} ) target_link_libraries( triangulate_faces_example_OM PRIVATE ${OPENMESH_LIBRARIES} )

View File

@ -1,34 +0,0 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Polygon_mesh_processing/repair.h>
#include <iostream>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Surface_mesh<K::Point_3> Surface_mesh;
int main(int argc, char* argv[])
{
const char* filename = (argc > 1) ? argv[1] : "data/degtri_sliding.off";
std::ifstream input(filename);
Surface_mesh mesh;
if (!input || !(input >> mesh) || mesh.is_empty()) {
std::cerr << "Not a valid .off file." << std::endl;
return EXIT_FAILURE;
}
std::size_t nb = CGAL::Polygon_mesh_processing::remove_degenerate_faces(mesh);
std::cout << "There were " << nb << " degenerate faces in this mesh" << std::endl;
mesh.collect_garbage();
std::ofstream out("repaired.off");
out << mesh;
return EXIT_SUCCESS;
}

View File

@ -1,38 +0,0 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <OpenMesh/Core/IO/MeshIO.hh>
#include <OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh>
#include <CGAL/boost/graph/graph_traits_PolyMesh_ArrayKernelT.h>
#include <CGAL/Polygon_mesh_processing/repair.h>
#include <iostream>
#include <fstream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef OpenMesh::PolyMesh_ArrayKernelT< > Mesh;
namespace PMP = CGAL::Polygon_mesh_processing;
int main(int argc, char* argv[])
{
const char* filename = (argc > 1) ? argv[1] : "data/degtri_sliding.off";
Mesh mesh;
if (!OpenMesh::IO::read_mesh(mesh, filename) || num_vertices(mesh)) {
std::cerr << "Not a valid .off file." << std::endl;
return EXIT_FAILURE;
}
std::size_t nb = PMP::remove_degenerate_faces(mesh,
CGAL::parameters::vertex_point_map(get(CGAL::vertex_point, mesh))
.geom_traits(K()));
std::cout << "There were " << nb << " degenerate faces in this mesh" << std::endl;
mesh.garbage_collection();
OpenMesh::IO::write_mesh(mesh, "repaired.off");
return EXIT_SUCCESS;
}

View File

@ -271,7 +271,6 @@ degenerate_edges(const TriangleMesh& tm, OutputIterator out)
/// \cgalParamEnd /// \cgalParamEnd
/// \cgalNamedParamsEnd /// \cgalNamedParamsEnd
/// ///
/// \sa remove_degenerate_faces()
template <class FaceRange, class TriangleMesh, class OutputIterator, class NamedParameters> template <class FaceRange, class TriangleMesh, class OutputIterator, class NamedParameters>
OutputIterator degenerate_faces(const FaceRange& faces, OutputIterator degenerate_faces(const FaceRange& faces,
const TriangleMesh& tm, const TriangleMesh& tm,
@ -792,40 +791,40 @@ std::size_t remove_degenerate_edges(const EdgeRange& edge_range,
return remove_degenerate_edges(edge_range, tmesh, parameters::all_default()); return remove_degenerate_edges(edge_range, tmesh, parameters::all_default());
} }
/// \ingroup PMP_repairing_grp // \ingroup PMP_repairing_grp
/// removes the degenerate faces from a triangulated surface mesh. // removes the degenerate faces from a triangulated surface mesh.
/// A face is considered degenerate if two of its vertices share the same location, // A face is considered degenerate if two of its vertices share the same location,
/// or more generally if all its vertices are collinear. // or more generally if all its vertices are collinear.
/// //
/// @pre `CGAL::is_triangle_mesh(tmesh)` // @pre `CGAL::is_triangle_mesh(tmesh)`
/// //
/// @tparam TriangleMesh a model of `FaceListGraph` and `MutableFaceGraph` // @tparam TriangleMesh a model of `FaceListGraph` and `MutableFaceGraph`
/// @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" // @tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters"
/// //
/// @param tmesh the triangulated surface mesh to be repaired // @param tmesh the triangulated surface mesh to be repaired
/// @param np optional \ref pmp_namedparameters "Named Parameters" described below // @param np optional \ref pmp_namedparameters "Named Parameters" described below
/// //
/// \cgalNamedParamsBegin // \cgalNamedParamsBegin
/// \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`. // \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`.
/// The type of this map is model of `ReadWritePropertyMap`. // The type of this map is model of `ReadWritePropertyMap`.
/// If this parameter is omitted, an internal property map for // If this parameter is omitted, an internal property map for
/// `CGAL::vertex_point_t` must be available in `TriangleMesh` // `CGAL::vertex_point_t` must be available in `TriangleMesh`
/// \cgalParamEnd // \cgalParamEnd
/// \cgalParamBegin{geom_traits} a geometric traits class instance. // \cgalParamBegin{geom_traits} a geometric traits class instance.
/// The traits class must provide the nested type `Point_3`, // The traits class must provide the nested type `Point_3`,
/// and the nested functors : // and the nested functors :
/// - `Compare_distance_3` to compute the distance between 2 points // - `Compare_distance_3` to compute the distance between 2 points
/// - `Collinear_3` to check whether 3 points are collinear // - `Collinear_3` to check whether 3 points are collinear
/// - `Less_xyz_3` to compare lexicographically two points // - `Less_xyz_3` to compare lexicographically two points
/// - `Equal_3` to check whether 2 points are identical // - `Equal_3` to check whether 2 points are identical
/// For each functor `Foo`, a function `Foo foo_object()` // For each functor `Foo`, a function `Foo foo_object()`
/// \cgalParamEnd // \cgalParamEnd
/// \cgalNamedParamsEnd // \cgalNamedParamsEnd
/// //
/// \todo the function might not be able to remove all degenerate faces. // \todo the function might not be able to remove all degenerate faces.
/// We should probably do something with the return type. // We should probably do something with the return type.
/// //
/// \return number of removed degenerate faces // \return number of removed degenerate faces
template <class TriangleMesh, class NamedParameters> template <class TriangleMesh, class NamedParameters>
std::size_t remove_degenerate_faces(TriangleMesh& tmesh, std::size_t remove_degenerate_faces(TriangleMesh& tmesh,
const NamedParameters& np) const NamedParameters& np)

View File

@ -117,7 +117,6 @@ bool is_degenerate_edge(typename boost::graph_traits<PolygonMesh>::edge_descript
/// \cgalNamedParamsEnd /// \cgalNamedParamsEnd
/// ///
/// \sa `degenerate_faces()` /// \sa `degenerate_faces()`
/// \sa `remove_degenerate_faces()`
/// ///
/// \return `true` if the face `f` is degenerate, `false` otherwise. /// \return `true` if the face `f` is degenerate, `false` otherwise.
template <typename TriangleMesh, typename NamedParameters> template <typename TriangleMesh, typename NamedParameters>

View File

@ -54,7 +54,7 @@ public:
actionAutorefine->setObjectName("actionAutorefine"); actionAutorefine->setObjectName("actionAutorefine");
actionAutorefineAndRMSelfIntersections->setObjectName("actionAutorefineAndRMSelfIntersections"); actionAutorefineAndRMSelfIntersections->setObjectName("actionAutorefineAndRMSelfIntersections");
actionRemoveDegenerateFaces->setProperty("subMenuName", "Polygon Mesh Processing/Repair"); actionRemoveDegenerateFaces->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental");
actionStitchCloseBorderHalfedges->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); actionStitchCloseBorderHalfedges->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental");
actionRemoveSelfIntersections->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental"); actionRemoveSelfIntersections->setProperty("subMenuName", "Polygon Mesh Processing/Repair/Experimental");
actionRemoveIsolatedVertices->setProperty("subMenuName", "Polygon Mesh Processing/Repair"); actionRemoveIsolatedVertices->setProperty("subMenuName", "Polygon Mesh Processing/Repair");