【问题标题】:Retrieve z from a constrained delaunay triangulation of Projection_traits_xy_3从 Projection_traits_xy_3 的约束 delaunay 三角剖分中检索 z
【发布时间】:2015-11-24 10:55:02
【问题描述】:

给定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);

【问题讨论】:

    标签: cgal


    【解决方案1】:

    Triangulation::Point 将是一个 3D 点,因此 face_handle-&gt;vertex(0)-&gt;point() 将是一个具有 z 坐标的 3D 点。

    【讨论】:

    • 正确。我已经弄清楚了。我已经发布了完整的答案。
    【解决方案2】:

    正如@Andreas 指出的那样,即使使用 2d 投影,三角剖分也会存储 3d 点。因此,我们可以检索到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();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-07-15
      • 1970-01-01
      • 1970-01-01
      • 2013-12-06
      • 1970-01-01
      • 2015-01-07
      • 2012-04-06
      相关资源
      最近更新 更多