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]
topmax=[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}|xmin≤x≤xmax∧ymin≤y≤ymax∧zmin≤z≤zmax}Calling
Cuboid
with no parameters is equivalent toCuboid
(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 lengthslx
Distance between xmax−xmin. ly
Distance between ymax−ymin. lz
Distance between zmax−zmin. 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=ℓxℓyℓz.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
inCuboid
.get_points
()Return list of points from GeometricRegion.points
andGeometricRegion.vectors
rotate
(**kwargs)Rotate GeometricRegion
points
andvectors
.todict
()Returns a dict
of theCuboid
constructor parameters.translate
(t[, fix_anchor_points])Translate GeometricRegion
points
andvectors
byVector
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 lengthslx
Distance between xmax−xmin. ly
Distance between ymax−ymin. lz
Distance between zmax−zmin. pmax
Point
at maximum extent.pmin
Point
at minimum extent.volume
Cuboid
volume, V=ℓxℓyℓz.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
inCuboid
.todict
()Returns a dict
of theCuboid
constructor parameters.Attributes Documentation
-
abc
¶ Alias for
Cuboid.lengths
.
-
centroid
¶ Cuboid
centroid, (cx,cy,cz).Computed as the 3D
Point
(cx,cy,cz) with coordinates:cx=xmin+xmax2cy=ymin+ymax2cz=zmin+zmax2Returns: 3D Point
of centroid.Return type: Point
-
lx
¶ Distance between xmax−xmin.
-
ly
¶ Distance between ymax−ymin.
-
lz
¶ Distance between zmax−zmin.
-
pmax
¶ Point
at maximum extent.
-
pmin
¶ Point
at minimum extent.
-
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
inCuboid
.Parameters: point (array_like) – Returns: True
ifpoint
is withinCuboid
,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:
xmin≤x≤xmax∧ymin≤y≤ymax∧zmin≤z≤zmax
- pmax (pmin,) – The minimum and maximum 3D point coordinates of the axis-aligned
cuboid from