public class GenericCubicSubdivCriterion extends Object implements CubicSubdivisionCriterion
CubicSubdivisionCriterion which does its job by using a
provided CubicFlatnessAlgorithm and a tolerance:
the criterion will ask for yet one subdivision whenever
algorithm returns a flatness value that's greater than
the required tolerance.| Modifier and Type | Field and Description |
|---|---|
protected CubicFlatnessAlgorithm |
flatnessAlgo
The flatness algorithm.
|
protected double |
sqTol
Squared tolerance, for the
CubicFlatnessAlgorithm
that prefers
working with squared distances. |
protected double |
tol
The tolerance.
|
| Constructor and Description |
|---|
GenericCubicSubdivCriterion()
Initalises
a new instance with a ConvexHullFlatnessAlgo as the flatness algorithm
and a tolerance of 1.0e-5. |
GenericCubicSubdivCriterion(CubicFlatnessAlgorithm algo)
Initialises
a new instance the provided flatness algo
and a tolerance of 1.0e-5. |
GenericCubicSubdivCriterion(CubicFlatnessAlgorithm algo,
double tolerance)
Initialises
using the provided parameters. |
GenericCubicSubdivCriterion(double tolerance)
Initialises
a new instance with a ConvexHullFlatnessAlgo as the flatness algorithm
and the provided tolerance. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
shouldSplit(CubicCurve2D curve)
Returns
true whenever the flatnessAlgo
returns a value greater than the required tolerance. |
protected CubicFlatnessAlgorithm flatnessAlgo
protected double tol
protected double sqTol
CubicFlatnessAlgorithm
that prefers
working with squared distances.public GenericCubicSubdivCriterion()
Initalises
a new instance with a ConvexHullFlatnessAlgo as the flatness algorithm
and a tolerance of 1.0e-5.public GenericCubicSubdivCriterion(double tolerance)
Initialises
a new instance with a ConvexHullFlatnessAlgo as the flatness algorithm
and the provided tolerance.public GenericCubicSubdivCriterion(CubicFlatnessAlgorithm algo)
Initialises
a new instance the provided flatness algo
and a tolerance of 1.0e-5.public GenericCubicSubdivCriterion(CubicFlatnessAlgorithm algo, double tolerance)
Initialises
using the provided parameters.public boolean shouldSplit(CubicCurve2D curve)
true whenever the flatnessAlgo
returns a value greater than the required tolerance.
If the flatness algorithm prefers
the computation of squared distances, the comparison is
made against the squared tolerance.shouldSplit in interface CubicSubdivisionCriterionCopyright © 2016. All rights reserved.