2D Delaunay triangulation in CGAL using an arbitrary plane

…衆ロ難τιáo~ 提交于 2020-12-29 07:44:21

问题


I am new to using CGAL, and I was wondering if CGAL supports 2D Delaunay triangulation of 3D points using an arbitrary plane. The example on CGAL's documentation lists only Projection_traits_xy_3<R>, Projection_traits_yz_3<R>, and Projection_traits_xz_3<R>, in other words, projection on the xy plane, the yz plane and the xz plane. Is there any way I can define an arbitrary projection plane instead of using the xy, yz and xz planes?

thanks,


回答1:


There is a template < class Kernel > class Triangulation_2_projection_traits_3 that is not documented and that is defined in the header: CGAL/Triangulation_2_projection_traits_3.h.

You construct the traits class from the plane normal and pass the traits to the triangulation.

Something like the following should work:

 typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
 typedef CGAL::Triangulation_2_projection_traits_3<K> P_traits;
 typedef CGAL::Delaunay_triangulation_2< P_traits > DT2;
 std::vector< K::Point_3 > points
 P_traits traits( K::Vector_3(1,1,1) );
 DT2 dt2(traits);
 dt2.insert(points.begin(), points.end());


来源:https://stackoverflow.com/questions/24443726/2d-delaunay-triangulation-in-cgal-using-an-arbitrary-plane

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!