Cuboid

class sknano.core.geometric_regions.Cuboid(pmin=None, pmax=None, xmin=0, ymin=0, zmin=0, xmax=1, ymax=1, zmax=1)[source] [edit on github][source]

Bases: sknano.core.geometric_regions.Geometric3DRegion

Geometric3DRegion for a cuboid.

New in version 0.3.0.

Represents an axis-aligned cuboid with lower corner pmin=(xmin,ymin,zmin) and upper corner pmax=(xmax,ymax,zmax).

Parameters:
  • pmax (pmin,) – The minimum and maximum 3D point coordinates of the axis-aligned cuboid from pmin=[xmin, ymin, zmin] to pmax=[xmax, ymax, zmax].
  • ymin, zmin (xmin,) – The minimum (x,y,z) coordinates of the axis-aligned cuboid.
  • ymax, zmax (xmax,) – The maximum (x,y,z) coordinates of the axis-aligned cuboid.

Notes

Cuboid represents the region {{x,y,z}|xminxxmaxyminyymaxzminzzmax}

Calling Cuboid with no parameters is equivalent to Cuboid(pmin=[0, 0, 0], pmax=[1, 1, 1]).

Attributes

a Alias for Cuboid.lx.
abc Alias for Cuboid.lengths.
b Alias for Cuboid.ly.
bounding_box Bounding Cuboid.
c Alias for Cuboid.lz.
center Alias for centroid.
centroid Cuboid centroid, (cx,cy,cz).
fmtstr Format string.
lengths tuple of side lengths
lx Distance between xmaxxmin.
ly Distance between ymaxymin.
lz Distance between zmaxzmin.
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 Cuboid volume, V=xyz.
xmax xmax coordinate.
xmin xmin coordinate.
ymax ymax coordinate.
ymin ymin coordinate.
zmax zmax coordinate.
zmin zmin coordinate.

Methods

center_centroid() Center centroid on origin.
contains(point) Test region membership of point in Cuboid.
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 Cuboid constructor parameters.
translate(t[, fix_anchor_points]) Translate GeometricRegion points and vectors by Vector t.

Attributes Summary

a Alias for Cuboid.lx.
abc Alias for Cuboid.lengths.
b Alias for Cuboid.ly.
c Alias for Cuboid.lz.
centroid Cuboid centroid, (cx,cy,cz).
lengths tuple of side lengths
lx Distance between xmaxxmin.
ly Distance between ymaxymin.
lz Distance between zmaxzmin.
pmax Point at maximum extent.
pmin Point at minimum extent.
volume Cuboid volume, V=xyz.
xmax xmax coordinate.
xmin xmin coordinate.
ymax ymax coordinate.
ymin ymin coordinate.
zmax zmax coordinate.
zmin zmin coordinate.

Methods Summary

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

Attributes Documentation

a

Alias for Cuboid.lx.

abc

Alias for Cuboid.lengths.

b

Alias for Cuboid.ly.

c

Alias for Cuboid.lz.

centroid

Cuboid centroid, (cx,cy,cz).

Computed as the 3D Point (cx,cy,cz) with coordinates:

cx=xmin+xmax2cy=ymin+ymax2cz=zmin+zmax2
Returns:3D Point of centroid.
Return type:Point
lengths

tuple of side lengths

lx

Distance between xmaxxmin.

ly

Distance between ymaxymin.

lz

Distance between zmaxzmin.

pmax

Point at maximum extent.

pmin

Point at minimum extent.

volume

Cuboid volume, V=xyz.

xmax

xmax coordinate.

xmin

xmin coordinate.

ymax

ymax coordinate.

ymin

ymin coordinate.

zmax

zmax coordinate.

zmin

zmin coordinate.

Methods Documentation

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

Test region membership of point in Cuboid.

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

Notes

A point (px,py,pz) is within the bounded region of a cuboid with lower corner at pmin=(xmin,ymin,zmin) and upper corner at pmax=(xmax,ymax,zmax) if the following is true:

xminxxmaxyminyymaxzminzzmax
todict()[source] [edit on github][source]

Returns a dict of the Cuboid constructor parameters.