public class SimpleConvexHullFlatness extends Object implements CubicFlatnessAlgorithm, QuadFlatnessAlgorithm
getFlatness(CubicCurve2D) or quadratic
Bezier (getFlatness(QuadCurve2D) and the line defined by the
anchor points of the Bezier curve.Some notes:
DistUtils.pointToLineSqEucDist(...): therefore using it to compute
the squared
flatness is preferred;
0 flatness, even the curves cannot
by represented by the segment connecting the anchor points (think of control points
residing outside the segment defined by the anchor points).
| Constructor and Description |
|---|
SimpleConvexHullFlatness() |
| Modifier and Type | Method and Description |
|---|---|
double |
getFlatness(CubicCurve2D curve)
Should return the value of the flatness for the provided curve.
|
double |
getFlatness(QuadCurve2D curve)
Should return the value of the flatness for the provided curve.
|
double |
getSquaredFlatness(CubicCurve2D curve)
Should return the value of the flatness for the provided curve.
|
double |
getSquaredFlatness(QuadCurve2D curve)
Should return the value of the flatness for the provided curve.
|
boolean |
isDegenerationRobust()
Returns
false |
boolean |
isSquaredFlatenessPreferred()
Should return
true if the squared flatness is computed
easier (i.e. |
public final boolean isDegenerationRobust()
falseisDegenerationRobust in interface CubicFlatnessAlgorithmisDegenerationRobust in interface QuadFlatnessAlgorithmpublic final boolean isSquaredFlatenessPreferred()
CubicFlatnessAlgorithmtrue if the squared flatness is computed
easier (i.e. less CPU expensive) than the flatness.isSquaredFlatenessPreferred in interface CubicFlatnessAlgorithmisSquaredFlatenessPreferred in interface QuadFlatnessAlgorithmpublic final double getFlatness(CubicCurve2D curve)
CubicFlatnessAlgorithmgetFlatness in interface CubicFlatnessAlgorithmpublic final double getSquaredFlatness(CubicCurve2D curve)
CubicFlatnessAlgorithmgetSquaredFlatness in interface CubicFlatnessAlgorithmpublic final double getFlatness(QuadCurve2D curve)
QuadFlatnessAlgorithmgetFlatness in interface QuadFlatnessAlgorithmpublic final double getSquaredFlatness(QuadCurve2D curve)
QuadFlatnessAlgorithmgetSquaredFlatness in interface QuadFlatnessAlgorithmCopyright © 2016. All rights reserved.