Package org.djutils.draw.curve
Class OffsetFlattener2d.MaxDeviationAndAngle
java.lang.Object
org.djutils.draw.curve.OffsetFlattener2d.MaxDeviationAndAngle
- All Implemented Interfaces:
Flattener<Flattener2d,
,Curve2d, PolyLine2d, Point2d, Double> OffsetFlattener2d
- Enclosing interface:
- OffsetFlattener2d
public static class OffsetFlattener2d.MaxDeviationAndAngle
extends Object
implements OffsetFlattener2d
OffsetFlattener that limits distance and angle difference between the
OffsetCurve2d
and the
PolyLine2d
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.djutils.draw.curve.Flattener
Flattener.FlattableCurve<P,
DIR> Nested classes/interfaces inherited from interface org.djutils.draw.curve.OffsetFlattener2d
OffsetFlattener2d.MaxAngle, OffsetFlattener2d.MaxDeviation, OffsetFlattener2d.MaxDeviationAndAngle, OffsetFlattener2d.NumSegments
-
Constructor Summary
ConstructorsConstructorDescriptionMaxDeviationAndAngle
(double maxDeviation, double maxAngle) Construct a flattener that limits distance and angle difference between theOffsetCurve2d
and thePolyLine2d
. -
Method Summary
Modifier and TypeMethodDescriptionFlatten a OffsetCurve2d curve into a PolyLine2d while applying lateral offsets.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.djutils.draw.curve.Flattener
checkInflectionPoint, checkPositionError, loadKnot, loadKnots
Methods inherited from interface org.djutils.draw.curve.OffsetFlattener2d
checkDirectionError, checkLoopBack, loadKnot, loadKnots, makeFlattableCurve
-
Constructor Details
-
MaxDeviationAndAngle
public MaxDeviationAndAngle(double maxDeviation, double maxAngle) Construct a flattener that limits distance and angle difference between theOffsetCurve2d
and thePolyLine2d
.- Parameters:
maxDeviation
- maximum deviation, must be above 0.0maxAngle
- maximum angle, must be above 0.0- Throws:
ArithmeticException
- whenmaxDeviation
, ormaxAngle
isNaN
IllegalArgumentException
- whenmaxDeviation ≤ 0.0
, ormaxAngle ≤ 0.0
-
-
Method Details
-
flatten
Description copied from interface:OffsetFlattener2d
Flatten a OffsetCurve2d curve into a PolyLine2d while applying lateral offsets.- Specified by:
flatten
in interfaceOffsetFlattener2d
- Parameters:
curve
- the curveof
- the lateral offset to apply- Returns:
- flattened curve
-