alpha_shape#

alpha_shape(points, alpha, only_outer=True, internal_area_threshold=0, internal_boundaries=True)#

Compute the alpha shape of a set of points. The alpha shape returns a list of boundary points and a list of internal boundary points which is the same formation required to make a shape object in muspan.

Parameters:
pointsnp.ndarray

Array of shape (k, 2) containing the points.

alphafloat

Alpha value to influence the shape.

only_outerbool, optional

If True, keep only the outer border. If False, include inner edges as well. Default is True.

internal_area_thresholdfloat, optional

Threshold for the area of internal boundaries to be included. Default is 0.

internal_boundariesbool, optional

If True, include internal boundaries. Default is True.

Returns:
list

A list where each element is a tuple containing the outer boundary points (m, 2) and a list of internal boundary points, each of shape (n_i, 2).

Notes

Implementation based on https://stackoverflow.com/questions/23073170/calculate-bounding-polygon-of-alpha-shape-from-the-delaunay-triangulation