Expand description
Convex hulls of point sets in two and three dimensions.
See the book entry Convex hulls and polygon booleans.
Structs§
- Hull3D
- A convex polyhedron: triangular faces indexing into the input points, with counter-clockwise winding when seen from outside (normals point outward).
Functions§
- convex_
hull_ 2d - The convex hull of 2D points by Andrew’s monotone chain,
O(n log n). - convex_
hull_ 3d - The 3D convex hull by Quickhull (Barber, Dobkin and Huhdanpaa): starting from a tetrahedron,
each face keeps the points outside it, and the point farthest above a face is added by
replacing the faces it sees with a cone to their horizon.
O(n log n)expected for typical inputs,O(n²)in the worst case. - convex_
polygon_ contains_ 2d - Whether
plies inside or on a convex counter-clockwise polygon. - polygon_
area_ 2d - Area enclosed by a polygon given by
indicesintopoints(shoelace formula; positive for counter-clockwise order).