c++:CGAL 2D delauny 三角剖分:凹形
我目前正在使用 CGAL 来完成一些 2D 三角测量任务,并且我还准备了一些简单的工作。无论如何,我真的不知道如何对凹形状进行三角剖分,因为现在我总是得到所有点的凸包。基本上我想在 mouseClick 上添加点,类似于它在 illustrator 中的工作方式,以便按顺序排列的所有点都是形状的轮廓。我怎样才能用 CGAL 做到这一点?一个关于如何对凹形状进行三角测量的简单示例可能会让我走上正确的轨道!谢谢!
I am currently getting into CGAL for some 2D triangulation tasks and I also got something simple to work allready. Anyhow I dont really get how to triangulate concave shapes since Right now I always get the convex hull of all points. Basically I want to add points on mouseClick similar to how it works in illustrator so that all the points in their order are the outline of the shape. How can I do that with CGAL? A simple example of how to triangulate concave shapes in general would propably put me onto the right track! thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml
http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml
我想您首先需要分区 将多边形分割成凸块。之后,您可以使用如下内容创建每个单独多边形的三角形:
I guess you'll first need to partition the polygon into convex pieces. After this you can create triangles of each individual polygon with something like this:
如果您得到的是凸轮廓而不是凹轮廓,则可能是由于传入的 alpha 值所致。尝试使用 find_optimal_alpha(1) 作为 alpha 值或计算相对于您传入的点云边界大小的值。例如。
If you're getting a convex outline instead of concave, it's probably due to the alpha value passed in. Try using find_optimal_alpha(1) as the alpha value or calculate values relative to the bounding size of the point cloud you're passing in. eg.