com.caffeineowl.graphics.bezier
Class BezierUtils.MidPointApproxSubdivCriterion

java.lang.Object
  extended by com.caffeineowl.graphics.bezier.BezierUtils.MidPointApproxSubdivCriterion
All Implemented Interfaces:
CubicSubdivisionCriterion
Enclosing class:
BezierUtils

static final class BezierUtils.MidPointApproxSubdivCriterion
extends java.lang.Object
implements CubicSubdivisionCriterion

The adaptive halving criterion for approximating a cubic by the mid-point approximation quadratic.


Field Summary
protected  double sqTol
          The square of the tolerance (degree of precision) accepted by this criterion.
 
Constructor Summary
BezierUtils.MidPointApproxSubdivCriterion(double prec)
          Constructs an instance tuned for the specified precision (the minimum accepted being 1.0e-5)
 
Method Summary
 boolean shouldSplit(java.awt.geom.CubicCurve2D c)
          Returns true whenever the square of the distance between the control points of 0- and 1- approximations of the given cubic multiplied by 1/432=1/(sqrt(3)/36)2 is less or equal the square of the requested precision.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sqTol

protected double sqTol
The square of the tolerance (degree of precision) accepted by this criterion.

Constructor Detail

BezierUtils.MidPointApproxSubdivCriterion

BezierUtils.MidPointApproxSubdivCriterion(double prec)
Constructs an instance tuned for the specified precision (the minimum accepted being 1.0e-5)

Parameters:
prec - the desired precision.
Method Detail

shouldSplit

public boolean shouldSplit(java.awt.geom.CubicCurve2D c)
Returns true whenever the square of the distance between the control points of 0- and 1- approximations of the given cubic multiplied by 1/432=1/(sqrt(3)/36)2 is less or equal the square of the requested precision.

Specified by:
shouldSplit in interface CubicSubdivisionCriterion