从 Projection_traits_xy_3 的约束 delaunay 三角剖分中检索 z
Retrieve z from a constrained delaunay triangulation of Projection_traits_xy_3
给定 x,y
,我如何检索使用 projection_traits_xy_3
从 2.5D 构建的 2D 约束 delaunay 三角剖分的 z
坐标?
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Projection_traits_xy_3<K> Gt;
typedef CGAL::Triangulation_vertex_base_2<Gt> Vb;
typedef CGAL::Delaunay_mesh_face_base_2<Gt> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb, Fb> Tds;
typedef CGAL::Constrained_Delaunay_triangulation_2<Gt, Tds> CDT;
我的猜测是我必须取回人脸,但下一步是什么?
CDT::Point query(10,10,?);
CDT::Face_handle face_handle = cdt.locate(query);
Triangulation::Point 将是 3D 点,因此 face_handle->vertex(0)->point()
将是具有 z 坐标的 3D 点。
正如@Andreas 指出的那样,三角测量存储 3d 点,即使它使用其 2d 投影。因此,我们可以检索 Point_3
.
给定查询点(x,y) = (100,100)
:
//z unknown
Point query1(100, 100, 0);
CDT::Face_handle face_handle = cdt.locate(query1);
K::Point_3 p = face_handle->vertex(0)->point();
K::Point_3 q = face_handle->vertex(1)->point();
K::Point_3 r = face_handle->vertex(2)->point();
给定 x,y
,我如何检索使用 projection_traits_xy_3
从 2.5D 构建的 2D 约束 delaunay 三角剖分的 z
坐标?
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Projection_traits_xy_3<K> Gt;
typedef CGAL::Triangulation_vertex_base_2<Gt> Vb;
typedef CGAL::Delaunay_mesh_face_base_2<Gt> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb, Fb> Tds;
typedef CGAL::Constrained_Delaunay_triangulation_2<Gt, Tds> CDT;
我的猜测是我必须取回人脸,但下一步是什么?
CDT::Point query(10,10,?);
CDT::Face_handle face_handle = cdt.locate(query);
Triangulation::Point 将是 3D 点,因此 face_handle->vertex(0)->point()
将是具有 z 坐标的 3D 点。
正如@Andreas 指出的那样,三角测量存储 3d 点,即使它使用其 2d 投影。因此,我们可以检索 Point_3
.
给定查询点(x,y) = (100,100)
:
//z unknown
Point query1(100, 100, 0);
CDT::Face_handle face_handle = cdt.locate(query1);
K::Point_3 p = face_handle->vertex(0)->point();
K::Point_3 q = face_handle->vertex(1)->point();
K::Point_3 r = face_handle->vertex(2)->point();