Package toxi.geom
Class ConvexPolygonClipper
java.lang.Object
toxi.geom.ConvexPolygonClipper
- All Implemented Interfaces:
PolygonClipper2D
A more generic version of the Sutherland-Hodgeman algorithm to limit 2D
polygons to convex clipping regions. Uses the clipping region's centroid and
Line2D.classifyPoint(ReadonlyVec2D)
to identify if an edge needs to
be clipped or not.
More information: http://en.wikipedia.org/wiki/Sutherland-Hodgman_algorithm- Since:
- 0021
- See Also:
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
ConvexPolygonClipper
-
-
Method Details
-
clipPolygon
Description copied from interface:PolygonClipper2D
Creates a clipped version of the polygon to the boundary shape set.- Specified by:
clipPolygon
in interfacePolygonClipper2D
- Parameters:
poly
- polygon to be clipped- Returns:
- clipped poly
-
getBounds
-
setBounds
-