Polygon
- class nrv.utils.geom.Polygon(vertices: tuple[float, float] = [[0, 0], [0, 1], [1, 0]])[source]
Polygon class that inherits from Cshape. Represents an polygon eiher from its vertices positions.
Attributes
Area of the polygon. |
|
Coordinates of the polygon bounding box. |
|
Size of the polygon bounding box. |
|
Center of the polygon as an array. |
|
Number of polygon vertices. |
|
Perimeter of the polygon. |
|
Polygon representation as a |
|
X-coordinate placeholder for 2D shapes. |
|
Y-coordinate of the shape center. |
|
Z-coordinate of the shape center. |
Methods
|
|
Generic method returning all the atributes of an NRV_class instance |
|
|
Draw random points inside the polygon by rejection sampling. |
|
Get the trace of the ellipse. |
|
Check whether one or several points lie inside the polygon. |
|
Generic loading method for |
|
plot the border of the shape |
|
plot the border of the shape |
|
Rotate the polygon around its center. |
|
Generic saving method for |
|
Generic method to set any attribute of |
|
Translate the polygon. |