simulation.utils.geometry.polygon module

Polygon.

Summary

Classes:

Polygon

Polygon class inheriting from shapely’s Polygon class.

Reference

class Polygon(*args, frame=None)[source]

Bases: shapely.geometry.polygon.Polygon

Polygon class inheriting from shapely’s Polygon class.

Inheriting from shapely enables to use their powerful operations in combination with other objects, e.g. polygon intersections.

Initialization can be done in one of the following ways.

Parameters
  • 1 ([Point]) – List of points or anything that can be initialized as a point, e.g. Vector, geometry_msgs.Point,np.array

  • 2 (geometry_msgs.Polygon) –

  • 3 ((Line,Line)) – Two lines which are interpreted as the left and right boundary of the polygon, e.g. a road lane

get_points() → List[simulation.utils.geometry.point.Point][source]

Points of polygon.

Returns

list of points on the polygon.

to_geometry_msg()[source]

To ROS geometry_msg.

Returns

This polygon as a geometry_msgs.Polygon.

to_numpy()[source]

To numpy array.

Returns

Polygon as a numpy array of np.arrays.