Hulls
Meshes.hull
— Functionhull(object, method)
Compute the hull of object
with given method
.
Meshes.HullMethod
— TypeHullMethod
A method for computing hulls of point sets or collections of geometries.
Graham's scan
Meshes.GrahamScan
— TypeGrahamScan
Compute the convex hull of a set of points or geometries using the Graham's scan method. See https://en.wikipedia.org/wiki/Graham_scan.
The method has complexity O(n*log(n))
where n
is the number of points.
References
- Cormen et al. 2009. Introduction to Algorithms
pset = PointSet(rand(Point2, 100))
chul = hull(pset, GrahamScan())
fig = Mke.Figure(resolution = (800, 400))
viz(fig[1,1], chul)
viz!(fig[1,1], pset, color = :black)
fig