CGAL是Computational Geometry Algorithms Library 的简称,主页是:http://www.cgal.org/。在主页的左栏有Mailing Lists,在这里有很多人在使用该库遇到问题时寻求帮助,然后专业人士给予解答。因此解决问题相对权威一点。在这里多看看, 还可以学到地道的专业英语呢, 嘿嘿!
回到正题,如何使用CGAL进行布尔运算。使用CGAL是一个比较麻烦的过程,首先是配置环境问题,这是一项很耗大的工程,比较完整的配法在这里:http://acg.cs.tau.ac.il/cgal-at-tau/installing-cgal-and-related-programs-on-windows。 其实也没有必要完全照搬这里的配置办法,我的建议是最好下载安装版来(即setup.exe)安装比较好,如果是Source Code则相对较麻烦些。 我的安装笔记如下:
Preparations before Installing CGAL
1. If you use Visual Studio 2008, then you must install SP1.
2. No matter when your computer is 64-bit or 32-bit, please note that you should choose 32-bit when you configure, not only in the process of installing CGAL.exe, but also in configuration with CMAKE.
3. in the process of installing Boost or CGAL, should choose the option: Add to path.
4. download relevant exe files: cmake-2.8.0-win32-x86.exe; boost_1_40_setup.exe; CGAL-3.5.1-Setup.exe
NOTE: Don't leave blank in the installation paths.
Installing:
Step 1. Install boost 1.40. Don't forget to copy "tools/jam/src/bin.ntx86/bjam.exe" to the BOOST_ROOT directory. And then run it.
Step 2. Install CMake 2.8.
Step 3. Install CGAL 3.5.1. Platform: choose 32-bit
After this, go into the CGAL root directory (dos mode), type "cmake-gui ." command, then do the following configuration:
[Advanced view]: must add following variables
BOOST_ROOT = .../boost_1_40
Boost_INCLUDE_DIR (=C:/boost/boost_1_40), and edit the variables Boost_THREAD_LIBRARY_DEBUG (=C:/boost/boost_1_40_0/lib/libboost_thread-vc90-mt-gd-1_40.lib) and Boost_THREAD_LIBRARY_RELEASE (= C:/boost/boost_1_40_0/lib/libboost_thread-vc90-mt-1_40.lib)
Then configure and generate...
[Debug and Release]
NOTE: If you configure improperly and want to reconfigure it, t