diff --git a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Surface_mesh_parameterization.txt b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Surface_mesh_parameterization.txt index d3afaac6836..fa98420f1b1 100644 --- a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Surface_mesh_parameterization.txt +++ b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/Surface_mesh_parameterization.txt @@ -299,6 +299,25 @@ for both systems) is asymmetric. Floater Mean Value Coordinates. Rightmost: parameter space. \cgalFigureCaptionEnd +\subsubsection Surface_mesh_parameterizationIterativeAuthalic Iterative Authalic Parameterization + +`Surface_mesh_parameterization::Iterative_authalic_parameterizer_3` + +The Iterative Authalic parameterization method has been introduced by +Jain et al. \cgalCite{cgal:j-lrsspp-19}. This parameterization +is a fixed border parameterization and is part of the authalic parameterization family, +meaning that it aims to minimize area distortion between the input surface mesh and the parameterized output. +More precisely, the approach used by this parameterizer is to iteratively redistribute +the \f$ L_2\f$ stretch - as defined by Sander et al. \cgalCite{cgal:ssgh-tmpm-01} - over the mesh. + +\cgalFigureAnchor{Surface_mesh_parameterizationfigiterativeauthalic} +
+ +
+\cgalFigureCaptionBegin{Surface_mesh_parameterizationfigiterativeauthalic} +Iterative Authalic Parameterization (the blue line depicts the cut graph). Rightmost: parameter space. +\cgalFigureCaptionEnd + \subsubsection secBorderParameterizationsforFixedMethods Border Parameterizations for Fixed Methods Parameterization methods for borders are used as traits classes modifying the diff --git a/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/fig/iterative_authalic.jpg b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/fig/iterative_authalic.jpg new file mode 100644 index 00000000000..9bb4169df1f Binary files /dev/null and b/Surface_mesh_parameterization/doc/Surface_mesh_parameterization/fig/iterative_authalic.jpg differ diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/iterative_authalic_parameterizer.cpp b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/iterative_authalic_parameterizer.cpp index f3833b8d146..c74ed2bf50e 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/iterative_authalic_parameterizer.cpp +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/iterative_authalic_parameterizer.cpp @@ -50,7 +50,7 @@ int main(int argc, char** argv) typedef SMP::Iterative_authalic_parameterizer_3 Parameterizer; Parameterizer parameterizer(border_parameterizer); - const int iterations = (argc > 2) ? std::atoi(argv[2]) : 15; + const unsigned int iterations = (argc > 2) ? std::atoi(argv[2]) : 15; SMP::Error_code err = parameterizer.parameterize(sm, bhd, uv_map, iterations); if(err != SMP::OK) diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h index 0a5f9a2606a..9f2708cb8b1 100755 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h @@ -851,34 +851,6 @@ public: } } - /// computes a one-to-one mapping from a triangular 3D surface mesh - /// to a piece of the 2D space. - /// The mapping is piecewise linear (linear in each triangle). - /// The result is the `(u,v)` pair image of each vertex of the 3D surface. - /// - /// \tparam VertexUVmap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and - /// %Point_2 (type deduced from `Triangle_mesh` using `Kernel_traits`) - /// as value type. - /// \tparam VertexIndexMap must be a model of `ReadablePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and - /// a unique integer as value type. - /// \tparam VertexParameterizedMap must be a model of `ReadWritePropertyMap` with - /// `boost::graph_traits::%vertex_descriptor` as key type and - /// a Boolean as value type. - /// - /// \param tmesh a triangulated surface - /// \param bhd a halfedge descriptor on the boundary of `mesh` - /// \param uvmap an instanciation of the class `VertexUVmap` - /// \param vimap an instanciation of the class `VertexIndexMap` - /// \param vpmap an instanciation of the class `VertexParameterizedMap` - /// \param iterations an integer number of iterations to run the parameterization - /// \param error return error value of the iterative process - /// - /// \pre `tmesh` must be a triangular mesh. - /// \pre The mesh border must be mapped onto a convex polygon. - /// \pre The vertices must be indexed (`vimap` must be initialized). - /// template @@ -887,7 +859,7 @@ public: VertexUVmap uvmap, VertexIndexMap vimap, VertexParameterizedMap vpmap, - int& iterations, + unsigned int& iterations, double& error) { CGAL_precondition(is_valid_polygon_mesh(tmesh)); @@ -936,12 +908,12 @@ public: if(DEBUG_L0) std::cout << std::endl; - int last_best_i = 0; + unsigned int last_best_i = 0; NT gamma = 1; // @todo what value should that be bool is_changed = false; // iterate it with the new weights - int i = 0; + unsigned int i = 0; while(i < iterations) { if(DEBUG_L0) @@ -1101,12 +1073,39 @@ public: VertexUVmap uvmap, VertexIndexMap vimap, VertexParameterizedMap vpmap, - int& iterations) + unsigned int& iterations) { double unused_error; return parameterize(tmesh, bhd, uvmap, vimap, vpmap, iterations, unused_error); } + /// computes a one-to-one mapping from a triangular 3D surface mesh + /// to a piece of the 2D space. + /// The mapping is piecewise linear (linear in each triangle). + /// The result is the `(u,v)` pair image of each vertex of the 3D surface. + /// + /// \tparam VertexUVmap must be a model of `ReadWritePropertyMap` with + /// `boost::graph_traits::%vertex_descriptor` as key type and + /// %Point_2 (type deduced from `Triangle_mesh` using `Kernel_traits`) + /// as value type. + /// \tparam VertexIndexMap must be a model of `ReadablePropertyMap` with + /// `boost::graph_traits::%vertex_descriptor` as key type and + /// a unique integer as value type. + /// \tparam VertexParameterizedMap must be a model of `ReadWritePropertyMap` with + /// `boost::graph_traits::%vertex_descriptor` as key type and + /// a Boolean as value type. + /// + /// \param tmesh a triangulated surface + /// \param bhd a halfedge descriptor on the boundary of `mesh` + /// \param uvmap an instanciation of the class `VertexUVmap` + /// \param vimap an instanciation of the class `VertexIndexMap` + /// \param vpmap an instanciation of the class `VertexParameterizedMap` + /// \param iterations an integer number of iterations to run the parameterization + /// + /// \pre `tmesh` must be a triangular mesh. + /// \pre The mesh border must be mapped onto a convex polygon. + /// \pre The vertices must be indexed (`vimap` must be initialized). + /// template @@ -1115,7 +1114,7 @@ public: VertexUVmap uvmap, VertexIndexMap vimap, VertexParameterizedMap vpmap, - const int& iterations = 15) + const unsigned int iterations = 15) { int iter = iterations; // need a non-const ref return parameterize(tmesh, bhd, uvmap, vimap, vpmap, iter); @@ -1125,7 +1124,7 @@ public: Error_code parameterize(Triangle_mesh& tmesh, halfedge_descriptor bhd, VertexUVmap uvmap, - const int iterations = 15) + const unsigned int iterations = 15) { Vertex_int_map vimap = get(Vertex_int_tag(), tmesh); internal::fill_index_map_of_cc(bhd, tmesh, vimap); @@ -1138,7 +1137,7 @@ public: template Error_code parameterize(Triangle_mesh& tmesh, VertexUVmap uvmap, - const int iterations = 15) + const unsigned int iterations = 15) { const halfedge_descriptor bhd = Polygon_mesh_processing::longest_border(tmesh).first; diff --git a/Surface_mesh_parameterization/test/Surface_mesh_parameterization/extensive_parameterization_test.cpp b/Surface_mesh_parameterization/test/Surface_mesh_parameterization/extensive_parameterization_test.cpp index 22f47fda55d..79187d8c4d7 100644 --- a/Surface_mesh_parameterization/test/Surface_mesh_parameterization/extensive_parameterization_test.cpp +++ b/Surface_mesh_parameterization/test/Surface_mesh_parameterization/extensive_parameterization_test.cpp @@ -513,7 +513,7 @@ int main(int, char**) SMP::Iterative_authalic_parameterizer_3 parameterizer; double error = 0; - int iterations = 15; + unsigned int iterations = 15; SMP::Error_code status = parameterizer.parameterize(sm, hd, uvpm, vipm, vpm, iterations, error); SMP::Error_code status_bis = parameterizer.parameterize(sm, uvpm, 10);