public class ConvexHullSubdivCriterion extends ConvexHullFlatnessAlgo implements QuadSubdivisionCriterion, CubicSubdivisionCriterion
cubic
or a quadratic curve any time
the cubic's squared flatness
(or the quad's ConvexHullFlatnessAlgo.getSquaredFlatness(QuadCurve2D) squared flatness})
is greater than a provided tolerance.| Modifier and Type | Field and Description |
|---|---|
static double |
minTolerance
The minimum tolerance allowed by this algo.
|
protected double |
sqTol
The squared value of the provided tolerance.
|
| Constructor and Description |
|---|
ConvexHullSubdivCriterion()
Initialises an instance with a
default tolerance of 1.0e-5. |
ConvexHullSubdivCriterion(double tolerance)
Initialises the instance with the provided tolerance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
shouldSplit(CubicCurve2D curve)
Returns
true whenever the
defect
is greater than the provided tolerance. |
boolean |
shouldSplit(QuadCurve2D curve)
Returns
true whenever the
defect
is greater than the provided tolerance. |
getFlatness, getFlatness, getSquaredFlatness, getSquaredFlatness, isDegenerationRobust, isSquaredFlatenessPreferredpublic static double minTolerance
1.25*Math.sqrt(Double.MIN_VALUE)
(as the algorithm prefers to work with squared distances).protected double sqTol
public ConvexHullSubdivCriterion()
Initialises an instance with a
default tolerance of 1.0e-5.public ConvexHullSubdivCriterion(double tolerance)
tolerance - the tolerance that governs when the
the algorithm will require another subdivision.
Note that if thepublic final boolean shouldSplit(CubicCurve2D curve)
true whenever the
defect
is greater than the provided tolerance. The method performs the
comparison on the squared value.shouldSplit in interface CubicSubdivisionCriterionpublic final boolean shouldSplit(QuadCurve2D curve)
true whenever the
defect
is greater than the provided tolerance. The method performs the
comparison on the squared value.shouldSplit in interface QuadSubdivisionCriterionCopyright © 2016. All rights reserved.