region

Functions and attributes

class atomman.region.Cylinder(center1: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], center2: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], radius: float, endcaps: bool = True)

Bases: Shape

Class representing a cylinder in space.

property axis: ndarray

3D unit vector parallel to cylinder axis.

Type:

numpy.NDArray

property center1: ndarray

3D vector position of one cylinder end

Type:

numpy.NDArray

property center2: ndarray

3D vector position of one cylinder end

Type:

numpy.NDArray

property endcaps: float

indicates if the endcaps are included in inside/outside determination

Type:

bool

inside(pos: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], inclusive: bool = True) ndarray

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: float

the cylinder’s radius

Type:

float

class atomman.region.Plane(normal: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], point: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])

Bases: object

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

above(pos: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], inclusive: bool = False) ndarray

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: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], inclusive: bool = True) ndarray

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

isclose(other: Plane, atol: float = 1e-08) bool

Check the plane and a given one represent the same. Note that if the normal vectors of the two planes are antiparallel, they are considered to be different.

Parameters:
  • other (Plane) – a plane to be compared with

  • rtol (float) – the relative tolerance parameter used in numpy.isclose

  • atol (float) – the absolute tolerance parameter used in numpy.isclose

Returns:

Return true if the plane and a given one represent the same within tolerance.

Return type:

bool

property normal: ndarray

3D normal unit vector of the plane.

Type:

numpy.NDArray

operate(rotation: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], translation: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) Plane

Return a new plane transformed by given symmetry operation

Parameters:
  • rotation (array-like, (3, 3)) – rotation matrix in cartedian coordinates

  • translation (array-like, (3, )) – translation matrix in cartedian coordinates

Returns:

A new plane transformed by the specified operations.

Return type:

Plane

property point: ndarray

a 3D vector position on the plane.

Type:

numpy.NDArray

class atomman.region.PlaneSet(planes: Plane | List[Plane])

Bases: Shape

Class consisting of a shape defined by a set of planes

inside(pos: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], inclusive: bool = True) ndarray

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 planes: List[Plane]

The planes that make up the shape

Type:

list of atomman.region.Plane

class atomman.region.Shape

Bases: object

Template class for defining geometric regions in space.

inside(pos: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], inclusive: bool = True) ndarray

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: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], inclusive: bool = False) ndarray

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

class atomman.region.Sphere(center: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], radius: float)

Bases: Shape

Class representing a sphere in space.

property center: ndarray

3D vector position of sphere’s center

Type:

numpy.NDArray

inside(pos: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], inclusive: bool = True) ndarray

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: float

the sphere’s radius

Type:

float