CGAL 带约束的Delaunay三角剖分 (Projection)
本文使用CGAL进行简单的2D Delaunay 三角剖分,添加内外边界及点作为约束剖分,输入数据为三维点,输出结果保存为Surface_Mesh,同时保存为二进制PLY文件。
Code
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Projection_traits_xy_3.h>
#include <CGAL/boost/graph/copy_face_graph.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Surface_mesh/IO/PLY.h>
#include <CGAL/Constrained_Delaunay_triangulation_2.h>
#include <CGAL/draw_triangulation_2.h>
#include <CGAL/mark_domain_in_triangulation.h>
#include <CGAL/Polygon_2.h>
#include <iostream>
#include <unordered_map>
#include <boost/property_map/property_map.hpp>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Projection_traits_xy_3<K> Projection_traits;
typedef CGAL::Triangulation_vertex_base_2<Projection_traits> Vb;
typedef CGAL::Constrained_triangulation_face_base_2<Projection_traits> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb, Fb> TDS;