From 05939a56b8b0d27bd8c22fb7874882378aa02c8f Mon Sep 17 00:00:00 2001 From: Laurent Saboret Date: Mon, 6 Mar 2006 15:33:44 +0000 Subject: [PATCH] Removed not-yet-implemented features (as requested by MK): - border parameterization on any convex polygon - check matrix conditioning --- Surface_mesh_parameterization/description.txt | 6 +-- .../doc/concepts/ParameterizerTraits_3.h | 3 +- .../concepts/SparseLinearAlgebraTraits_d.h | 8 +--- .../Surface_mesh_parameterization/basics.tex | 2 +- .../introduction.tex | 2 +- .../parameterization_methods.tex | 2 +- .../Fixed_border_parameterizer_3.tex | 2 +- .../LSCM_parameterizer_3.tex | 2 +- .../ParameterizerTraits_3.tex | 5 +-- .../Parameterizer_traits_3.tex | 5 +-- .../SparseLinearAlgebraTraits_d.tex | 7 ---- .../Taucs_solver_traits.tex | 10 ----- .../Taucs_symmetric_solver_traits.tex | 10 ----- .../intro.tex | 3 -- .../CGAL/Fixed_border_parameterizer_3.h | 33 ++++------------ .../include/CGAL/LSCM_parameterizer_3.h | 39 ++++--------------- .../include/CGAL/Parameterizer_traits_3.h | 8 ++-- .../include/CGAL/Taucs_solver_traits.h | 34 +--------------- .../long_description.txt | 28 ++++++------- 19 files changed, 44 insertions(+), 165 deletions(-) diff --git a/Surface_mesh_parameterization/description.txt b/Surface_mesh_parameterization/description.txt index 23ea5136558..1ab1cd80865 100644 --- a/Surface_mesh_parameterization/description.txt +++ b/Surface_mesh_parameterization/description.txt @@ -10,10 +10,10 @@ methods, such as Least Squares Conformal Maps, Discrete Conformal Map, Discrete Authalic Parameterization, Floater Mean Value Coordinates or Tutte Barycentric Mapping. -The package proposes an interface with the Polyhedron. +The package proposes currently an interface with CGAL Polyhedron_3 data structure. Since parameterizing meshes require efficient representation of sparse matrices -and efficient iterative or direct linear solvers, we provide link to standard -packages (TAUCS) and propose a separate package devoted to OpenNL +and efficient iterative or direct linear solvers, we provide links to standard +libraries (TAUCS) and propose a separate package devoted to OpenNL sparse linear solver (Levy). diff --git a/Surface_mesh_parameterization/doc/concepts/ParameterizerTraits_3.h b/Surface_mesh_parameterization/doc/concepts/ParameterizerTraits_3.h index 79f4837b4b2..4a70b3c2daf 100644 --- a/Surface_mesh_parameterization/doc/concepts/ParameterizerTraits_3.h +++ b/Surface_mesh_parameterization/doc/concepts/ParameterizerTraits_3.h @@ -13,7 +13,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Laurent Saboret, Pierre Alliez, Bruno Levy @@ -37,7 +37,6 @@ public: ERROR_NON_TRIANGULAR_MESH, ///< Error: input mesh is not triangular ERROR_NO_SURFACE_MESH, ///< Error: input mesh is not a surface ERROR_INVALID_BORDER, ///< Error: parameterization requires a convex border - ERROR_BAD_MATRIX_CONDITIONING, ///< Error: result is mathematically unstable ERROR_CANNOT_SOLVE_LINEAR_SYSTEM,///< Error: cannot solve linear system ERROR_NO_1_TO_1_MAPPING, ///< Error: parameterization does not ensure a one-to-one mapping ERROR_NOT_ENOUGH_MEMORY, ///< Error: not enough memory diff --git a/Surface_mesh_parameterization/doc/concepts/SparseLinearAlgebraTraits_d.h b/Surface_mesh_parameterization/doc/concepts/SparseLinearAlgebraTraits_d.h index a25535e12e7..8434f87074d 100644 --- a/Surface_mesh_parameterization/doc/concepts/SparseLinearAlgebraTraits_d.h +++ b/Surface_mesh_parameterization/doc/concepts/SparseLinearAlgebraTraits_d.h @@ -13,7 +13,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Laurent Saboret, Pierre Alliez, Bruno Levy @@ -46,11 +46,5 @@ public: /// - A.row_dimension() == B.dimension(). /// - A.column_dimension() == X.dimension(). bool linear_solver (const Matrix& A, const Vector& B, Vector& X, NT& D); - - /// Indicate if the linear system can be solved and if the matrix conditioning is good. - /// - /// Preconditions: - /// - A.row_dimension() == B.dimension(). - bool is_solvable (const Matrix& A, const Vector& B); }; diff --git a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization/basics.tex b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization/basics.tex index 50f8c37e04e..1158521e2e9 100644 --- a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization/basics.tex +++ b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization/basics.tex @@ -59,7 +59,7 @@ defines the accessor to the (u,v) values computed by parameterizations. The package provides a model of the concept -\ccc{ParameterizationMesh_3} with the Polyhedron: +\ccc{ParameterizationMesh_3} to access \cgal\ \ccc{Polyhedron_3}: \ccc{CGAL::Parameterization_polyhedron_adaptor_3} \\ diff --git a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization/introduction.tex b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization/introduction.tex index b0dad4f79fc..809dd5c957f 100644 --- a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization/introduction.tex +++ b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization/introduction.tex @@ -24,7 +24,7 @@ minimize (angles vs areas), by the constrained border onto the planar domain (convex polygon vs free border) and by the guarantees provided in terms of bijective mapping. -The package proposes currently an interface with \cgal\ Polyhedron_3 +The package proposes currently an interface with \cgal\ \ccc{Polyhedron_3} data structure. Since parameterizing meshes require efficient representation of sparse diff --git a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization/parameterization_methods.tex b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization/parameterization_methods.tex index 021a0bccd70..4a6da6f4051 100644 --- a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization/parameterization_methods.tex +++ b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization/parameterization_methods.tex @@ -7,7 +7,7 @@ where the user can specify a parameterization method: \ccFunction{Parameterizer_traits_3::Error_code parameterize (ParameterizationMesh_3 & mesh, ParameterizerTraits_3 parameterizer);} { Compute a one-to-one mapping from a 3D triangle surface 'mesh' to a simple 2D domain. The mapping is piecewise linear on the triangle mesh. The result is a pair (u,v) of parameter coordinates for each vertex of the input mesh. -One-to-one mapping may be guaranteed or not, depending on the chosen ParametizerTraits\_3 algorithm. +One-to-one mapping may be guaranteed or not, depending on the chosen \ccc{ParametizerTraits_3} algorithm. Preconditions:\begin{itemize} \item 'mesh' must be a surface with one connected component.\item 'mesh' must be a triangular mesh.\item the mesh border must be mapped onto a convex polygon (for fixed border parameterizations).\end{itemize} } diff --git a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Fixed_border_parameterizer_3.tex b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Fixed_border_parameterizer_3.tex index b6fe0c1dbe8..fd6dd9c9c09 100644 --- a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Fixed_border_parameterizer_3.tex +++ b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Fixed_border_parameterizer_3.tex @@ -151,7 +151,7 @@ Copy Xu and Xv coordinates into the (u,v) pair of each surface vertex. \ccMethod{Parameterizer_traits_3< Adaptor >::Error_code check_parameterize_postconditions (const Adaptor & mesh, const Matrix & A, const Vector & Bu, const Vector & Bv);} { Check parameterize() postconditions:\begin{itemize} -\item {\em A$\ast$Xu = Bu} and {\em A$\ast$Xv = Bv} systems are solvable with a good conditioning.\item 3D -$>$ 2D mapping is one-to-one. \end{itemize} +\item 3D -$>$ 2D mapping is one-to-one. \end{itemize} } \ccGlue \ccMethod{bool is_one_to_one_mapping (const Adaptor & mesh, const Matrix & A, const Vector & Bu, const Vector & Bv);} diff --git a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/LSCM_parameterizer_3.tex b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/LSCM_parameterizer_3.tex index d9ff80e84d0..09e149e7edb 100644 --- a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/LSCM_parameterizer_3.tex +++ b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/LSCM_parameterizer_3.tex @@ -150,7 +150,7 @@ Copy X coordinates into the (u,v) pair of each vertex. \ccMethod{Parameterizer_traits_3< Adaptor >::Error_code check_parameterize_postconditions (const Adaptor & mesh, const LeastSquaresSolver & solver);} { Check parameterize() postconditions:\begin{itemize} -\item {\em A$\ast$X = B} system is solvable (in the least squares sense) with a good conditioning.\item 3D -$>$ 2D mapping is one-to-one. \end{itemize} +\item 3D -$>$ 2D mapping is one-to-one. \end{itemize} } \ccGlue \ccMethod{bool is_one_to_one_mapping (const Adaptor & mesh, const LeastSquaresSolver & solver);} diff --git a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/ParameterizerTraits_3.tex b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/ParameterizerTraits_3.tex index 75201191b3e..59f7f355735 100644 --- a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/ParameterizerTraits_3.tex +++ b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/ParameterizerTraits_3.tex @@ -47,7 +47,7 @@ Export the type of mesh to parameterize. % The section below is automatically generated. Do not edit! %START-AUTO(\ccConstants) -\ccEnum{enum Error_code { OK, ERROR_EMPTY_MESH, ERROR_NON_TRIANGULAR_MESH, ERROR_NO_SURFACE_MESH, ERROR_INVALID_BORDER, ERROR_BAD_MATRIX_CONDITIONING, ERROR_CANNOT_SOLVE_LINEAR_SYSTEM, ERROR_NO_1_TO_1_MAPPING, ERROR_NOT_ENOUGH_MEMORY, ERROR_WRONG_PARAMETER };} +\ccEnum{enum Error_code { OK, ERROR_EMPTY_MESH, ERROR_NON_TRIANGULAR_MESH, ERROR_NO_SURFACE_MESH, ERROR_INVALID_BORDER, ERROR_CANNOT_SOLVE_LINEAR_SYSTEM, ERROR_NO_1_TO_1_MAPPING, ERROR_NOT_ENOUGH_MEMORY, ERROR_WRONG_PARAMETER };} { List of errors detected by this package. } @@ -60,8 +60,7 @@ List of errors detected by this package. ]Error: input mesh is empty. \item[ERROR\_NON\_TRIANGULAR\_MESH ]Error: input mesh is not triangular. \item[ERROR\_NO\_SURFACE\_MESH ]Error: input mesh is not a surface. \item[ERROR\_INVALID\_BORDER -]Error: parameterization requires a convex border. \item[ERROR\_BAD\_MATRIX\_CONDITIONING -]Error: result is mathematically unstable. \item[ERROR\_CANNOT\_SOLVE\_LINEAR\_SYSTEM +]Error: parameterization requires a convex border. \item[ERROR\_CANNOT\_SOLVE\_LINEAR\_SYSTEM ]Error: cannot solve linear system. \item[ERROR\_NO\_1\_TO\_1\_MAPPING ]Error: parameterization does not ensure a one-to-one mapping. \item[ERROR\_NOT\_ENOUGH\_MEMORY ]Error: not enough memory. \item[ERROR\_WRONG\_PARAMETER diff --git a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Parameterizer_traits_3.tex b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Parameterizer_traits_3.tex index c47017e3da4..601a7a9566c 100644 --- a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Parameterizer_traits_3.tex +++ b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Parameterizer_traits_3.tex @@ -76,7 +76,7 @@ Export ParameterizationMesh\_3 template parameter. % The section below is automatically generated. Do not edit! %START-AUTO(\ccConstants) -\ccEnum{enum Error_code { OK, ERROR_EMPTY_MESH, ERROR_NON_TRIANGULAR_MESH, ERROR_NO_SURFACE_MESH, ERROR_INVALID_BORDER, ERROR_BAD_MATRIX_CONDITIONING, ERROR_CANNOT_SOLVE_LINEAR_SYSTEM, ERROR_NO_1_TO_1_MAPPING, ERROR_NOT_ENOUGH_MEMORY, ERROR_WRONG_PARAMETER };} +\ccEnum{enum Error_code { OK, ERROR_EMPTY_MESH, ERROR_NON_TRIANGULAR_MESH, ERROR_NO_SURFACE_MESH, ERROR_INVALID_BORDER, ERROR_CANNOT_SOLVE_LINEAR_SYSTEM, ERROR_NO_1_TO_1_MAPPING, ERROR_NOT_ENOUGH_MEMORY, ERROR_WRONG_PARAMETER };} { List of errors detected by this package. } @@ -89,8 +89,7 @@ List of errors detected by this package. ]input mesh is empty \item[ERROR\_NON\_TRIANGULAR\_MESH ]input mesh is not triangular \item[ERROR\_NO\_SURFACE\_MESH ]input mesh is not a surface \item[ERROR\_INVALID\_BORDER -]parameterization requires a convex border \item[ERROR\_BAD\_MATRIX\_CONDITIONING -]result is mathematically unstable \item[ERROR\_CANNOT\_SOLVE\_LINEAR\_SYSTEM +]parameterization requires a convex border \item[ERROR\_CANNOT\_SOLVE\_LINEAR\_SYSTEM ]cannot solve linear system \item[ERROR\_NO\_1\_TO\_1\_MAPPING ]parameterization does not ensure a one-to-one mapping \item[ERROR\_NOT\_ENOUGH\_MEMORY ]not enough memory \item[ERROR\_WRONG\_PARAMETER diff --git a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/SparseLinearAlgebraTraits_d.tex b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/SparseLinearAlgebraTraits_d.tex index 4493f63660e..c6d648921d5 100644 --- a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/SparseLinearAlgebraTraits_d.tex +++ b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/SparseLinearAlgebraTraits_d.tex @@ -89,13 +89,6 @@ Preconditions:\begin{itemize} \item A.row\_dimension() == B.dimension().\item A.column\_dimension() == X.dimension(). \end{itemize} } \ccGlue -\ccMethod{bool is_solvable (const Matrix & A, const Vector & B);} -{ -Indicate if the linear system can be solved and if the matrix conditioning is good. -Preconditions:\begin{itemize} -\item A.row\_dimension() == B.dimension(). \end{itemize} -} -\ccGlue %END-AUTO(\ccOperations) diff --git a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Taucs_solver_traits.tex b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Taucs_solver_traits.tex index 0da33a7d1b8..96e7aeade3c 100644 --- a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Taucs_solver_traits.tex +++ b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Taucs_solver_traits.tex @@ -104,16 +104,6 @@ Preconditions:\begin{itemize} \item A.row\_dimension() == B.dimension().\item A.column\_dimension() == X.dimension(). \end{itemize} } \ccGlue -\ccMethod{bool is_solvable (const Matrix & A, const Vector & B);} -{ -Indicate if the linear system can be solved and if the matrix conditioning is good. -Preconditions:\begin{itemize} -\item A.row\_dimension() == B.dimension().\end{itemize} -} -\ccGlue -\begin{description} -\item[Todo]Implement Taucs\_solver\_traits::is\_solvable() by solving the system, then checking that $|$ $|$$|$A$\ast$X$|$$|$/$|$$|$B$|$$|$ - 1 $|$ $<$ epsilon. \end{description} -\ccGlue %END-AUTO(\ccOperations) diff --git a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Taucs_symmetric_solver_traits.tex b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Taucs_symmetric_solver_traits.tex index c065fad46f2..bbcd0b2879b 100644 --- a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Taucs_symmetric_solver_traits.tex +++ b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/Taucs_symmetric_solver_traits.tex @@ -111,16 +111,6 @@ Preconditions:\begin{itemize} \item A.row\_dimension() == B.dimension().\item A.column\_dimension() == X.dimension(). \end{itemize} } \ccGlue -\ccMethod{bool is_solvable (const Matrix & A, const Vector & B);} -{ -Indicate if the linear system can be solved and if the matrix conditioning is good. -Preconditions:\begin{itemize} -\item A.row\_dimension() == B.dimension().\end{itemize} -} -\ccGlue -\begin{description} -\item[Todo]Implement Taucs\_symmetric\_solver\_traits::is\_solvable() by solving the system, then checking that $|$ $|$$|$A$\ast$X$|$$|$/$|$$|$B$|$$|$ - 1 $|$ $<$ epsilon. \end{description} -\ccGlue %END-AUTO(\ccOperations) diff --git a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/intro.tex b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/intro.tex index 946e0d351ed..9c0bc478bbe 100644 --- a/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/intro.tex +++ b/Surface_mesh_parameterization/doc_tex/Surface_mesh_parameterization_ref/intro.tex @@ -85,8 +85,6 @@ vertices). They have to be on the specified border. \item one shape among a set of standard ones (circle, square). - \item a convex polygon. - \end{itemize} \end{itemize} @@ -167,7 +165,6 @@ For \emph{fixed} border parameterizations: \item Postconditions: \begin{itemize} \item check one-to-one mapping. - \item check if the linear system was solved with a good conditioning (expensive check). \end{itemize} \end{itemize} diff --git a/Surface_mesh_parameterization/include/CGAL/Fixed_border_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Fixed_border_parameterizer_3.h index 547a3afba77..05ff53bb639 100644 --- a/Surface_mesh_parameterization/include/CGAL/Fixed_border_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Fixed_border_parameterizer_3.h @@ -13,7 +13,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Laurent Saboret, Pierre Alliez, Bruno Levy @@ -202,7 +202,6 @@ protected: const Vector& Xu, const Vector& Xv); /// Check parameterize() postconditions: - /// - "A*Xu = Bu" and "A*Xv = Bv" systems are solvable with a good conditioning. /// - 3D -> 2D mapping is one-to-one. virtual Error_code check_parameterize_postconditions(const Adaptor& mesh, const Matrix& A, @@ -326,7 +325,7 @@ parameterize(Adaptor& mesh) } } #ifdef DEBUG_TRACE - std::cerr << " matrix filling (" << nbVertices << " x " << nbVertices << "): " + std::cerr << " matrix filling (" << nbVertices << " x " << nbVertices << "): " << timer.time() << " seconds." << std::endl; timer.reset(); #endif @@ -354,7 +353,7 @@ parameterize(Adaptor& mesh) // Copy Xu and Xv coordinates into the (u,v) pair of each vertex set_mesh_uv_from_system (mesh, Xu, Xv); #ifdef DEBUG_TRACE - std::cerr << " copy computed UVs to mesh :" + std::cerr << " copy computed UVs to mesh :" << timer.time() << " seconds." << std::endl; timer.reset(); #endif @@ -392,7 +391,7 @@ check_parameterize_preconditions(Adaptor& mesh) // Allways check that mesh is not empty if (mesh.mesh_vertices_begin() == mesh.mesh_vertices_end()) status = Base::ERROR_EMPTY_MESH; - if (status != Base::OK) + if (status != Base::OK) return status; // The whole surface parameterization package is restricted to triangular meshes @@ -400,7 +399,7 @@ check_parameterize_preconditions(Adaptor& mesh) status = mesh.is_mesh_triangular() ? Base::OK \ : Base::ERROR_NON_TRIANGULAR_MESH; \ ); - if (status != Base::OK) + if (status != Base::OK) return status; // The whole package is restricted to surfaces: genus = 0, @@ -423,7 +422,7 @@ check_parameterize_preconditions(Adaptor& mesh) ? Base::OK \ : Base::ERROR_INVALID_BORDER; \ ); - if (status != Base::OK) + if (status != Base::OK) return status; return status; @@ -538,7 +537,6 @@ set_mesh_uv_from_system(Adaptor& mesh, } /// Check parameterize() postconditions: -/// - "A*Xu = Bu" and "A*Xv = Bv" systems are solvable with a good conditioning. /// - 3D -> 2D mapping is one-to-one. template inline @@ -551,30 +549,13 @@ check_parameterize_postconditions(const Adaptor& mesh, { Error_code status = Base::OK; - // Check if "A*Xu = Bu" and "A*Xv = Bv" systems - // are solvable with a good conditioning - CGAL_surface_mesh_parameterization_expensive_postcondition_code(\ - status = get_linear_algebra_traits().is_solvable(A, Bu) \ - ? Base::OK \ - : Base::ERROR_BAD_MATRIX_CONDITIONING; \ - ); - if (status != Base::OK) - return status; - CGAL_surface_mesh_parameterization_expensive_postcondition_code(\ - status = get_linear_algebra_traits().is_solvable(A, Bv) \ - ? Base::OK \ - : Base::ERROR_BAD_MATRIX_CONDITIONING; \ - ); - if (status != Base::OK) - return status; - // Check if 3D -> 2D mapping is one-to-one CGAL_surface_mesh_parameterization_postcondition_code( \ status = is_one_to_one_mapping(mesh, A, Bu, Bv) \ ? Base::OK \ : Base::ERROR_NO_1_TO_1_MAPPING; \ ); - if (status != Base::OK) + if (status != Base::OK) return status; return status; diff --git a/Surface_mesh_parameterization/include/CGAL/LSCM_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/LSCM_parameterizer_3.h index c36734c6150..71c55a3fbb8 100644 --- a/Surface_mesh_parameterization/include/CGAL/LSCM_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/LSCM_parameterizer_3.h @@ -13,7 +13,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Laurent Saboret, Pierre Alliez, Bruno Levy @@ -194,8 +194,6 @@ protected: const LeastSquaresSolver& solver) ; /// Check parameterize() postconditions: - /// - "A*X = B" system is solvable (in the least squares sense) - /// with a good conditioning. /// - 3D -> 2D mapping is one-to-one. virtual Error_code check_parameterize_postconditions(const Adaptor& mesh, const LeastSquaresSolver& solver); @@ -310,7 +308,7 @@ parameterize(Adaptor& mesh) } solver.end_system() ; #ifdef DEBUG_TRACE - std::cerr << " matrix filling (" << 2*mesh.count_mesh_facets() << " x " << nbVertices << "): " + std::cerr << " matrix filling (" << 2*mesh.count_mesh_facets() << " x " << nbVertices << "): " << timer.time() << " seconds." << std::endl; timer.reset(); #endif @@ -329,7 +327,7 @@ parameterize(Adaptor& mesh) // Copy X coordinates into the (u,v) pair of each vertex set_mesh_uv_from_system(mesh, solver); #ifdef DEBUG_TRACE - std::cerr << " copy computed UVs to mesh :" + std::cerr << " copy computed UVs to mesh :" << timer.time() << " seconds." << std::endl; timer.reset(); #endif @@ -365,7 +363,7 @@ check_parameterize_preconditions(Adaptor& mesh) // Allways check that mesh is not empty if (mesh.mesh_vertices_begin() == mesh.mesh_vertices_end()) status = Base::ERROR_EMPTY_MESH; - if (status != Base::OK) + if (status != Base::OK) return status; // The whole surface parameterization package is restricted to triangular meshes @@ -373,7 +371,7 @@ check_parameterize_preconditions(Adaptor& mesh) status = mesh.is_mesh_triangular() ? Base::OK \ : Base::ERROR_NON_TRIANGULAR_MESH; \ ); - if (status != Base::OK) + if (status != Base::OK) return status; // The whole package is restricted to surfaces: genus = 0, @@ -386,7 +384,7 @@ check_parameterize_preconditions(Adaptor& mesh) ? Base::OK \ : Base::ERROR_NO_SURFACE_MESH; \ ); - if (status != Base::OK) + if (status != Base::OK) return status; return status; @@ -591,8 +589,6 @@ set_mesh_uv_from_system(Adaptor& mesh, } /// Check parameterize() postconditions: -/// - "A*X = B" system is solvable (in the least squares sense) -/// with a good conditioning. /// - 3D -> 2D mapping is one-to-one. template inline @@ -603,34 +599,13 @@ check_parameterize_postconditions(const Adaptor& mesh, { Error_code status = Base::OK; - /* LS 02/2005: commented out this section because OpenNL::LinearSolver - * does not provide a is_solvable() method - * - // Check if "A*Xu = Bu" and "A*Xv = Bv" systems - // are solvable with a good conditioning - CGAL_surface_mesh_parameterization_expensive_postcondition_code(\ - status = get_linear_algebra_traits().is_solvable(A, Bu) \ - ? Base::OK \ - : Base::ERROR_BAD_MATRIX_CONDITIONING; \ - ); - if (status != Base::OK) - return status; - CGAL_surface_mesh_parameterization_expensive_postcondition_code(\ - status = get_linear_algebra_traits().is_solvable(A, Bv) \ - ? Base::OK \ - : Base::ERROR_BAD_MATRIX_CONDITIONING; \ - ); - if (status != Base::OK) - return status; - */ - // Check if 3D -> 2D mapping is one-to-one CGAL_surface_mesh_parameterization_postcondition_code( \ status = is_one_to_one_mapping(mesh, solver) \ ? Base::OK \ : Base::ERROR_NO_1_TO_1_MAPPING; \ ); - if (status != Base::OK) + if (status != Base::OK) return status; return status; diff --git a/Surface_mesh_parameterization/include/CGAL/Parameterizer_traits_3.h b/Surface_mesh_parameterization/include/CGAL/Parameterizer_traits_3.h index 9ee392adfc8..7a126cfa5fc 100644 --- a/Surface_mesh_parameterization/include/CGAL/Parameterizer_traits_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Parameterizer_traits_3.h @@ -13,7 +13,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Laurent Saboret, Pierre Alliez, Bruno Levy @@ -55,7 +55,6 @@ public: ERROR_NON_TRIANGULAR_MESH, ///< input mesh is not triangular ERROR_NO_SURFACE_MESH, ///< input mesh is not a surface ERROR_INVALID_BORDER, ///< parameterization requires a convex border - ERROR_BAD_MATRIX_CONDITIONING, ///< result is mathematically unstable ERROR_CANNOT_SOLVE_LINEAR_SYSTEM,///< cannot solve linear system ERROR_NO_1_TO_1_MAPPING, ///< parameterization does not ensure a one-to-one mapping ERROR_NOT_ENOUGH_MEMORY, ///< not enough memory @@ -123,20 +122,19 @@ public: static const char* get_error_message(int error_code) { // Messages corresponding to Error_code list above. Must be kept in sync! - static const char* error_message[10] = { + static const char* error_message[9] = { "Success", "Input mesh is empty", "Input mesh is not triangular", "Input mesh is not a surface", "Parameterization requires a convex border", - "Result is mathematically unstable", "Cannot solve linear system", "Parameterization does not ensure a one-to-one mapping", "Not enough memory", "A method received an unexpected parameter" }; - if(error_code > 10 || error_code < 0) + if(error_code > 9 || error_code < 0) return "Unknown error"; else return error_message[error_code]; diff --git a/Surface_mesh_parameterization/include/CGAL/Taucs_solver_traits.h b/Surface_mesh_parameterization/include/CGAL/Taucs_solver_traits.h index 7a6caeeb0ca..018fdcf67cd 100644 --- a/Surface_mesh_parameterization/include/CGAL/Taucs_solver_traits.h +++ b/Surface_mesh_parameterization/include/CGAL/Taucs_solver_traits.h @@ -13,7 +13,7 @@ // // $URL$ // $Id$ -// +// // // Author(s) : Laurent Saboret, Pierre Alliez, Bruno Levy @@ -153,22 +153,6 @@ public: } } - /// Indicate if the linear system can be solved and if the matrix conditioning is good. - /// - /// Preconditions: - /// - A.row_dimension() == B.dimension(). - /// - /// @todo Implement Taucs_symmetric_solver_traits::is_solvable() by solving the system, - /// then checking that | ||A*X||/||B|| - 1 | < epsilon. - bool is_solvable (const Matrix& A, const Vector& B) - { - // This feature is not implemented in TAUCS => we do only basic checking - if (A.row_dimension() != B.dimension()) - return false; - - return true; - } - private: /// Test if a floating point number is (close to) 0.0. @@ -325,22 +309,6 @@ public: } } - /// Indicate if the linear system can be solved and if the matrix conditioning is good. - /// - /// Preconditions: - /// - A.row_dimension() == B.dimension(). - /// - /// @todo Implement Taucs_solver_traits::is_solvable() by solving the system, - /// then checking that | ||A*X||/||B|| - 1 | < epsilon. - bool is_solvable (const Matrix& A, const Vector& B) - { - // This feature is not implemented in TAUCS => we do only basic checking - if (A.row_dimension() != B.dimension()) - return false; - - return true; - } - private: /// Test if a floating point number is (close to) 0.0. diff --git a/Surface_mesh_parameterization/long_description.txt b/Surface_mesh_parameterization/long_description.txt index db291b98447..b987cef970e 100644 --- a/Surface_mesh_parameterization/long_description.txt +++ b/Surface_mesh_parameterization/long_description.txt @@ -11,7 +11,7 @@ Parameterizing a surface amounts to finding a one-to-one mapping from a suitable 2 Proposal -We propose to elaborate upon a CGAL Package which implements some of the state-of-the-art surface mesh parameterization methods, such as Least Squares Conformal Maps, Discrete Conformal Map, Discrete Authalic Parameterization, Floater Mean Value Coordinates or Tutte Barycentric Mapping. The package will propose an interface with the Polyhedron. Since parameterizing meshes require efficient representation of sparse matrices and efficient iterative or direct linear solvers, we plan to evaluate the standard packages or propose a separate package devoted to linear algebra. +We propose to elaborate upon a CGAL Package which implements some of the state-of-the-art surface mesh parameterization methods, such as Least Squares Conformal Maps, Discrete Conformal Map, Discrete Authalic Parameterization, Floater Mean Value Coordinates or Tutte Barycentric Mapping. The package will propose an interface with CGAL Polyhedron_3 data structure. Since parameterizing meshes require efficient representation of sparse matrices and efficient iterative or direct linear solvers, we plan to evaluate the standard packages or propose a separate package devoted to linear algebra. 3 Intended Audience @@ -22,8 +22,8 @@ The intended audience of this package is researchers, developers or students dev 4.1 Input * A triangulated mesh: - - 2-manifold - - Oriented + - 2-manifold, + - Oriented, - One connected component. The input mesh can be of any genus, -but- it has to come with a description of a border (a list of oriented edges given by a set or vertices) which is the border of a topological disc. If no border is given, we assume that it coincides with the unique border already in the input mesh. Note that this way the user is responsible for cutting a closed mesh of arbitrary genus (even a topological disc with an intricate seam cut), as long as this condition is verified. @@ -32,42 +32,38 @@ The input mesh can be of any genus, -but- it has to come with a description of a - For fixed border methods: + a list of constraints given by the user. The whole border has to be specified. + one convex shape specified by: - -> one shape among a set of standard ones (circle, square, equilateral triangle). - -> a convex polygon. - -> for both cases above the user can also select a border parameterization among two common methods: uniform or arc-length parameterization. + -> one shape among a set of standard ones (circle, square). + -> the user can also select a border parameterization among two common methods: uniform or arc-length parameterization. 4.2 Output -One uv coordinate for each interior vertex, and one uv coordinate for each instance of a vertex along the input border. It can be e.g. output in a list of 2D points through an output iterator. +One uv coordinate for each interior vertex, and one uv coordinate for each instance of a vertex along the input border. 4.3 Features * Parameterizations: - Fixed border: - + Tutte Barycentric Mapping (guaranteed one-to-one mapping for convex border). + + Tutte Barycentric Mapping (one-to-one mapping is guaranteed for convex border). + Floater Mean Value Coordinates (ditto). + Discrete Conformal Map (conditionally guaranteed if all weights positive and convex border). + Discrete Authalic Parameterization (ditto). - + Others? (e.g. inverse, centripetal). - Free border: + Least Squares Conformal Maps. * Constraint builder: for fixed border methods, generates a set of constraints. * Mesh data structure: it has to be interfaced with 3D Polyhedron. + * Preconditions (may be turned off): - - assert triangle mesh (for polyhedron). + - assert triangle mesh. - assert convex polygon for fixed border methods. - - assert genus (does the specified border bound -a topological disc?). + - assert genus (does the specified border bound a topological disc?). * Post conditions: - - assess all positive coefficients (to ensure a one-to-one mapping) - - assess matrix conditioning (reliability of solution). + - check one-to-one mapping. * Linear Algebra: -Although they are often tightly coupled, there are 2 -main components: +Although they are often tightly coupled, there are 2 main components: - Data structure for sparse matrices - Linear solver (direct or iterative) The CGAL parameterization package will be loosely linked to the solver. Replacing it will be easy.