【问题标题】:CGAL: Delaunay triangulation vs triangulation in CGAL's exampleCGAL:CGAL 示例中的 Delaunay 三角剖分与三角剖分
【发布时间】:2019-09-28 18:26:35
【问题描述】:

在我的工作中,我需要为焦点粒子获取 Voronoi 邻居的第一个壳。为此,我使用了 Delaunay 三角剖分,它是 Voronoi 镶嵌的对偶图。我使用的 CGAL 版本是 4.7。我一直使用 CGAL manual_4.7 中的基本代码作为模板来创建 Delaunay 三角剖分。我的问题在于该示例中的标头和 typedef,因为我最近发现它们与可用的最新版本 CGAL 4.14 不同。在CGAL 4.7:

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Periodic_2_Delaunay_triangulation_2.h>
#include <CGAL/Periodic_2_triangulation_traits_2.h>
#include <CGAL/Triangulation_vertex_base_with_info_2.h>
#include <vector>
typedef CGAL::Exact_predicates_inexact_constructions_kernel         K;
typedef CGAL::Periodic_2_triangulation_traits_2<K>                  Gt;
typedef CGAL::Triangulation_vertex_base_with_info_2<unsigned, Gt>   Vb;
typedef CGAL::Periodic_2_triangulation_face_base_2<Gt>              Fb;
typedef CGAL::Triangulation_data_structure_2<Vb, Fb>                 Tds;
typedef CGAL::Periodic_2_Delaunay_triangulation_2<Gt, Tds>          Delaunay;
typedef Delaunay::Point                                             Point;

CGAL 4.14:

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Periodic_2_Delaunay_triangulation_2.h>
#include <CGAL/Periodic_2_Delaunay_triangulation_traits_2.h>
#include <CGAL/Periodic_2_triangulation_face_base_2.h>
#include <CGAL/Periodic_2_triangulation_vertex_base_2.h>
#include <CGAL/Triangulation_vertex_base_with_info_2.h>
#include <iostream>
#include <vector>
typedef CGAL::Exact_predicates_inexact_constructions_kernel             K;
typedef CGAL::Periodic_2_Delaunay_triangulation_traits_2<K>             Gt;
typedef CGAL::Periodic_2_triangulation_vertex_base_2<Gt>                Vbb;
typedef CGAL::Triangulation_vertex_base_with_info_2<unsigned, Gt, Vbb>  Vb;
typedef CGAL::Periodic_2_triangulation_face_base_2<Gt>                  Fb;
typedef CGAL::Triangulation_data_structure_2<Vb, Fb>                    Tds;
typedef CGAL::Periodic_2_Delaunay_triangulation_2<Gt, Tds>              Delaunay;
typedef Delaunay::Point                                                 Point;

然后我仔细检查了手册,看看解释是否不同。据我了解,Software Design 4.14Software Design 4.7 是相同的,并且与第二个示例匹配。由于我需要具有空圆属性的三角剖分,并且我只需要检索 Delaunay 三角剖分中相邻顶点的索引,第一个是否也会导致相同的结果? 我可以检查它们的某些点,但我只是怀疑它们是否对每组点产生相同的结果?

【问题讨论】:

    标签: cgal triangulation voronoi delaunay


    【解决方案1】:

    这导致完全相同的结果。

    更详细的解释:周期性三角剖分需要一个三角剖分数据结构,其顶点和面提供一定数量的函数和成员,由概念描述(参见P2T2 concepts)。在 CGAL 4.7 中,顶点和面类不满足这些要求:它们缺少一些仅在 P2T2 的少数功能中使用的周期性信息。然而,一切编译和运行都很好,因为示例没有调用这几个函数。一些最近的编译器过于热心,并决定他们希望能够编译该类的所有函数,即使那些没有被调用的函数,因此正在使用的顶点和基类不再令人满意。

    另见https://github.com/CGAL/cgal/pull/3624

    【讨论】:

    • 谢谢。那么,您的意思是使用 Periodic_2_Delaunay_triangulation_traits_2 和 Periodic_2_triangulation_traits_2 也没有区别,都产生 Delaunay 三角剖分?
    • 对不起,我现在才意识到特质也被改变了。这只是另一个清洁修复,没有行为改变。再次更详细地说:以前,Delaunay 三角剖分概念所需的一些特征函数实际上是在非 Delauany 三角剖分特征中实现的,这意味着您可以使用那些非 Delaunay 特征并且它可以正常工作。我重新组织了它,因此当您使用 Delaunay 三角剖分时,您必须使用正确的(Delaunay)特征。这是在github.com/CGAL/cgal/pull/2369 中完成的。
    猜你喜欢
    • 2015-01-07
    • 2019-04-18
    • 2016-02-08
    • 2014-01-21
    • 2021-05-14
    • 2013-05-12
    • 1970-01-01
    • 1970-01-01
    • 2011-11-10
    相关资源
    最近更新 更多