- All Implemented Interfaces:
public class GiftWrap extends Object implements HullGeneratorImplementation of the Gift Wrapping convex hull algorithm.
This algorithm handles coincident and colinear points by ignoring them during processing. This ensures the produced hull will not have coincident or colinear vertices.
This algorithm is O(nh) worst case where n is the number of points and h is the number of sides in the resulting convex hull.
- William Bittle
Constructors Constructor Description
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
generate(Vector2... points)Returns a convex hull generated from the given point set in counter-clockwise point order.
generateDescription copied from interface:
HullGeneratorReturns a convex hull generated from the given point set in counter-clockwise point order.
Returns null if the given points array is null.
Returns the array unchanged if the length is less than or equal to 2.