访问三角形中的顶点++ (delaunay/voronoi 三角剖分)包装类
我正在使用 http://www.compgeom.com/~ 中的 Triangle++ 包装类piyush/scripts/triangle/ 对点云进行三角测量,以便使用 OpenGL 进行可视化。 我能够输入我的观点并计算三角测量。之后,我还能够通过顶点迭代器访问顶点,它是如何在包中包含的 main.cpp 示例中显示的。现在我想通过面迭代器访问顶点(main.cpp 中还有一个示例)。我想迭代所有面并获取每个面的三个顶点。有人已经这样做了吗?我已经尝试修改包装类大约两天了,但没有成功。
预先非常感谢! 塞巴斯蒂安
I'm using the triangle++ wrapper class from http://www.compgeom.com/~piyush/scripts/triangle/ to triangulate a point cloud for visulaizing with OpenGL.
I was able to put in my points and caluculate the triangulation. After that i also was able to access the vertices over a vertex iterator, how it is shown in the main.cpp example included in the package. Now i want to access the vertices over the face iterator (theres also an example in the main.cpp). I want to iterate over all faces and get the three vertices for every face. Has anyone done that already? I've been trying to modify the wrapper class for ~2 days already with no success.
thanks a lot in advance!
Sebastian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
示例代码有效,但不包含我想要的内容。我想取一个面并分别获取所有三个顶点,例如:
Delaunay::fIterator fit = delobject.fbegin();
双 x0 = fit.GetVertex(0).x();
双 y0 = fit.GetVertex(0).y();
双 z0 = fit.GetVertex(0).z();
双 x1 = fit.GetVertex(1).x();
双 y1 = fit.GetVertex(1).y();
双z1 = fit.GetVertex(1).z();
或类似的东西。当然这些函数不存在,但我什至不知道一般如何访问混凝土面的顶点。
the sample code works, but doesn't contain what i want. I want to take one face an get all three vertices separately, for example:
Delaunay::fIterator fit = delobject.fbegin();
double x0 = fit.GetVertex(0).x();
double y0 = fit.GetVertex(0).y();
double z0 = fit.GetVertex(0).z();
double x1 = fit.GetVertex(1).x();
double y1 = fit.GetVertex(1).y();
double z1 = fit.GetVertex(1).z();
or something like that. Of course these functions doesnt exist, but I even don't know how to access the vertices of a concret face in generally.
我找到了问题的解决方案。只是为了完整起见,其工作原理如下:
I got a solution for the problem. Just for the sake of completeness, which works like this: