I just want to say that I have encountered many wonderful bugs ah ... I was so drunk that I could debug a mistake like that.
After cgal4.5, there are example to realize surface_mesh_deformation.
1. How do I compile example properly?
It is best to compile Cgal, cmake in the entry, check the With_eigen, and then configure the Include directory.
This will be convenient, so compile cgal, you should check the external library, the use of the first plus.
If you do not want to recompile cgal, select With_eigen when you re-compile the example and demo surface_mesh_deformation with CMake.
2. When you run example, copy the code to your project as it is, and the compilation will error TTTTTTT
1>c:\program Files\cgal-4.6.1\include\cgal/surface_mesh_deformation.h (212): Error C2039: ' Matrix ': is not a Member of ' Cgal::D efault '
1> C:\Program files\cgal-4.6.1\include\cgal/default.h (+): See Declaration of ' Cgal::D efault '
1> ModelDecompoent.cpp (245): see reference to class template instantiation ' Cgal::surface_mesh_deformatio N
1> with
1> [
1> Hg=polyhedron
1>]
......a bunch of mistakes .
The wall says add
#define cgal_eigen3_enabled. because look in the Cgal/surface_mesh_deformation.h code: #if defined (cgal_eigen3_enabled)
#include <CGAL/Eigen_solver_traits.h>//For sparse linear system solver
#include <CGAL/Deformation_Eigen_polar_closest_rotation_traits_3.h>//for 3x3 closest rotation computer
#endif
it means that cgal_eigen3_enabled was define to be able.
however I added and did not use!!!
for what? because the order is reversed = =
the correct order:
#define Cgal_eigen3_enabled
#include <cgal/surface_mesh_deformation.h>
Order of Errors: #include <cgal/surface_mesh_deformation.h>
#define Cgal_eigen3_enabled//this way all include, define still have what use ...
It's a wonderful bug.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Fix surface_mesh_deformation in Cgal, code copy to error elsewhere