【问题标题】:How to determine if a vertex is on the border in a mesh in CGAL如何确定顶点是否在CGAL网格的边界上
【发布时间】:2014-05-15 12:58:39
【问题描述】:

我正在尝试为每个顶点计算 3D 网格上的高斯曲率,所以我想知道顶点是否在边界上,我查看了 CGAL 在线手册,找不到检查顶点是否打开的方法边框,所以我写了一个函数,它循环遍历顶点周围的半边来检查这个,代码是:

bool is_border(Vertex_iterator& vi){
  HV_circulator hv = vi-> vertex_begin();
  //move around the vertex and check if there is a halfedge which
  //is on border
  for(; hv != vi -> vertex_begin(); vi++){
    if(hv -> is_border())
      return true;
  }
  return false;
}

所以我的问题是,有没有其他方法可以检查顶点是否在边界上?

【问题讨论】:

    标签: c++ cgal


    【解决方案1】:

    不,没有。您实施的解决方案是我推荐的解决方案,但使用Vertex_handle 而不是Vertex_iterator,因为后者隐式转换为前者。

    那个函数is_border 相当昂贵。如果您需要在同一个顶点上多次调用它,无论出于何种原因,您都应该投资一种方法来缓存结果。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-01-08
      • 1970-01-01
      • 1970-01-01
      • 2013-08-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多