Cube

class sknano.core.geometric_regions.Cube(center=None, a=1)[source] [edit on github][source]

Bases: sknano.core.geometric_regions.Geometric3DRegion

Geometric3DRegion for a cube.

New in version 0.3.0.

Cube represents the region {{ci±a2}|a>0i{x,y,z}}.

Parameters:
  • center (array_like, optional) – The (x,y,z) coordinate of the axis-aligned cube center (cx,cy,cz).
  • a (float, optional) – Side length a of axis-aligned cube.

Notes

Calling Cube with no parameters is equivalent to Cube(center=[0, 0, 0], a=1).

Attributes

a Side length a of the axis-aligned cube.
bounding_box Bounding Cuboid.
center Center point (cx,cy,cz) of axis-aligned cube.
centroid Alias for center.
fmtstr Format string.
measure Alias for volume, which is the measure of a 3D geometric region.
ndim Return the dimensions.
pmax Point at maximum extent.
pmin Point at minimum extent.
volume Cube volume, V=a3.

Methods

center_centroid() Center centroid on origin.
contains(point) Test region membership of point in Cube.
get_points() Return list of points from GeometricRegion.points and GeometricRegion.vectors
rotate(**kwargs) Rotate GeometricRegion points and vectors.
todict() Returns a dict of the Cube constructor parameters.
translate(t[, fix_anchor_points]) Translate GeometricRegion points and vectors by Vector t.

Attributes Summary

a Side length a of the axis-aligned cube.
center Center point (cx,cy,cz) of axis-aligned cube.
centroid Alias for center.
volume Cube volume, V=a3.

Methods Summary

contains(point) Test region membership of point in Cube.
todict() Returns a dict of the Cube constructor parameters.

Attributes Documentation

a

Side length a of the axis-aligned cube.

center

Center point (cx,cy,cz) of axis-aligned cube.

centroid

Alias for center.

volume

Cube volume, V=a3.

Methods Documentation

contains(point)[source] [edit on github][source]

Test region membership of point in Cube.

Parameters:point (array_like) –
Returns:True if point is within Cube, False otherwise
Return type:bool

Notes

A point (px,py,pz) is within the bounded region of a cube with center (cx,cy,cz) and side length a if the following is true:

cia2pici+a2i{x,y,z}
todict()[source] [edit on github][source]

Returns a dict of the Cube constructor parameters.