访问三角形中的顶点++ (delaunay/voronoi 三角剖分)包装类

发布于 2024-09-15 19:19:34 字数 369 浏览 2 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心奴独伤 2024-09-22 19:19:34

示例代码有效,但不包含我想要的内容。我想取一个面并分别获取所有三个顶点,例如:

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.

不奢求什么 2024-09-22 19:19:34

我找到了问题的解决方案。只是为了完整起见,其工作原理如下:

double x0 = delobject.point_at_vertex_id(delobject.Org(fit))[0];
double y0 = delobject.point_at_vertex_id(delobject.Org(fit))[1]; 
double x1 = delobject.point_at_vertex_id(delobject.Dest(fit))[0];
double y1 = delobject.point_at_vertex_id(delobject.Dest(fit))[1];
double x2 = delobject.point_at_vertex_id(delobject.Apex(fit))[0];
double y2 = delobject.point_at_vertex_id(delobject.Apex(fit))[1];
...

I got a solution for the problem. Just for the sake of completeness, which works like this:

double x0 = delobject.point_at_vertex_id(delobject.Org(fit))[0];
double y0 = delobject.point_at_vertex_id(delobject.Org(fit))[1]; 
double x1 = delobject.point_at_vertex_id(delobject.Dest(fit))[0];
double y1 = delobject.point_at_vertex_id(delobject.Dest(fit))[1];
double x2 = delobject.point_at_vertex_id(delobject.Apex(fit))[0];
double y2 = delobject.point_at_vertex_id(delobject.Apex(fit))[1];
...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文