Class PolygonShape

java.lang.Object
org.opentrafficsim.base.geometry.PolygonShape
All Implemented Interfaces:
OtsShape

public class PolygonShape extends Object implements OtsShape
Bounds defined by a polygon.

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

Author:
Wouter Schakel
  • Constructor Details

    • PolygonShape

      public PolygonShape(org.djutils.draw.line.Polygon2d polygon)
      Constructor.
      Parameters:
      polygon - polygon.
  • Method Details

    • asPolygon

      public org.djutils.draw.line.Polygon2d asPolygon()
      Description copied from interface: OtsShape
      Returns a polygon representation of the bounds, such that an intersection can be derived.
      Specified by:
      asPolygon in interface OtsShape
      Returns:
      polygon representation of the bounds.
    • toString

      public String toString()
      Overrides:
      toString in class Object