mirror of https://github.com/CGAL/cgal
mostly docs and examples, moved utils to internal
This commit is contained in:
parent
a1e9345a1e
commit
4f76f267d5
|
|
@ -201,14 +201,6 @@ The page \ref bgl_namedparameters "Named Parameters" describes their usage.
|
|||
- \link PMP_locate_grp Random Location Generation \endlink
|
||||
|
||||
\cgalCRPSection{Corrected Curvature Functions}
|
||||
- `CGAL::Polygon_mesh_processing::interpolated_corrected_measure_mesh()`
|
||||
- `CGAL::Polygon_mesh_processing::interpolated_corrected_anisotropic_measure_mesh()`
|
||||
- `CGAL::Polygon_mesh_processing::interpolated_corrected_area_measure_face()`
|
||||
- `CGAL::Polygon_mesh_processing::interpolated_corrected_mean_curvature_measure_face()`
|
||||
- `CGAL::Polygon_mesh_processing::interpolated_corrected_gaussian_curvature_measure_face()`
|
||||
- `CGAL::Polygon_mesh_processing::interpolated_corrected_anisotropic_measure_face()`
|
||||
- `CGAL::Polygon_mesh_processing::expand_interpolated_corrected_measure_vertex()`
|
||||
- `CGAL::Polygon_mesh_processing::expand_interpolated_corrected_anisotropic_measure_vertex()`
|
||||
- `CGAL::Polygon_mesh_processing::interpolated_corrected_mean_curvature()`
|
||||
- `CGAL::Polygon_mesh_processing::interpolated_corrected_gaussian_curvature()`
|
||||
- `CGAL::Polygon_mesh_processing::interpolated_corrected_principal_curvatures()`
|
||||
|
|
|
|||
|
|
@ -876,6 +876,60 @@ not provide storage for the normals.
|
|||
|
||||
\cgalExample{Polygon_mesh_processing/compute_normals_example_Polyhedron.cpp}
|
||||
|
||||
****************************************
|
||||
\section PMPICC Computing Curvatures
|
||||
|
||||
This package provides methods to compute curvatures on polygonal meshes based on #PAPER#.
|
||||
This includes mean curvature, gaussian curvature, principal curvatures and directions.
|
||||
These can be computed on triangle meshes, quad meshes, and meshes with n-gon faces.
|
||||
The algorithms used prove to work well in general. Also, on meshes with noise
|
||||
on vertex positions, they give accurate results, on the condition that the
|
||||
correct vertex normals are provided.
|
||||
|
||||
The implementation is generic in terms of mesh data structure. It can be used on Surface_mesh,
|
||||
Polyhedron_3 and other polygonal mesh structures based on the Face Graph Model.
|
||||
|
||||
These computations are performed using :
|
||||
- `CGAL::Polygon_mesh_processing::interpolated_corrected_mean_curvature()`
|
||||
- `CGAL::Polygon_mesh_processing::interpolated_corrected_gaussian_curvature()`
|
||||
- `CGAL::Polygon_mesh_processing::interpolated_corrected_principal_curvatures()`
|
||||
|
||||
\cgalFigureRef{icc_diff_radius} shows how the mean curvature changes depending on
|
||||
the ball_radius named parameter which can be set to a value > 0 to get a smoother
|
||||
distribution of valuesa and "diffuse" the extreme values of curvatures across the mesh.
|
||||
|
||||
\cgalFigureAnchor{icc_diff_radius}
|
||||
<center>
|
||||
<img src="icc_diff_radius.png" style="max-width:90%;"/>
|
||||
</center>
|
||||
\cgalFigureCaptionBegin{icc_diff_radius}
|
||||
The mean curvature distrubution on a bear mesh with different values for the expanding ball radius
|
||||
\cgalFigureCaptionEnd
|
||||
|
||||
Property maps are used to record the computed curvatures as shown in examples.
|
||||
|
||||
\subsection ICCExample Interpolated Corrected Curvature Examples
|
||||
|
||||
Property maps are an API introduced in the boost library that allows to
|
||||
associate values to keys. In the following examples, for each proberty map, we associate
|
||||
a curvature value to each vertex.
|
||||
|
||||
\subsubsection ICCExample Interpolated Corrected Curvature on a Surface Mesh.
|
||||
|
||||
The following example illustrates how to
|
||||
compute the curvatures on vertices
|
||||
and store them in property maps provided by the class `Surface_mesh`.
|
||||
|
||||
\cgalExample{Polygon_mesh_processing/interpolated_corrected_curvatures_example.cpp}
|
||||
|
||||
\subsubsection NormalsExampleNP Interpolated Corrected Curvature on a Polyhedron
|
||||
|
||||
The following example illustrates how to
|
||||
compute the curvatures on vertices
|
||||
and store them in unordered (or ordered) maps as the class `Polyhedron_3` does
|
||||
not provide storage for the curvatures.
|
||||
|
||||
\cgalExample{Polygon_mesh_processing/interpolated_corrected_curvatures_polyhedron_example.cpp}
|
||||
|
||||
****************************************
|
||||
\section PMPSlicer Slicer
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@
|
|||
\example Polygon_mesh_processing/refine_fair_example.cpp
|
||||
\example Polygon_mesh_processing/mesh_slicer_example.cpp
|
||||
\example Polygon_mesh_processing/isotropic_remeshing_example.cpp
|
||||
\example Polygon_mesh_processing/interpolated_corrected_curvatures.cpp
|
||||
\example Polygon_mesh_processing/interpolated_corrected_curvatures_example.cpp
|
||||
\example Polygon_mesh_processing/interpolated_corrected_curvatures_polyhedron_example.cpp
|
||||
\example Polygon_mesh_processing/delaunay_remeshing_example.cpp
|
||||
\example Polygon_mesh_processing/compute_normals_example_Polyhedron.cpp
|
||||
\example Polygon_mesh_processing/hausdorff_distance_remeshing_example.cpp
|
||||
|
|
|
|||
|
|
@ -105,8 +105,10 @@ create_single_source_cgal_program("cc_compatible_orientations.cpp")
|
|||
|
||||
if(TARGET CGAL::Eigen3_support)
|
||||
|
||||
create_single_source_cgal_program("interpolated_corrected_curvatures.cpp")
|
||||
target_link_libraries(interpolated_corrected_curvatures PUBLIC CGAL::Eigen3_support)
|
||||
create_single_source_cgal_program("interpolated_corrected_curvatures_example.cpp")
|
||||
target_link_libraries(interpolated_corrected_curvatures_example PUBLIC CGAL::Eigen3_support)
|
||||
create_single_source_cgal_program("interpolated_corrected_curvatures_polyhedron_example.cpp")
|
||||
target_link_libraries(interpolated_corrected_curvatures_polyhedron_example PUBLIC CGAL::Eigen3_support)
|
||||
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -7,18 +7,17 @@
|
|||
#include <boost/graph/graph_traits.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace PMP = CGAL::Polygon_mesh_processing;
|
||||
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel EpicKernel;
|
||||
typedef CGAL::Surface_mesh<EpicKernel::Point_3> Mesh;
|
||||
typedef boost::graph_traits<Mesh>::face_descriptor face_descriptor;
|
||||
typedef boost::graph_traits<Mesh>::vertex_descriptor vertex_descriptor;
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel Epic_Kernel;
|
||||
typedef CGAL::Surface_mesh<Epic_Kernel::Point_3> Surface_Mesh;
|
||||
typedef boost::graph_traits<Surface_Mesh>::face_descriptor face_descriptor;
|
||||
typedef boost::graph_traits<Surface_Mesh>::vertex_descriptor vertex_descriptor;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
Mesh g1;
|
||||
Surface_Mesh g1;
|
||||
const std::string filename = (argc>1) ?
|
||||
argv[1] :
|
||||
CGAL::data_file_path("meshes/small_bunny.obj");
|
||||
|
|
@ -29,36 +28,54 @@ int main(int argc, char* argv[])
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
// creating and tying surface mesh property maps for curvatures (with defaults = 0)
|
||||
bool created = false;
|
||||
|
||||
Mesh::Property_map<vertex_descriptor, EpicKernel::FT> mean_curvature_map, gaussian_curvature_map;
|
||||
boost::tie(mean_curvature_map, created) = g1.add_property_map<vertex_descriptor, EpicKernel::FT>("v:mean_curvature_map", 0);
|
||||
Surface_Mesh::Property_map<vertex_descriptor, Epic_Kernel::FT> mean_curvature_map, gaussian_curvature_map;
|
||||
boost::tie(mean_curvature_map, created) = g1.add_property_map<vertex_descriptor, Epic_Kernel::FT>("v:mean_curvature_map", 0);
|
||||
assert(created);
|
||||
|
||||
boost::tie(gaussian_curvature_map, created) = g1.add_property_map<vertex_descriptor, EpicKernel::FT>("v:gaussian_curvature_map", 0);
|
||||
boost::tie(gaussian_curvature_map, created) = g1.add_property_map<vertex_descriptor, Epic_Kernel::FT>("v:gaussian_curvature_map", 0);
|
||||
assert(created);
|
||||
|
||||
Mesh::Property_map<vertex_descriptor, std::tuple<
|
||||
EpicKernel::FT,
|
||||
EpicKernel::FT,
|
||||
EpicKernel::Vector_3,
|
||||
EpicKernel::Vector_3
|
||||
// we use a tuble of 2 scalar values and 2 vectors for principal curvatures and directions
|
||||
Surface_Mesh::Property_map<vertex_descriptor, std::tuple<
|
||||
Epic_Kernel::FT,
|
||||
Epic_Kernel::FT,
|
||||
Epic_Kernel::Vector_3,
|
||||
Epic_Kernel::Vector_3
|
||||
>> principle_curvature_map;
|
||||
|
||||
boost::tie(principle_curvature_map, created) = g1.add_property_map<vertex_descriptor, std::tuple<
|
||||
EpicKernel::FT,
|
||||
EpicKernel::FT,
|
||||
EpicKernel::Vector_3,
|
||||
EpicKernel::Vector_3
|
||||
Epic_Kernel::FT,
|
||||
Epic_Kernel::FT,
|
||||
Epic_Kernel::Vector_3,
|
||||
Epic_Kernel::Vector_3
|
||||
>>("v:principle_curvature_map", { 0, 0,
|
||||
EpicKernel::Vector_3 (0,0,0),
|
||||
EpicKernel::Vector_3 (0,0,0)});
|
||||
Epic_Kernel::Vector_3 (0,0,0),
|
||||
Epic_Kernel::Vector_3 (0,0,0)});
|
||||
assert(created);
|
||||
|
||||
PMP::interpolated_corrected_mean_curvature(
|
||||
g1,
|
||||
mean_curvature_map
|
||||
);
|
||||
|
||||
// uncomment this to compute a curvature while specifying named parameters
|
||||
// Example: an expansion ball radius of 0.5 and a vertex normals map (does not have to depend on positions)
|
||||
|
||||
/*Surface_Mesh::Property_map<vertex_descriptor, Epic_Kernel::Vector_3> vnm;
|
||||
boost::tie(vnm, created) = g1.add_property_map<vertex_descriptor, Epic_Kernel::Vector_3>(
|
||||
"v:vnm", Epic_Kernel::Vector_3(0, 0, 0)
|
||||
);
|
||||
|
||||
assert(created);
|
||||
|
||||
PMP::interpolated_corrected_mean_curvature(
|
||||
g1,
|
||||
mean_curvature_map,
|
||||
CGAL::parameters::ball_radius(0.5).vertex_normal_map(vnm)
|
||||
);*/
|
||||
|
||||
PMP::interpolated_corrected_gaussian_curvature(
|
||||
g1,
|
||||
gaussian_curvature_map
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <CGAL/Polygon_mesh_processing/Curvatures/interpolated_corrected_curvature_measures.h>
|
||||
#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
#include <CGAL/property_map.h>
|
||||
|
||||
#include <boost/graph/graph_traits.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace PMP = CGAL::Polygon_mesh_processing;
|
||||
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel Epic_Kernel;
|
||||
typedef CGAL::Polyhedron_3<Epic_Kernel> Polyhedron;
|
||||
typedef boost::graph_traits<Polyhedron>::face_descriptor face_descriptor;
|
||||
typedef boost::graph_traits<Polyhedron>::vertex_descriptor vertex_descriptor;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
Polyhedron g1;
|
||||
const std::string filename = (argc>1) ?
|
||||
argv[1] :
|
||||
CGAL::data_file_path("meshes/small_bunny.obj");
|
||||
|
||||
if(!CGAL::IO::read_polygon_mesh(filename, g1))
|
||||
{
|
||||
std::cerr << "Invalid input file." << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
std::unordered_map<vertex_descriptor, Epic_Kernel::FT> mean_curvature_map, gaussian_curvature_map;
|
||||
std::unordered_map<vertex_descriptor, std::tuple<
|
||||
Epic_Kernel::FT,
|
||||
Epic_Kernel::FT,
|
||||
Epic_Kernel::Vector_3,
|
||||
Epic_Kernel::Vector_3
|
||||
>> principle_curvature_map;
|
||||
|
||||
PMP::interpolated_corrected_mean_curvature(
|
||||
g1,
|
||||
boost::make_assoc_property_map(mean_curvature_map)
|
||||
);
|
||||
|
||||
// uncomment this to compute a curvature while specifying named parameters
|
||||
// Example: an expansion ball radius of 0.5 and a vertex normals map (does not have to depend on positions)
|
||||
|
||||
/*std::unordered_map<vertex_descriptor, Epic_Kernel::Vector_3> vnm;
|
||||
|
||||
PMP::interpolated_corrected_mean_curvature(
|
||||
g1,
|
||||
boost::make_assoc_property_map(mean_curvature_map),
|
||||
CGAL::parameters::ball_radius(0.5).vertex_normal_map(boost::make_assoc_property_map(vnm))
|
||||
);*/
|
||||
|
||||
PMP::interpolated_corrected_gaussian_curvature(
|
||||
g1,
|
||||
boost::make_assoc_property_map(gaussian_curvature_map)
|
||||
);
|
||||
PMP::interpolated_corrected_principal_curvatures(
|
||||
g1,
|
||||
boost::make_assoc_property_map(principle_curvature_map)
|
||||
);
|
||||
|
||||
int i = 0;
|
||||
for (vertex_descriptor v : vertices(g1))
|
||||
{
|
||||
auto PC = principle_curvature_map[v];
|
||||
std::cout << i << ": HC = " << mean_curvature_map[v]
|
||||
<< ", GC = " << gaussian_curvature_map[v] << "\n"
|
||||
<< ", PC = [ " << std::get<0>(PC) << " , " << std::get<1>(PC) << " ]\n";
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
|
@ -44,7 +44,7 @@ typename GT::FT average_edge_length(const PolygonMesh& pmesh)
|
|||
if (n == 0)
|
||||
return 0;
|
||||
|
||||
GT::FT avg_edge_length = 0;
|
||||
typename GT::FT avg_edge_length = 0;
|
||||
for (auto e : edges(pmesh))
|
||||
avg_edge_length += edge_length(e, pmesh);
|
||||
|
||||
|
|
@ -52,35 +52,12 @@ typename GT::FT average_edge_length(const PolygonMesh& pmesh)
|
|||
return avg_edge_length;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
* \ingroup PMP_corrected_curvatures_grp
|
||||
* Enumeration type used to specify which measure of a given face
|
||||
* is computed for the interpolated corrected curvature functions.
|
||||
*/
|
||||
// enum
|
||||
enum Curvature_measure_index {
|
||||
MU0_AREA_MEASURE, ///< corrected area density
|
||||
MU1_MEAN_CURVATURE_MEASURE, ///< corrected mean curvature density
|
||||
MU2_GAUSSIAN_CURVATURE_MEASURE ///< corrected gaussian curvature density
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup PMP_corrected_curvatures_grp
|
||||
*
|
||||
* Computes the interpolated corrected area measure \f$ \mu_0 \f$ of a specific face.
|
||||
*
|
||||
* @tparam GT geometric traits class model of `Kernel`.
|
||||
*
|
||||
* @param x is a vector of the vertex positions of the face.
|
||||
* @param u is a vector of the vertex normals of the face.
|
||||
*
|
||||
*
|
||||
* @see `interpolated_corrected_mean_curvature_measure_face()`
|
||||
* @see `interpolated_corrected_gaussian_curvature_measure_face()`
|
||||
* @see `interpolated_corrected_measure_mesh()`
|
||||
*/
|
||||
template<typename GT>
|
||||
typename GT::FT interpolated_corrected_area_measure_face(const std::vector<typename GT::Vector_3>& u,
|
||||
const std::vector<typename GT::Vector_3>& x = {})
|
||||
|
|
@ -136,20 +113,6 @@ typename GT::FT interpolated_corrected_area_measure_face(const std::vector<typen
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \ingroup PMP_corrected_curvatures_grp
|
||||
*
|
||||
* Computes the interpolated corrected mean curvature measure \f$ \mu_1 \f$ of a specific face.
|
||||
*
|
||||
* @tparam GT geometric traits class model of `Kernel`.
|
||||
*
|
||||
* @param x is a vector of the vertex positions of the face.
|
||||
* @param u is a vector of the vertex nomrals of the face.
|
||||
*
|
||||
* @see `interpolated_corrected_gaussian_curvature_measure_face()`
|
||||
* @see `interpolated_corrected_area_measure_face()`
|
||||
* @see `interpolated_corrected_measure_mesh()`
|
||||
*/
|
||||
template<typename GT>
|
||||
typename GT::FT interpolated_corrected_mean_curvature_measure_face(const std::vector<typename GT::Vector_3>& u,
|
||||
const std::vector<typename GT::Vector_3>& x = {})
|
||||
|
|
@ -216,20 +179,6 @@ typename GT::FT interpolated_corrected_mean_curvature_measure_face(const std::ve
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \ingroup PMP_corrected_curvatures_grp
|
||||
*
|
||||
* Computes the interpolated corrected gaussian curvature measure \f$ \mu_2 \f$ of a specific face.
|
||||
*
|
||||
* @tparam GT geometric traits class model of `Kernel`.
|
||||
*
|
||||
* @param x is a vector of the vertex positions of the face.
|
||||
* @param u is a vector of the vertex nomrals of the face.
|
||||
*
|
||||
* @see `interpolated_corrected_mean_curvature_measure_face()`
|
||||
* @see `interpolated_corrected_area_measure_face()`
|
||||
* @see `interpolated_corrected_measure_mesh()`
|
||||
*/
|
||||
template<typename GT>
|
||||
typename GT::FT interpolated_corrected_gaussian_curvature_measure_face(const std::vector<typename GT::Vector_3>& u,
|
||||
const std::vector<typename GT::Vector_3>& x = {})
|
||||
|
|
@ -277,21 +226,6 @@ typename GT::FT interpolated_corrected_gaussian_curvature_measure_face(const std
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \ingroup PMP_corrected_curvatures_grp
|
||||
*
|
||||
* Computes the interpolated corrected anisotropic measure \f$ \mu_{XY} \f$ of a specific face.
|
||||
*
|
||||
* @tparam GT geometric traits class model of `Kernel`.
|
||||
*
|
||||
* @param u is a vector of the vertex nomrals of the face.
|
||||
* @param x is a vector of the vertex positions of the face.
|
||||
*
|
||||
* @return an array of scalar values for each combination of the standard basis (3x3)
|
||||
* These are the values of the interpolated corrected anisotropic measure of the given face.
|
||||
*
|
||||
* @see `interpolated_corrected_anisotropic_measure_mesh()`
|
||||
*/
|
||||
template<typename GT>
|
||||
std::array<typename GT::FT, 3 * 3> interpolated_corrected_anisotropic_measure_face(const std::vector<typename GT::Vector_3>& u,
|
||||
const std::vector<typename GT::Vector_3>& x)
|
||||
|
|
@ -403,51 +337,6 @@ std::array<typename GT::FT, 3 * 3> interpolated_corrected_anisotropic_measure_fa
|
|||
return muXY;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup PMP_corrected_curvatures_grp
|
||||
*
|
||||
* Computes the interpolated corrected curvature measure on each face of the mesh.
|
||||
*
|
||||
* @tparam PolygonMesh a model of `FaceListGraph`.
|
||||
* @tparam FaceMeasureMap a model of `WritablePropertyMap` with
|
||||
* `boost::graph_traits<PolygonMesh>::%face_descriptor` as key type and `GT::FT` as value type.
|
||||
* @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters".
|
||||
*
|
||||
* @param pmesh the polygon mesh.
|
||||
* @param fmm (face measure map) the property map used for storing the computed interpolated corrected measure.
|
||||
* @param mu_i an enum for choosing between computing
|
||||
* the area measure, the mean curvature measure or the gaussian curvature measure.
|
||||
* @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
*
|
||||
* \cgalParamNBegin{vertex_point_map}
|
||||
* \cgalParamDescription{a property map associating points to the vertices of `pmesh`}
|
||||
* \cgalParamType{a class model of `ReadablePropertyMap` with
|
||||
* `boost::graph_traits<PolygonMesh>::%vertex_descriptor`
|
||||
* as key type and `%Point_3` as value type}
|
||||
* \cgalParamDefault{`boost::get(CGAL::vertex_point, pmesh)`}
|
||||
* \cgalParamExtra{If this parameter is omitted, an internal property map for
|
||||
* `CGAL::vertex_point_t` must be available in `PolygonMesh`.}
|
||||
* \cgalParamNEnd
|
||||
*
|
||||
* \cgalParamNBegin{vertex_normal_map}
|
||||
* \cgalParamDescription{a property map associating normal vectors to the vertices of `pmesh`}
|
||||
* \cgalParamType{a class model of `ReadablePropertyMap` with
|
||||
* `boost::graph_traits<PolygonMesh>::%vertex_descriptor`
|
||||
* as key type and `%Vector_3` as value type}
|
||||
* \cgalParamDefault{`get(dynamic_vertex_property_t<GT::Vector_3>(), pmesh)`}
|
||||
* \cgalParamExtra{If this parameter is omitted, vertex normals will be
|
||||
* computed using compute_vertex_normals()}
|
||||
* \cgalParamNEnd
|
||||
*
|
||||
* \cgalNamedParamsEnd
|
||||
*
|
||||
* @see `interpolated_corrected_area_measure_face()`
|
||||
* @see `interpolated_corrected_mean_curvature_measure_face()`
|
||||
* @see `interpolated_corrected_gaussian_curvature_measure_face()`
|
||||
*/
|
||||
template<typename PolygonMesh, typename FaceMeasureMap,
|
||||
typename NamedParameters = parameters::Default_named_parameters>
|
||||
void
|
||||
|
|
@ -518,48 +407,6 @@ template<typename PolygonMesh, typename FaceMeasureMap,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup PMP_corrected_curvatures_grp
|
||||
*
|
||||
* Computes the interpolated corrected anisotropic measure on each face of the mesh
|
||||
*
|
||||
* @tparam PolygonMesh a model of `FaceListGraph`.
|
||||
* @tparam FaceMeasureMap a model of `WritablePropertyMap` with
|
||||
* `boost::graph_traits<PolygonMesh>::%face_descriptor` as key type and `std::array<GT::FT, 3 * 3>` as value type.
|
||||
* @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters".
|
||||
*
|
||||
* @param pmesh the polygon mesh.
|
||||
* @param fmm (face measure map) the property map used for storing the computed interpolated corrected measure.
|
||||
* @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
*
|
||||
* \cgalParamNBegin{vertex_point_map}
|
||||
* \cgalParamDescription{a property map associating points to the vertices of `pmesh`}
|
||||
* \cgalParamType{a class model of `ReadablePropertyMap` with
|
||||
* `boost::graph_traits<PolygonMesh>::%vertex_descriptor`
|
||||
* as key type and `%Point_3` as value type}
|
||||
* \cgalParamDefault{`boost::get(CGAL::vertex_point, pmesh)`}
|
||||
* \cgalParamExtra{If this parameter is omitted, an internal property map for
|
||||
* `CGAL::vertex_point_t` must be available in `PolygonMesh`.}
|
||||
* \cgalParamNEnd
|
||||
*
|
||||
* \cgalParamNBegin{vertex_normal_map}
|
||||
* \cgalParamDescription{a property map associating normal vectors to the vertices of `pmesh`}
|
||||
* \cgalParamType{a class model of `ReadablePropertyMap` with
|
||||
* `boost::graph_traits<PolygonMesh>::%vertex_descriptor`
|
||||
* as key type and `%Vector_3` as value type}
|
||||
* \cgalParamDefault{`get(dynamic_vertex_property_t<GT::Vector_3>(), pmesh)`}
|
||||
* \cgalParamExtra{If this parameter is omitted, vertex normals will be
|
||||
* computed using compute_vertex_normals()}
|
||||
* \cgalParamNEnd
|
||||
*
|
||||
* \cgalNamedParamsEnd
|
||||
*
|
||||
* @see `interpolated_corrected_anisotropic_measure_face()`
|
||||
* @see `interpolated_corrected_measure_mesh()`
|
||||
*/
|
||||
template<typename PolygonMesh, typename FaceMeasureMap,
|
||||
typename NamedParameters = parameters::Default_named_parameters>
|
||||
void
|
||||
|
|
@ -636,21 +483,6 @@ template<typename PolygonMesh, typename FaceMeasureMap,
|
|||
// return samples_in / (typename GT::FT)(res * (res + 1) / 2);
|
||||
//}
|
||||
|
||||
/**
|
||||
* \ingroup PMP_corrected_curvatures_grp
|
||||
*
|
||||
* Computes the ratio of inclusion of a face in a ball of radius `r` around the
|
||||
* point `c`.
|
||||
*
|
||||
* @tparam GT geometric traits class model of `Kernel`.
|
||||
*
|
||||
* @param x is a vector of the vertex positions of the face.
|
||||
* @param r is the radius of the ball.
|
||||
* @param c is the center of the ball.
|
||||
*
|
||||
* @see `expand_interpolated_corrected_measure_vertex()`
|
||||
* @see `expand_interpolated_corrected_anisotropic_measure_vertex()`
|
||||
*/
|
||||
template<typename GT>
|
||||
typename GT::FT face_in_ball_ratio(const std::vector<typename GT::Vector_3>& x,
|
||||
const typename GT::FT r,
|
||||
|
|
@ -682,52 +514,6 @@ typename GT::FT face_in_ball_ratio(const std::vector<typename GT::Vector_3>& x,
|
|||
return (r - d_min) / (d_max - d_min);
|
||||
}
|
||||
|
||||
/**
|
||||
* \ingroup PMP_corrected_curvatures_grp
|
||||
*
|
||||
* Expands given face area and curvature (mean or gaussian) measures around a vertex `v`.
|
||||
* Expansion is based on the inclusion ratio of each face in a ball of radius `r` around the vertex `v`.
|
||||
*
|
||||
* @tparam PolygonMesh a model of `FaceListGraph`.
|
||||
* @tparam FaceMeasureMap a model of `WritablePropertyMap` with
|
||||
* `boost::graph_traits<PolygonMesh>::%face_descriptor` as key type and `GT::FT` as value type.
|
||||
* @tparam VertexMeasureMap a model of `WritablePropertyMap` with
|
||||
* `boost::graph_traits<PolygonMesh>::%vertex_descriptor` as key type and `GT::FT` as value type.
|
||||
* @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters".
|
||||
*
|
||||
* @param pmesh the polygon mesh.
|
||||
* @param area_fmm (area face measure map) the property map storing the already computed area measure on each face.
|
||||
* @param curvature_fmm (curvature face measure map) the property map storing the already computed curvature measure on each face.
|
||||
* This curvature measure can be either the Mean Curvature or the Gaussian Curvature.
|
||||
* @param area_vmm (area vertex measure map) the property map provided to store the expanded area measure on each vertex.
|
||||
* @param curvature_vmm (curvature vertex measure map) the property map provided to store the expanded curvature measure on each vertex.
|
||||
* This curvature measure can be either the Mean Curvature or the Gaussian Curvature.
|
||||
* @param v (vertex) the vertex to expand the area and curvature measure around.
|
||||
* @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
*
|
||||
* \cgalParamNBegin{ball_radius}
|
||||
* \cgalParamDescription{the radius of the ball around the vertex `v` to expand the area and curvature measure}
|
||||
* \cgalParamType{`GT::FT`}
|
||||
* \cgalParamDefault{`0.01`}
|
||||
* \cgalParamNEnd
|
||||
*
|
||||
* \cgalParamNBegin{vertex_point_map}
|
||||
* \cgalParamDescription{a property map associating points to the vertices of `pmesh`}
|
||||
* \cgalParamType{a class model of `ReadablePropertyMap` with
|
||||
* `boost::graph_traits<PolygonMesh>::%vertex_descriptor`
|
||||
* as key type and `%Point_3` as value type}
|
||||
* \cgalParamDefault{`boost::get(CGAL::vertex_point, pmesh)`}
|
||||
* \cgalParamExtra{If this parameter is omitted, an internal property map for
|
||||
* `CGAL::vertex_point_t` must be available in `PolygonMesh`.}
|
||||
* \cgalParamNEnd
|
||||
*
|
||||
* \cgalNamedParamsEnd
|
||||
*
|
||||
* @see `expand_interpolated_corrected_anisotropic_measure_vertex()`
|
||||
* @see `face_in_ball_ratio()`
|
||||
*/
|
||||
template<typename PolygonMesh, typename FaceMeasureMap, typename VertexMeasureMap,
|
||||
typename NamedParameters = parameters::Default_named_parameters>
|
||||
void expand_interpolated_corrected_measure_vertex(const PolygonMesh& pmesh,
|
||||
|
|
@ -802,54 +588,6 @@ template<typename PolygonMesh, typename FaceMeasureMap, typename VertexMeasureMa
|
|||
put(curvature_vmm, v, corrected_mui);
|
||||
}
|
||||
|
||||
/**
|
||||
* \ingroup PMP_corrected_curvatures_grp
|
||||
*
|
||||
* Expands given face area and anisotropic measures around a vertex `v`.
|
||||
* Expansion is based on the inclusion ratio of each face in a ball of radius `r` around the vertex `v`.
|
||||
*
|
||||
* @tparam PolygonMesh a model of `FaceListGraph`
|
||||
* @tparam AreaFaceMeasureMap a model of `WritablePropertyMap` with
|
||||
* `boost::graph_traits<PolygonMesh>::%face_descriptor` as key type and `GT::FT` as value type.
|
||||
* @tparam AnisotropicFaceMeasureMap a model of `WritablePropertyMap` with
|
||||
* `boost::graph_traits<PolygonMesh>::%face_descriptor` as key type and `std::array<typename GT::FT, 3 * 3>` as value type.
|
||||
* @tparam AreaVertexMeasureMap a model of `WritablePropertyMap` with
|
||||
* `boost::graph_traits<PolygonMesh>::%vertex_descriptor` as key type and `GT::FT` as value type.
|
||||
* @tparam AnisotropicVertexMeasureMap a model of `WritablePropertyMap` with
|
||||
* `boost::graph_traits<PolygonMesh>::%vertex_descriptor` as key type and `std::array<typename GT::FT, 3 * 3>` as value type.
|
||||
* @tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters".
|
||||
*
|
||||
* @param pmesh the polygon mesh.
|
||||
* @param area_fmm (area face measure map) the property map storing the already computed area measure on each face.
|
||||
* @param aniso_fmm (anisotropic face measure map) the property map storing the already computed anisotropic measure on each face.
|
||||
* @param area_vmm (area vertex measure map) the property map provided to store the expanded area measure on each vertex.
|
||||
* @param aniso_vmm (anisotropic vertex measure map) the property map provided to store the expanded anisotropic measure on each vertex.
|
||||
* @param v (vertex) the vertex to expand the area and anisotropic measure around.
|
||||
* @param np an optional sequence of \ref bgl_namedparameters "Named Parameters" among the ones listed below
|
||||
*
|
||||
* \cgalNamedParamsBegin
|
||||
*
|
||||
* \cgalParamNBegin{ball_radius}
|
||||
* \cgalParamDescription{the radius of the ball around the vertex `v` to expand the area and curvature measure}
|
||||
* \cgalParamType{`GT::FT`}
|
||||
* \cgalParamDefault{`0.01`}
|
||||
* \cgalParamNEnd
|
||||
*
|
||||
* \cgalParamNBegin{vertex_point_map}
|
||||
* \cgalParamDescription{a property map associating points to the vertices of `pmesh`}
|
||||
* \cgalParamType{a class model of `ReadablePropertyMap` with
|
||||
* `boost::graph_traits<PolygonMesh>::%vertex_descriptor`
|
||||
* as key type and `%Point_3` as value type}
|
||||
* \cgalParamDefault{`boost::get(CGAL::vertex_point, pmesh)`}
|
||||
* \cgalParamExtra{If this parameter is omitted, an internal property map for
|
||||
* `CGAL::vertex_point_t` must be available in `PolygonMesh`.}
|
||||
* \cgalParamNEnd
|
||||
*
|
||||
* \cgalNamedParamsEnd
|
||||
*
|
||||
* @see `expand_interpolated_corrected_measure_vertex()`
|
||||
* @see `face_in_ball_ratio()`
|
||||
*/
|
||||
template<typename PolygonMesh, typename AreaFaceMeasureMap, typename AnisotropicFaceMeasureMap,
|
||||
typename AreaVertexMeasureMap, typename AnisotropicVertexMeasureMap,
|
||||
typename NamedParameters = parameters::Default_named_parameters>
|
||||
|
|
@ -931,6 +669,8 @@ template<typename PolygonMesh, typename AreaFaceMeasureMap, typename Anisotropic
|
|||
put(aniso_vmm, v, corrected_muXY);
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
||||
/**
|
||||
* \ingroup PMP_corrected_curvatures_grp
|
||||
*
|
||||
|
|
@ -948,8 +688,6 @@ template<typename PolygonMesh, typename AreaFaceMeasureMap, typename Anisotropic
|
|||
*
|
||||
* @see `interpolated_corrected_gaussian_curvature()`
|
||||
* @see `interpolated_corrected_principal_curvatures()`
|
||||
* @see `interpolated_corrected_measure_mesh()`
|
||||
* @see `expand_interpolated_corrected_measure_vertex()`
|
||||
*/
|
||||
|
||||
template<typename PolygonMesh, typename VertexCurvatureMap,
|
||||
|
|
@ -983,12 +721,12 @@ template<typename PolygonMesh, typename VertexCurvatureMap,
|
|||
boost::associative_property_map<VertexMeasureMap_tag>
|
||||
mu0_expand_map(mu0_expand_init), mu1_expand_map(mu1_expand_init);
|
||||
|
||||
interpolated_corrected_measure_mesh(pmesh, mu0_map, MU0_AREA_MEASURE, np);
|
||||
interpolated_corrected_measure_mesh(pmesh, mu1_map, MU1_MEAN_CURVATURE_MEASURE, np);
|
||||
internal::interpolated_corrected_measure_mesh(pmesh, mu0_map, internal::MU0_AREA_MEASURE, np);
|
||||
internal::interpolated_corrected_measure_mesh(pmesh, mu1_map, internal::MU1_MEAN_CURVATURE_MEASURE, np);
|
||||
|
||||
for (vertex_descriptor v : vertices(pmesh))
|
||||
{
|
||||
expand_interpolated_corrected_measure_vertex(pmesh, mu0_map, mu1_map, mu0_expand_map, mu1_expand_map, v, np.ball_radius(r));
|
||||
internal::expand_interpolated_corrected_measure_vertex(pmesh, mu0_map, mu1_map, mu0_expand_map, mu1_expand_map, v, np.ball_radius(r));
|
||||
|
||||
typename GT::FT v_mu0 = get(mu0_expand_map, v);
|
||||
if (v_mu0 != 0.0)
|
||||
|
|
@ -1015,8 +753,6 @@ template<typename PolygonMesh, typename VertexCurvatureMap,
|
|||
*
|
||||
* @see `interpolated_corrected_mean_curvature()`
|
||||
* @see `interpolated_corrected_principal_curvatures()`
|
||||
* @see `interpolated_corrected_measure_mesh()`
|
||||
* @see `expand_interpolated_corrected_measure_vertex()`
|
||||
*/
|
||||
template<typename PolygonMesh, typename VertexCurvatureMap,
|
||||
typename NamedParameters = parameters::Default_named_parameters>
|
||||
|
|
@ -1049,12 +785,12 @@ template<typename PolygonMesh, typename VertexCurvatureMap,
|
|||
boost::associative_property_map<VertexMeasureMap_tag>
|
||||
mu0_expand_map(mu0_expand_init), mu2_expand_map(mu2_expand_init);
|
||||
|
||||
interpolated_corrected_measure_mesh(pmesh, mu0_map, MU0_AREA_MEASURE, np);
|
||||
interpolated_corrected_measure_mesh(pmesh, mu2_map, MU2_GAUSSIAN_CURVATURE_MEASURE, np);
|
||||
internal::interpolated_corrected_measure_mesh(pmesh, mu0_map, internal::MU0_AREA_MEASURE, np);
|
||||
internal::interpolated_corrected_measure_mesh(pmesh, mu2_map, internal::MU2_GAUSSIAN_CURVATURE_MEASURE, np);
|
||||
|
||||
for (vertex_descriptor v : vertices(pmesh))
|
||||
{
|
||||
expand_interpolated_corrected_measure_vertex(pmesh, mu0_map, mu2_map, mu0_expand_map, mu2_expand_map, v, np.ball_radius(r));
|
||||
internal::expand_interpolated_corrected_measure_vertex(pmesh, mu0_map, mu2_map, mu0_expand_map, mu2_expand_map, v, np.ball_radius(r));
|
||||
|
||||
typename GT::FT v_mu0 = get(mu0_expand_map, v);
|
||||
if(v_mu0 != 0.0)
|
||||
|
|
@ -1106,8 +842,6 @@ template<typename PolygonMesh, typename VertexCurvatureMap,
|
|||
*
|
||||
* @see `interpolated_corrected_mean_curvature()`
|
||||
* @see `interpolated_corrected_gaussian_curvature()`
|
||||
* @see `interpolated_corrected_anisotropic_measure_mesh()`
|
||||
* @see `expand_interpolated_corrected_anisotropic_measure_vertex()`
|
||||
*/
|
||||
template<typename PolygonMesh, typename VertexCurvatureMap,
|
||||
typename NamedParameters = parameters::Default_named_parameters>
|
||||
|
|
@ -1172,12 +906,12 @@ template<typename PolygonMesh, typename VertexCurvatureMap,
|
|||
boost::associative_property_map<VertexMatrixMeasureMap_tag>
|
||||
muXY_expand_map(muXY_expand_init);
|
||||
|
||||
interpolated_corrected_measure_mesh(pmesh, mu0_map, MU0_AREA_MEASURE, np);
|
||||
interpolated_corrected_anisotropic_measure_mesh(pmesh, muXY_map, np);
|
||||
internal::interpolated_corrected_measure_mesh(pmesh, mu0_map, internal::MU0_AREA_MEASURE, np);
|
||||
internal::interpolated_corrected_anisotropic_measure_mesh(pmesh, muXY_map, np);
|
||||
|
||||
for (vertex_descriptor v : vertices(pmesh))
|
||||
{
|
||||
expand_interpolated_corrected_anisotropic_measure_vertex(pmesh, mu0_map, muXY_map, mu0_expand_map, muXY_expand_map, v, np.ball_radius(r));
|
||||
internal::expand_interpolated_corrected_anisotropic_measure_vertex(pmesh, mu0_map, muXY_map, mu0_expand_map, muXY_expand_map, v, np.ball_radius(r));
|
||||
|
||||
typename GT::FT v_mu0 = get(mu0_expand_map, v);
|
||||
Eigen::Matrix<typename GT::FT, 3, 3> v_muXY = get(muXY_expand_map, v);
|
||||
|
|
|
|||
Loading…
Reference in New Issue