With a list of tuple points I am able to create a matplotlib.path.Path
object.
With a point cloud, I have created a shapely.geometry.Polygon
object by using the alphashape.alphashape
function.
I would like to convert the Polygon
object into a Path
object so that I can utilise Path.contains_points
which is able to operate on a vector of points instead of Polygon.contains
which can only operate on a single point.
Consider the following example:
import alphashape as aps
import matplotlib.path as mpath
import numpy as np
import shapely.geometry as shgt
points = np.random.rand(100,2)
poly = aps.alphashape(points, 0.2) # 0.2 is a toggle param for best concave hull