Cube

class sisl.shape.Cube(side, center=None)[source]

3D Cube with equal sides

Equivalent to Cuboid([r, r, r]).

Parameters
sidefloat

side-length of the cube, or vector

Attributes

center

The geometric center of the shape

edge_length

The lengths of each of the vector that defines the cuboid

origo

Return the origin of the Cuboid (lower-left corner)

Methods

__init__(self, side[, center])

Initialize self.

copy(self)

expand(self, length)

Expand the cuboid by a constant value along side vectors

scale(self, scale)

Scale the cuboid box size (center is retained)

set_center(self, center)

Re-setting the center can sometimes be necessary

set_origo(self, origo)

Re-setting the origo can sometimes be necessary

toCuboid(self)

Return a copy of itself

toEllipsoid(self)

Return an ellipsoid that encompass this cuboid

toSphere(self)

Return a sphere that encompass this cuboid

volume(self)

Return volume of Cuboid

within(self, other)

Return True if other is fully within self

within_index(self, other)

Return indices of the other object which are contained in the shape

property center

The geometric center of the shape

copy(self)
property edge_length

The lengths of each of the vector that defines the cuboid

expand(self, length)

Expand the cuboid by a constant value along side vectors

Parameters
lengthfloat or (3,)

the extension in Ang per cuboid vector.

property origo

Return the origin of the Cuboid (lower-left corner)

scale(self, scale)

Scale the cuboid box size (center is retained)

Parameters
scalefloat or (3,)

the scale parameter for each of the vectors defining the Cuboid

set_center(self, center)

Re-setting the center can sometimes be necessary

set_origo(self, origo)

Re-setting the origo can sometimes be necessary

toCuboid(self)

Return a copy of itself

toEllipsoid(self)

Return an ellipsoid that encompass this cuboid

toSphere(self)

Return a sphere that encompass this cuboid

volume(self)

Return volume of Cuboid

within(self, other)

Return True if other is fully within self

If other is an array, an array will be returned for each of these.

Parameters
otherarray_like

the array/object that is checked for containment

within_index(self, other)

Return indices of the other object which are contained in the shape

Parameters
otherarray_like

the object that is checked for containment