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

Polygon.area

Area of the shape in $mu m^2$

Polygon.bbox

Coordinate of the bounding box as a numpy.ndarray`in the following format :math:`y_{min}, z_{min}, y_{max}, z_{max}.

Polygon.bbox_size

Size of the bounding bounding box of the shape.

Polygon.c

Polygon.n_gon

Polygon.perimeter

Perimeter of the shape in $mu m^2$

Polygon.shp_poly

Polygon.x

Polygon.y

Polygon.z

Methods

Polygon.__init__([vertices])

Polygon.get_parameters()

Generic method returning all the atributes of an NRV_class instance

Polygon.get_point_inside([n_pts, delta, ...])

Returns n points coordinate randomly picked inside the shape

Polygon.get_trace([n_theta])

Get the trace of the ellipse.

Polygon.is_inside(point[, for_all])

Checks if a given point is inside the C-shape.

Polygon.load(data[, blacklist])

Generic loading method for NRV_class instance

Polygon.plot(axes[, n_tetha, add_center])

plot the border of the shape

Polygon.plot_bbox(axes, *args, **kwgs)

plot the border of the shape

Polygon.rotate(angle[, degree])

Rotate the shape.

Polygon.save([save, fname, blacklist])

Generic saving method for NRV_class instance.

Polygon.set_parameters(**kawrgs)

Generic method to set any attribute of NRV_class instance

Polygon.translate([y, z])

Translate the shape.