Polygon¶
-
class
Polygon(vertices)¶ Shape defined by a list of vertices in a 2D plane
Attributes: - vertices : List[array_like]
Must be defined in clockwise or counterclockwise order.
Methods
contains(x, 1]], y, 1]], z, 1]])Return Trueif the given position is located within the shapeplot(**kwargs)Line plot of the polygon with_offset(vector)Return a copy that’s offset by the given vector -
contains(x: numpy.ndarray[float32[m, 1]], y: numpy.ndarray[float32[m, 1]], z: numpy.ndarray[float32[m, 1]])¶ Return
Trueif the given position is located within the shapeGiven arrays as input the return type is a boolean array.
Parameters: - x, y, z : array_like
Positions to test against the shape.
-
plot(**kwargs)¶ Line plot of the polygon
Parameters: - **kwargs
Forwarded to
matplotlib.pyplot.plot().
-
with_offset(vector)¶ Return a copy that’s offset by the given vector