public interface CubicFlatnessAlgorithm
For some of the algorithms will be easier (less
computational expensive) to compute the square of the flatness,
for others the unsquared flatness will be preferred: the consumer of
a CubicFlatnessAlgorithm's services can obtain which
way is the preferred one by calling the isSquaredFlatenessPreferred()
method.
Also, a flatness computation algorithm may or may not be robust in
concerning degenerate cubic Bezier curves (i.e. curves with all the
points collinear): such cases may show a 0 flatness without
any warranty that, indeed, the curve can be approximated by the segment
connecting the anchor points. Whether this is the case or not can be
obtained by calling the isDegenerationRobust() method.
| Modifier and Type | Method and Description |
|---|---|
double |
getFlatness(CubicCurve2D 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.
|
boolean |
isDegenerationRobust()
Must return
true if the flatness is non-zero for any
cubic curve that is not equal with the segment connecting the
cubic's anchors (can handle degenerated cubic curves), false
otherwise. |
boolean |
isSquaredFlatenessPreferred()
Should return
true if the squared flatness is computed
easier (i.e. |
boolean isDegenerationRobust()
true if the flatness is non-zero for any
cubic curve that is not equal with the segment connecting the
cubic's anchors (can handle degenerated cubic curves), false
otherwise.boolean isSquaredFlatenessPreferred()
true if the squared flatness is computed
easier (i.e. less CPU expensive) than the flatness.double getFlatness(CubicCurve2D curve)
double getSquaredFlatness(CubicCurve2D curve)
Copyright © 2016. All rights reserved.