在cgal :: surface_mesh中找到某个原始的邻居
Find all neighbours of a certain primitive in a CGAL::Surface_mesh
我写了一个带有CGAL树加速的小型射线tracer(带有cgal :: surface_mesh网格(。我想找到一个命中的所有邻居。
Ray_intersection hit = tree.first_intersection(rays[y][x]);
if(hit)
{
const Point& point = boost::get<Point>(hit->first);
const Primitive_id& primitive_id = boost::get<Primitive_id>(hit->second);
//i need the neighbours of the hit primitive
}
我该如何?我找到了此文档,但似乎仅适用于点,而不是原语:
https://doc.cgal.org/latest/spatial_searching/index.html
它搜索其欧几里得距离,而不是连接在一起。
有类似的东西:
std::vector<Primitive_id&> ids = getNeighoursOfPrimive(primitive_id);
就像我说的那样,我正在使用cgal :: surface_mesh网状网格,它们的网格仅是一个网格。
您可以使用vertices_around_face()
返回的范围获取面部的所有顶点,然后对于每个顶点,您可以使用halfedges_around_target()
返回的范围将每个脸部的半edge事件接收到该顶点(该顶点(或者,您可以使用下一个和相反的组合手工完成。
相关文章:
- 将浮动的heightmap数组导出为16位原始值
- 给定一个向量,如何找到该向量的所有子集和的原始索引
- 有没有办法从非C/C++文件中读取C++原始字符串文字的内容
- 是否可以将llvm::FunctionType转换为C/C++原始函数指针
- 如何将原始字节附加到 std::vector?
- 从堆栈分配的原始指针构造智能指针
- 如何重写全局方法名称以在调用原始方法之前将我的代码推到前面
- 将unique_ptr分配给原始指针
- 是否可以从 OpenGL 缓冲区获取原始大小的像素?
- 使用 OpenSSL 从内存中读取原始 SSL/TLS 证书
- 如何将唯一指针的 std::vector 转换为原始指针的 std::span?
- 从原始字节解码协议缓冲区(以 C++为单位)
- C ++如何在原始抽象类中创建一个函数,该函数接受派生类的输入
- C++:尝试使用等效的 STL 算法消除原始循环
- 如何在连接器 C++ 中将原始字节转换为字符串
- 通过引用传递类不会更改原始类
- 优化在 Z^3 中查找邻居
- 实现使用模板化类而不使原始类成为模板的类
- 如何在 2d 矢量 c++ 中复制元素并将其放在原始元素旁边
- 在cgal :: surface_mesh中找到某个原始的邻居