本文介绍了从Projection_traits_xy_3的约束Delaunay三角剖分中检索z的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
给出 x,y
,如何检索使用 projection_traits_xy_3
从2.5D构建的2D约束Delaunay三角剖分的 z
坐标?/p>
Given x,y
, how can I retrieve the z
coordinate of a 2D constrained delaunay triangulation built from 2.5D with projection_traits_xy_3
?
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;
我的猜测是我必须取回脸,但是下一步将是什么?
My guess is that I have to retrieve the face, but what would be the next step?
CDT::Point query(10,10,?);
CDT::Face_handle face_handle = cdt.locate(query);
推荐答案
正如@Andreas指出的那样,三角剖分即使使用2D投影也可以存储3D点.因此,我们可以检索 Point_3
.
As @Andreas pointed out, the triangulation stores 3d points even if it uses its 2d projection. Therefore, we can retrieve the 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();
这篇关于从Projection_traits_xy_3的约束Delaunay三角剖分中检索z的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!