Class LaneGeometryUtil

java.lang.Object
org.opentrafficsim.road.network.LaneGeometryUtil

public final class LaneGeometryUtil extends Object
This class is an extension (conceptually, not an actual java extension) of OtsGeometryUtil. This utility has access to classes that are specific to the ots-road project, and required to define geometry of objects in this context.

Copyright (c) 2023-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Method Details

    • getContour

      public static Polygon2d getContour(PolyLine2d leftEdge, PolyLine2d rightEdge)
      Returns the contour based on left and right edge.
      Parameters:
      leftEdge - left edge, in design line direction
      rightEdge - right edge, in design line direction
      Returns:
      a closed loop of both edges.
    • createStraightLane

      public static Lane createStraightLane(CrossSectionLink link, String id, org.djunits.value.vdouble.scalar.Length offset, org.djunits.value.vdouble.scalar.Length width, LaneType laneType, LaneSpeedLimits speedLimits)
      Creates a simple straight lane. This method exists to create lanes for simple tests.
      Parameters:
      link - link
      id - id
      offset - end offset
      width - end width
      laneType - lane type
      speedLimits - speed limits
      Returns:
      lane
    • createStraightLane

      public static Lane createStraightLane(CrossSectionLink link, String id, org.djunits.value.vdouble.scalar.Length startOffset, org.djunits.value.vdouble.scalar.Length endOffset, org.djunits.value.vdouble.scalar.Length startWidth, org.djunits.value.vdouble.scalar.Length endWidth, LaneType laneType, LaneSpeedLimits speedLimits)
      Creates a simple straight lane. This method exists to create lanes for simple tests.
      Parameters:
      link - link
      id - id
      startOffset - start offset
      endOffset - end offset
      startWidth - start width
      endWidth - end width
      laneType - lane type
      speedLimits - speed limits
      Returns:
      lane
    • createStraightLane

      public static Lane createStraightLane(CrossSectionLink link, String id, ContinuousPiecewiseLinearFunction offset, ContinuousPiecewiseLinearFunction width, LaneType laneType, LaneSpeedLimits speedLimits)
      Creates a simple straight lane. This method exists to create lanes for simple tests.
      Parameters:
      link - link
      id - id
      offset - offset information
      width - offset information
      laneType - lane type
      speedLimits - speed limits
      Returns:
      lane
    • createStraightStripe

      public static Stripe createStraightStripe(StripeData type, String id, CrossSectionLink link, org.djunits.value.vdouble.scalar.Length offset, org.djunits.value.vdouble.scalar.Length width)
      Creates a simple straight lane. This method exists to create lanes for simple tests.
      Parameters:
      type - stripe data
      id - id
      link - link
      offset - end offset
      width - end width
      Returns:
      lane
    • createStraightShoulder

      public static Object createStraightShoulder(CrossSectionLink link, String id, org.djunits.value.vdouble.scalar.Length startOffset, org.djunits.value.vdouble.scalar.Length endOffset, org.djunits.value.vdouble.scalar.Length startWidth, org.djunits.value.vdouble.scalar.Length endWidth, LaneType laneType)
      Creates a simple straight shoulder. This method exists to create shoulders for simple tests.
      Parameters:
      link - link
      id - id
      startOffset - start offset
      endOffset - end offset
      startWidth - start width
      endWidth - end width
      laneType - lane type
      Returns:
      lane