Cube¶
-
class
sknano.core.geometric_regions.Cube(center=None, a=1)[source] [edit on github][source]¶ Bases:
sknano.core.geometric_regions.Geometric3DRegionGeometric3DRegionfor a cube.New in version 0.3.0.
Cuberepresents the region {{ci±a2}|a>0∀i∈{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
Cubewith no parameters is equivalent toCube(center=[0, 0, 0], a=1).Attributes
aSide length a of the axis-aligned cube. bounding_boxBounding Cuboid.centerCenter point (cx,cy,cz) of axis-aligned cube. centroidAlias for center.fmtstrFormat string. measureAlias for volume, which is the measure of a 3D geometric region.ndimReturn the dimensions. pmaxPointat maximum extent.pminPointat minimum extent.volumeCubevolume, V=a3.Methods
center_centroid()Center centroidon origin.contains(point)Test region membership of pointinCube.get_points()Return list of points from GeometricRegion.pointsandGeometricRegion.vectorsrotate(**kwargs)Rotate GeometricRegionpointsandvectors.todict()Returns a dictof theCubeconstructor parameters.translate(t[, fix_anchor_points])Translate GeometricRegionpointsandvectorsbyVectort.Attributes Summary
aSide length a of the axis-aligned cube. centerCenter point (cx,cy,cz) of axis-aligned cube. centroidAlias for center.volumeCubevolume, V=a3.Methods Summary
contains(point)Test region membership of pointinCube.todict()Returns a dictof theCubeconstructor parameters.Attributes Documentation
-
a¶ Side length a of the axis-aligned cube.
-
center¶ Center point (cx,cy,cz) of axis-aligned cube.
Methods Documentation
-
contains(point)[source] [edit on github][source]¶ Test region membership of
pointinCube.Parameters: point (array_like) – Returns: Trueifpointis withinCube,FalseotherwiseReturn type: boolNotes
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:ci−a2≤pi≤ci+a2∀i∈{x,y,z}