aspsim.room.region.Ball

class aspsim.room.region.Ball(radius, center, point_spacing=(1, 1, 1), rng=None)

Bases: Region

Constructs a ball region

Parameters:
  • radius (float) – Radius of the ball.

  • center (array_like of shape (3,), optional) – Center of the cylinder. The default is (0,0,0).

  • point_spacing (array_like of shape (3,), optional) – Spacing between points in each direction, affects the selection of points for the equally_spaced_points method. The default is (1,1,1).

  • rng (np.random.Generator, optional) – Random number generator. The default is None, in which case a new generator with a random seed will be created. The generator affects the sampling of points in the sample_points method, and so should be supplied for a reproducible result.

Returns:

ball

Return type:

Ball

__init__(radius, center, point_spacing=(1, 1, 1), rng=None)

Constructs a ball region

Parameters:
  • radius (float) – Radius of the ball.

  • center (array_like of shape (3,), optional) – Center of the cylinder. The default is (0,0,0).

  • point_spacing (array_like of shape (3,), optional) – Spacing between points in each direction, affects the selection of points for the equally_spaced_points method. The default is (1,1,1).

  • rng (np.random.Generator, optional) – Random number generator. The default is None, in which case a new generator with a random seed will be created. The generator affects the sampling of points in the sample_points method, and so should be supplied for a reproducible result.

Returns:

ball

Return type:

Ball

Methods

__init__(radius, center[, point_spacing, rng])

Constructs a ball region

equally_spaced_points()

is_in_region(coordinates)

plot(ax[, label])

sample_points(num_points)