CShape

class nrv.utils.geom.CShape(center: tuple[float, float] = (0, 0), radius: float | tuple[float, float] = 0, rot: float = None, degree: bool = False)[source]

Abstract base class for closed-shaped geometries.

Attributes

CShape.area

Area of the shape in $mu m^2$

CShape.bbox

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

CShape.bbox_size

Size of the bounding bounding box of the shape.

CShape.perimeter

Perimeter of the shape in $mu m^2$

CShape.x

X-coordinate placeholder for 2D shapes.

CShape.y

Y-coordinate of the shape center.

CShape.z

Z-coordinate of the shape center.

Methods

CShape.__init__([center, radius, rot, degree])

Initializes the CShape

CShape.get_parameters()

Generic method returning all the atributes of an NRV_class instance

CShape.get_point_inside([n_pts, delta])

Returns n points coordinate randomly picked inside the shape

CShape.get_trace([n_theta])

Returns the trace of the geometry as a list of points.

CShape.is_inside(point[, delta, for_all])

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

CShape.load(data[, blacklist])

Generic loading method for NRV_class instance

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

plot the border of the shape

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

plot the border of the shape

CShape.rotate(angle[, degree])

Rotate the shape.

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

Generic saving method for NRV_class instance.

CShape.set_parameters(**kawrgs)

Generic method to set any attribute of NRV_class instance

CShape.translate([y, z])

Translate the shape.