rockverse.region.Cylinder#

class rockverse.region.Cylinder(p, v, r, l=inf, region='inside')[source]#

Defines cylindrical region of interest.

Note

For performance, region methods are dynamically created at class instantiation, and therefore the region parameters cannot be changed after the object is created.

Parameters:
  • p (3-element tuple, list, or Numpy array) – Point defining the spatial coordinates (in voxel units) for center of the sphere.

  • r (int or float) – Cylinder radius in voxel units. Must be non-negative.

  • v (3-element tuple, list, Numpy array) – Vector components for the axis direction vector.

  • l (int, float) – Cylinder length (must be non negative).

  • region ({'inside', 'outside'}, optional) – Whether to consider the region inside or outside the cylinder surface. Defaults to ‘inside’.

Attributes#

Cylinder.p

Point defining the center of the cylinder.

Cylinder.v

Vector components for the axis direction vector.

Cylinder.r

Cylinder radius.

Cylinder.l

Cylinder length.

Cylinder.region

Whether to consider the region inside or outside the cylinder surface.

Methods#

Cylinder.contains_point(x, y, z)

Check if a point (x, y, z) belongs to the region.