public class LineDefectSubdivCriterion extends LineDefectFlatnessAlgo implements CubicSubdivisionCriterion, QuadSubdivisionCriterion
cubic
or a quadratic curve any time
the cubic's flatness
(or the quad's flatness)
is greater than a provided tolerance.
Actually, because the LineDefectFlatnessAlgo may
prefer
either the flatness or the squared flatness, the decision to subdivide
is taken based
on whatever is less expensive to compute, thus either the precision
or the squared precision will be used.
| Modifier and Type | Field and Description |
|---|---|
protected static double |
defaultTol |
protected double |
sqTol
The squared precision to use in deciding whether or not the curve should be split.
|
protected double |
tol
The precision to use in deciding whether or not the curve should be split.
|
| Constructor and Description |
|---|
LineDefectSubdivCriterion()
Initialises
this instance to use euclidian distance,
positively make use of summation
for computing the defect of cubic curves and the default
precision.
|
LineDefectSubdivCriterion(boolean useSum)
Initialises
this instance to use euclidian distance,
the specified sum/max strategy
(when computing the defect of cubic curves) and the default
precision.
|
LineDefectSubdivCriterion(boolean useSum,
double tolerance)
Initialises
this instance to use euclidian distance,
make use of the specified sum/max strategy
for computing the defect of cubic curves and the specified
precision.
|
LineDefectSubdivCriterion(double tolerance)
Initialises
this instance to use euclidian distance,
positively make use of summation
for computing the defect of cubic curves and the specified
precision.
|
LineDefectSubdivCriterion(int distType)
Initialises
this instance to use the specified distance type,
positively make use of summation
(when computing the defect of cubic curves) and the default
precision.
|
LineDefectSubdivCriterion(int distType,
boolean useSum)
Initialises
this instance to use specified distance type,
and sum/max strategy
for computing the defect of cubic curves and the default
precision.
|
LineDefectSubdivCriterion(int distType,
boolean useSum,
double tolerance)
Initialises
this instance to use the specified values for distance type,
sum/max strategy (when computing the
defect of cubic curves) and precision.
|
LineDefectSubdivCriterion(int distType,
double tolerance)
Initialises
this instance to use the specified distance type ,
positively make use of summation
for computing the defect of cubic curves and the specified precision.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
shouldSplit(CubicCurve2D curve)
|
boolean |
shouldSplit(QuadCurve2D curve)
|
getFlatness, getFlatness, getSquaredFlatness, getSquaredFlatness, isDegenerationRobust, isSquaredFlatenessPreferredprotected static final double defaultTol
protected double tol
protected double sqTol
public LineDefectSubdivCriterion()
public LineDefectSubdivCriterion(int distType)
public LineDefectSubdivCriterion(boolean useSum)
public LineDefectSubdivCriterion(double tolerance)
public LineDefectSubdivCriterion(int distType,
boolean useSum)
public LineDefectSubdivCriterion(int distType,
double tolerance)
public LineDefectSubdivCriterion(boolean useSum,
double tolerance)
public LineDefectSubdivCriterion(int distType,
boolean useSum,
double tolerance)
public final boolean shouldSplit(CubicCurve2D curve)
true whenever the defect
of approximating the provided cubic by a line segment is higher than the
tolerance for which this instance is initialised with.
The method chooses whether or not using the direct
or squared defect is
less expensive to compute and reacts accordingly.shouldSplit in interface CubicSubdivisionCriterionpublic final boolean shouldSplit(QuadCurve2D curve)
true whenever the defect
of approximating the provided quad by a line segment is higher than the
tolerance for which this instance is initialised with.
The method chooses whether or not using the direct
or squared defect is
less expensive to compute and
reacts accordingly.shouldSplit in interface QuadSubdivisionCriterionCopyright © 2016. All rights reserved.