Class Flattener2d.MaxDeviation

java.lang.Object
org.djutils.draw.curve.Flattener2d.MaxDeviation
All Implemented Interfaces:
Flattener<Flattener2d,Curve2d,PolyLine2d,Point2d,Double>, Flattener2d
Enclosing interface:
Flattener2d

public static class Flattener2d.MaxDeviation extends Object implements Flattener2d
Flattener that limits the distance between the Curve2d and the PolyLine2d.
  • Constructor Details

    • MaxDeviation

      public MaxDeviation(double maxDeviation)
      Construct a flattener that limits the distance between the Curve2d and the PolyLine2d.
      Parameters:
      maxDeviation - maximum deviation, must be above 0.0
      Throws:
      ArithmeticException - when maxDeviation is NaN
      IllegalArgumentException - when maxDeviation ≤ 0.0
  • Method Details

    • flatten

      public PolyLine2d flatten(Curve2d curve)
      Description copied from interface: Flattener2d
      Flatten a Curve2d into a PolyLine2d.
      Specified by:
      flatten in interface Flattener2d
      Parameters:
      curve - the curve
      Returns:
      flattened line