0

Hey so i was told in a previous answer that to make concave shapes out of multiple convex ones i do the following:

If you don't have a convex hull, perform a package wrapping algorithm to get a convex border that encompasses all your points (again quite fast). en.wikipedia.org/wiki/Gift_wrapping_algorithm

Choose a point that is on the boarder as a starter point for the algorithm.


Now, itterate through the following points that are on your shape, but aren't on the convex border. When one is found, create a new shape with the vertices from the starter point to the found non-border point. Finally set the starter point to be the the found off-border point

Recursion is now your friend: do the exact same process on each new sub-shape you make.


I'm confused on one thing though. What do you do when two vertices in a row are off-border? After reaching the first one you connect the starter point to it, but then you immediatly run into another off-border point after you start itterating again, leaving you with only 2 vertices to work with: the starter point and new off-border point. What am i missing?

To illustrate my problem, here's a shape pertaining to this issue: It would be great if someone could draw all over it and walk through the steps of the algorithm using this. And using point 1 as the starting point.

enter image description here

Thanks!

4

1 回答 1

0

假设您真的想要获取一个凸多边形(如您所说明的那样)并将其分解为凸部分而不引入新顶点,通常的方法称为“剪耳”,并在这篇 Wikipedia 文章Polygon triangulation中进行了描述。在这种方法中,凸块是三角形,它们必然是凸的。

这个问题已经在 Stackoverflow, C++ 2D tessellation library中与 CGAL 计算几何软件一起讨论过。

于 2011-07-14T12:48:30.920 回答