region

Functions and attributes

class atomman.region.Plane(normal, point)

Bases: object

Class representing a plane in space. Useful for making slices.

above(pos, inclusive=False)

Indicates if position(s) are above the plane. Note that identifying points as above or below is dependent on the sign of the plane normal.

Parameters
  • pos (array-like object) – Nx3 array of coordinates.

  • inclusive (bool, optional) – Indicates if points in the plane are to be included. Default value is False.

Returns

N array of bool values: True if above the plane

Return type

numpy.NDArray

below(pos, inclusive=True)

Indicates if position(s) are below the plane. Note that identifying points as above or below is dependent on the sign of the plane normal.

Parameters
  • pos (array-like object) – Nx3 array of coordinates.

  • inclusive (bool, optional) – Indicates if points in the plane are to be included. Default value is True.

Returns

N array of bool values: True if below the plane

Return type

numpy.NDArray

property normal

3D normal unit vector of the plane.

Type

numpy.NDArray

property point

a 3D vector position on the plane.

Type

numpy.NDArray

class atomman.region.Sphere(center, radius)

Bases: atomman.region.Shape.Shape

Class representing a sphere in space.

property center

3D vector position of sphere’s center

Type

numpy.NDArray

inside(pos, inclusive=True)

Indicates if position(s) are inside the shape.

Parameters
  • pos (array-like object) – Nx3 array of coordinates.

  • inclusive (bool, optional) – Indicates if points on the shape’s boundaries are to be included. Default value is True.

Returns

N array of bool values: True if inside shape

Return type

numpy.NDArray

property radius

the sphere’s radius

Type

float

class atomman.region.Cylinder(center1, center2, radius, endcaps=True)

Bases: atomman.region.Shape.Shape

Class representing a cylinder in space.

property axis

3D unit vector parallel to cylinder axis.

Type

numpy.NDArray

property center1

3D vector position of one cylinder end

Type

numpy.NDArray

property center2

3D vector position of one cylinder end

Type

numpy.NDArray

property endcaps

indicates if the endcaps are included in inside/outside determination

Type

bool

inside(pos, inclusive=True)

Indicates if position(s) are inside the shape.

Parameters
  • pos (array-like object) – Nx3 array of coordinates.

  • inclusive (bool, optional) – Indicates if points on the shape’s boundaries are to be included. Default value is True.

Returns

N array of bool values: True if inside shape

Return type

numpy.NDArray

property radius

the cylinder’s radius

Type

float

class atomman.region.Shape

Bases: object

Template class for defining geometric regions in space.

inside(pos, inclusive=True)

Indicates if position(s) are inside the shape.

Parameters
  • pos (array-like object) – Nx3 array of coordinates.

  • inclusive (bool, optional) – Indicates if points on the shape’s boundaries are to be included. Default value is True.

Returns

N array of bool values: True if inside shape

Return type

numpy.NDArray

outside(pos, inclusive=False)

Indicates if position(s) are inside the shape.

Parameters
  • pos (array-like object) – Nx3 array of coordinates.

  • inclusive (bool, optional) – Indicates if points on the shape’s boundaries are to be included. Default value is False.

Returns

N array of bool values: True if outside shape

Return type

numpy.NDArray