public class Shapes extends Object
| Modifier and Type | Method and Description |
|---|---|
static double |
computeLength(Shape shape,
double flatness)
Computes the length of the given shape (i.e. its border)
|
static List<Line2D> |
computeLineSegments(Shape shape,
double flatness)
Create a list containing line segments that approximate the given
shape.
|
static List<Point2D> |
computePoints(Shape shape,
double flatness,
boolean storeOnClose)
Create a list containing line points that approximate the given
shape.
|
static double |
computeSignedArea(Shape shape,
double flatness)
Compute the (signed) area that is covered by the given shape.
|
static List<Shape> |
computeSubShapes(Shape shape)
Computes the list of sub-shapes of the given shape.
|
static Shape |
interpolate(Shape shape0,
Shape shape1,
double alpha)
Create a shape that is created from interpolating between the
given shapes, according to the given interpolation value
|
public static List<Line2D> computeLineSegments(Shape shape, double flatness)
shape - The shapeflatness - The allowed flatnesspublic static List<Point2D> computePoints(Shape shape, double flatness, boolean storeOnClose)
shape - The shapeflatness - The allowed flatnessstoreOnClose - Whether a point should be stored when the
shape is closed. (This will result in points being stored twice
in the returned list).public static Shape interpolate(Shape shape0, Shape shape1, double alpha)
shape0 - The first shapeshape1 - The second shapealpha - The interpolation value, usually between 0.0 and 1.0IllegalArgumentException - If the given shapes do not consist
of the same segments (that is, when they are not structurally equal)public static double computeSignedArea(Shape shape, double flatness)
shape - The shapeflatness - The flatness for the path iteratorpublic static double computeLength(Shape shape, double flatness)
shape - The shapeflatness - The flatness for the iterationCopyright © 2017. All rights reserved.