Interface OffsetCurve2d

All Superinterfaces:
Curve<DirectedPoint2d,Double,Point2d,Flattener2d,PolyLine2d>, Curve2d, Flattener.FlattableCurve<Point2d,Double>
All Known Implementing Classes:
Arc2d, BezierCubic2d, Clothoid2d, Straight2d

public interface OffsetCurve2d extends Curve2d
OffsetCurve2d.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.

Author:
Alexander Verbraeck
  • Method Details

    • toPolyLine

      Flatten a Curve2d while offsetting with the provided continuous offset into a PolyLine2d. Implementations should use the flattener when relevant and possible.
      Parameters:
      flattener - OffsetFlattener
      offsets - offset data
      Returns:
      approximation of this curve2d with offset as a PolyLine2d
      Throws:
      NullPointerException - when flattener, or offsets is null
    • getPoint

      Point2d getPoint(double fraction, ContinuousPiecewiseLinearFunction of)
      Returns the point at the given fraction. The fraction may represent any parameter, such as t in a Bézier curve, s in a Clothoid, or simply the fraction of length.
      Parameters:
      fraction - the fraction
      of - provides fraction-dependent lateral offset to the point
      Returns:
      the point at the given fraction
    • getDirection

      default double getDirection(double fraction, ContinuousPiecewiseLinearFunction of)
      Returns the direction at the given fraction. The fraction may represent any parameter, such as t in a Bézier curve, s in a Clothoid, or simply the fraction of length. The default implementation performs a numerical approach by looking at the direction between the points at fraction, and a point 1e-6 away.
      Parameters:
      fraction - the fraction
      of - provides fraction-dependent lateral offset to the curve
      Returns:
      the direction at the given fraction
    • getT

      default double getT(double position)
      Convert a position along the curve to a t-value in the OffsetCurve2d domain. For Arc and Straight, these t-values are the same. For BezierCubic they're not.
      Parameters:
      position - t-value in the ContinuousPiecewiseLinearFunction domain
      Returns:
      t-value in the ContinuousPiecewiseLinearFunction domain