如何访问CGAL三维三角测量中的面
How to access the facets in a CGAL 3D triangulation?
我正在使用CGAL计算一组点的3D三角测量:
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Delaunay_triangulation_3<K> CGALTriangulation;
typedef CGALTriangulation::Point Point;
// Construction from a list of points
std::list<Point> points;
points.push_front(Point(0, 0, 0));
points.push_front(Point(2, 0, 0));
points.push_front(Point(0, 2, 0));
points.push_front(Point(2, 2, 0));
points.push_front(Point(1, 1, 1));
// Perform triangulation
CGALTriangulation T(points.begin(), points.end());
访问三角形(镶嵌面(
我需要在Unity中创建一个网格,所以我使用CGAL,因为它有很多算法来处理这个复杂的问题。问题是,在API中很难找到一种方法来访问构成三角测量的不同三角形(以及它们的顶点(,我还没有找到方法:(
注意请注意,仅访问顶点对我来说是不够的:
for (CGALTriangulation::Finite_vertices_iterator it = T.finite_vertices_begin();
it != T.finite_vertices_end();
it++)
{
CGALTriangulation::Triangulation_data_structure::Vertex v = *it;
// Do something with the vertex
}
因为我没有得到任何关于每个顶点属于哪个面(三角形(的信息。三角形正是我需要的!
如何访问三角测量的三角形(小平面(?如何从每个面中提取顶点?
我不知道你能实现什么。三维Delaunay三角剖分是将点的凸包分解为四面体。无论如何,如果要访问三角测量的面,可以使用Finite_facets_iterator。
类似于:
for (CGALTriangulation::Finite_facets_iterator it = T.finite_facets_begin();
it != T.finite_facets_end();
it++)
{
std::pair<CGALTriangulation::Cell_handle, int> facet = *it;
CGALTriangulation::Vertex_handle v1 = facet.first->vertex( (facet.second+1)%4 );
CGALTriangulation::Vertex_handle v2 = facet.first->vertex( (facet.second+2)%4 );
CGALTriangulation::Vertex_handle v3 = facet.first->vertex( (facet.second+3)%4 );
}
如果你对曲面网格感兴趣,你可能想看看重建算法,比如泊松曲面重建或推进前重建。
相关文章:
- 如何访问CGAL三维三角测量中的面
- CGAL 3D 周期性德劳内三角测量与信息的问题
- Fixed_alpha_shape_3() 会破坏或修改原始三角测量吗?
- 编译和运行 CGAL 三角测量演示
- CGAL没有计算完整的德劳内三角测量
- 优化德劳奈三角测量算法
- 如何使用每个顶点的自定义信息创建CGAL约束的delaunay三角测量
- CGAL 2.5D 三角测量 附加顶点信息
- 计算从德劳内三角测量获得的三角形的边长
- 在二维三角测量中添加约束时出错
- 在二维德劳奈三角测量中插入顶点时出错
- 视觉Opencv;C++;从线性三角测量法矩阵中提取点云点(x,y,z)
- visual有人在C++项目中使用过Triangle/Tangle++库吗?(delaunay三角测量)
- CGAL - 在德劳奈三角测量后检索顶点索引
- 如何对圆进行德劳内三角测量
- 如何从Subdiv2D Delaunay三角测量中获取顶点索引
- 配置 VS2010 用于贪婪投影三角测量
- 为什么opencv的三角测量点返回错误的结果?
- OpenCV:如何进行 Delaunay 三角测量并返回邻接矩阵
- OpenCV,C++:Missing Triangles in Delaunay三角测量