Package org.djutils.draw.curve
Class OffsetFlattener2d.NumSegments
java.lang.Object
org.djutils.draw.curve.OffsetFlattener2d.NumSegments
- All Implemented Interfaces:
Flattener<Flattener2d,,Curve2d, PolyLine2d, Point2d, Double> OffsetFlattener2d
- Enclosing interface:
- OffsetFlattener2d
Flattener that approximates the
OffsetCurve2d with a specified number of segments.-
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
ConstructorsConstructorDescriptionNumSegments(int numSegments) Construct a flattener that approximates theOffsetCurve2dwith a specified number of segments. -
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, waitMethods inherited from interface org.djutils.draw.curve.Flattener
checkInflectionPoint, checkPositionError, loadKnot, loadKnotsMethods inherited from interface org.djutils.draw.curve.OffsetFlattener2d
checkDirectionError, checkLoopBack, loadKnot, loadKnots, makeFlattableCurve
-
Constructor Details
-
NumSegments
public NumSegments(int numSegments) Construct a flattener that approximates theOffsetCurve2dwith a specified number of segments.- Parameters:
numSegments- number of segments to use in the construction of thePolyLine2d- Throws:
IllegalArgumentException- whennumSegments < 1
-
-
Method Details
-
flatten
Description copied from interface:OffsetFlattener2dFlatten a OffsetCurve2d curve into a PolyLine2d while applying lateral offsets.- Specified by:
flattenin interfaceOffsetFlattener2d- Parameters:
curve- the curveof- the lateral offset to apply- Returns:
- flattened curve
-