Posts

Showing posts from January, 2024

Volko Hull - An Alternative to Convex Hull

When you have a point cloud and want to obtain the shape, you can use the convex hull or the alpha shape algorithm. In the computational geometry library I am using in my projects, CGAL, these algorithms are built-in, but they have a disadvantage: the points are not output in the correct order. I first tried to solve this problem by implementing a convex hull algorithm myself that outputs the points in the correct order, but this did not always help since it ignored concave corners. Therefore I wrote my own algorithm to replace it. My algorithm divides the rectangular area of the given cluster into four triangles and computes the points belonging to the outer border of each triangle. Thus it also includes concave corners. Imagine this to be the rectangle: -------- |\    /| | \ A/ | | C\/  | |  /\D | | /B \ | |/    \| -------- If it is a square, we can assume that its sides have a length of 2a. The coordinates of the mid point are always (0, 0). Then, the points have to fulfil the follo