Projection_traits_xy_3 的约束 delaunay 三角剖分
Constrained delaunay triangulation with Projection_traits_xy_3
如何将 Constrained_Delaunay_triangulation_2
与 3d 数据一起使用?之后我需要显示一个网格。
根据文档,Projection_traits_xy_3
是 ConstrainedTriangulationTraits_2
的模型。如何正确输入 CDT?
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Projection_traits_xy_3<K> Gt;
typedef K::Point_3 Point;
typedef CGAL::Triangulation_vertex_base_2<K> Vb;
typedef CGAL::Delaunay_mesh_face_base_2<K> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb, Fb> Tds;
typedef CGAL::Constrained_Delaunay_triangulation_2<K, Tds> CDT;
//-or-
typedef CGAL::Constrained_Delaunay_triangulation_2<Gt, K, Tds> CDT;
//-or what?-
typedef CGAL::Delaunay_mesh_size_criteria_2<CDT> Criteria;
typedef CGAL::Delaunay_mesher_2<CDT, Criteria> Mesher;
typedef CDT::Vertex_handle Vertex_handle;
//what should Point be?
//typedef CDT::Point Point;
int main(int argc, char *argv[])
{
const char* fname = (argc>1)?argv[1]:"../sampledata/dtm_ground.xyz";
std::vector<Point> points;
std::ifstream stream(fname);
if (!stream || !CGAL::read_xyz_points(stream,
std::back_inserter(points),
CGAL::Identity_property_map<Point>()))
{
std::cerr << "Error: cannot read file " << fname << std::endl;
return EXIT_FAILURE;
}
CDT cdt(points.begin(), points.end());
//CGAL::refine_Delaunay_mesh_2(cdt, Criteria(0.125, 0.5));
//std::cout << "Number of vertices: " << cdt.number_of_vertices() << std::endl;
return EXIT_SUCCESS;
}
所有三角剖分class的特征class参数必须是Gt
。
Constrained triangulation 的按范围插入构造函数需要一定范围的约束。您可以改用插入功能。
如何将 Constrained_Delaunay_triangulation_2
与 3d 数据一起使用?之后我需要显示一个网格。
根据文档,Projection_traits_xy_3
是 ConstrainedTriangulationTraits_2
的模型。如何正确输入 CDT?
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Projection_traits_xy_3<K> Gt;
typedef K::Point_3 Point;
typedef CGAL::Triangulation_vertex_base_2<K> Vb;
typedef CGAL::Delaunay_mesh_face_base_2<K> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb, Fb> Tds;
typedef CGAL::Constrained_Delaunay_triangulation_2<K, Tds> CDT;
//-or-
typedef CGAL::Constrained_Delaunay_triangulation_2<Gt, K, Tds> CDT;
//-or what?-
typedef CGAL::Delaunay_mesh_size_criteria_2<CDT> Criteria;
typedef CGAL::Delaunay_mesher_2<CDT, Criteria> Mesher;
typedef CDT::Vertex_handle Vertex_handle;
//what should Point be?
//typedef CDT::Point Point;
int main(int argc, char *argv[])
{
const char* fname = (argc>1)?argv[1]:"../sampledata/dtm_ground.xyz";
std::vector<Point> points;
std::ifstream stream(fname);
if (!stream || !CGAL::read_xyz_points(stream,
std::back_inserter(points),
CGAL::Identity_property_map<Point>()))
{
std::cerr << "Error: cannot read file " << fname << std::endl;
return EXIT_FAILURE;
}
CDT cdt(points.begin(), points.end());
//CGAL::refine_Delaunay_mesh_2(cdt, Criteria(0.125, 0.5));
//std::cout << "Number of vertices: " << cdt.number_of_vertices() << std::endl;
return EXIT_SUCCESS;
}
所有三角剖分class的特征class参数必须是Gt
。
Constrained triangulation 的按范围插入构造函数需要一定范围的约束。您可以改用插入功能。