Fix surface_mesh_deformation in Cgal, code copy to error elsewhere

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.