Package org.djutils.draw.curve
Class TestCurves
java.lang.Object
org.djutils.draw.curve.TestCurves
TestCurves.java.
Copyright (c) 2024-2025 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djutils.org. The DJUTILS project is distributed under a three-clause BSD-style license, which can be found at https://djutils.org/docs/license.html.
TODO test flattener Beziers that are not based on just two DirectedPoint objects.
TODO also with maxAngle flattener and non-declared knot.
TODO test flattener with curve that has a knot.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleMaximum permissible exceeding of precision. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidprintSituation(int segment, double positionOnSegment, PolyLine2d flattened, Object curve, double fraction, ContinuousPiecewiseLinearFunction of) Print things for debugging.static voidprintSituation(int segment, double positionOnSegment, PolyLine3d flattened, Curve3d curve, double fraction) Print things for debugging.voidtestArc()Test the ContinuousArc class.voidTest the Bezier2d and BezierCubic2d classes.voidTest the various constructors of Bezier2d.voidTest the Bezier3d and CubicBezier3d classes.voidTest the various constructors of Bezier3d.voidCheck the startRadius and endRadius of CubicBezier2d and getT.voidTest the various exceptions of the flatteners.voidTest the ContinuousStraight class.static voidverifyMaxAngleDeviation(PolyLine2d flattened, Curve2d curve, double anglePrecision) Verify that a flattened FlattableLine2d has matches direction with the flattableLine2d.static voidverifyMaxAngleDeviation(PolyLine2d flattened, OffsetCurve2d curve, ContinuousPiecewiseLinearFunction of, double anglePrecision) Verify that a flattened FlattableLine2d has no knots sharper than specified, except at the boundary points in the ContinuousPiecewiseLinearFunction.static voidverifyMaxAngleDeviation(PolyLine3d flattened, Curve3d curve, double anglePrecision) Verify that a flattened FlattableLine2d has matches direction with the flattableLine2d.
-
Field Details
-
FUDGE_FACTOR
public static final double FUDGE_FACTORMaximum permissible exceeding of precision. Needed due to the simple-minded way that the Flattener works.- See Also:
-
-
Constructor Details
-
TestCurves
public TestCurves()
-
-
Method Details
-
testStraight
Test the ContinuousStraight class. -
testArc
Test the ContinuousArc class. -
printSituation
public static void printSituation(int segment, double positionOnSegment, PolyLine2d flattened, Object curve, double fraction, ContinuousPiecewiseLinearFunction of) Print things for debugging.- Parameters:
segment- the step along the curve or the polyLine2dpositionOnSegment- doubleflattened- PolyLine2dcurve- Objectfraction- doubleof- ContinuousPiecewiseLinearFunction (may be null)
-
printSituation
public static void printSituation(int segment, double positionOnSegment, PolyLine3d flattened, Curve3d curve, double fraction) Print things for debugging.- Parameters:
segment- the step along the curve or the polyLine2dpositionOnSegment- doubleflattened- PolyLine3dcurve- Curve3dfraction- double
-
verifyMaxAngleDeviation
public static void verifyMaxAngleDeviation(PolyLine2d flattened, Curve2d curve, double anglePrecision) Verify that a flattened FlattableLine2d has matches direction with the flattableLine2d.- Parameters:
flattened- PolyLine2dcurve- FlattableLine2danglePrecision- double
-
verifyMaxAngleDeviation
public static void verifyMaxAngleDeviation(PolyLine2d flattened, OffsetCurve2d curve, ContinuousPiecewiseLinearFunction of, double anglePrecision) Verify that a flattened FlattableLine2d has no knots sharper than specified, except at the boundary points in the ContinuousPiecewiseLinearFunction.- Parameters:
flattened- PolyLine2dcurve- OffsetFlattableLine2dof- ContinuousPiecewiseLinearFunctionanglePrecision- double
-
verifyMaxAngleDeviation
public static void verifyMaxAngleDeviation(PolyLine3d flattened, Curve3d curve, double anglePrecision) Verify that a flattened FlattableLine2d has matches direction with the flattableLine2d.- Parameters:
flattened- PolyLine3dcurve- FlattableLine3danglePrecision- double
-
testBezier2d
Test the Bezier2d and BezierCubic2d classes. -
testCubicbezierRadiusAndSome
Check the startRadius and endRadius of CubicBezier2d and getT. -
testBezier3d
Test the Bezier3d and CubicBezier3d classes. -
testFlattenerExceptions
Test the various exceptions of the flatteners. -
testBezier2dConstructors
Test the various constructors of Bezier2d. -
testBezier3dConstructors
Test the various constructors of Bezier3d.
-