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.Geometric3DRegionGeometric3DRegionfor a cuboid.New in version 0.3.0.
Represents an axis-aligned cuboid with lower corner \(p_{\mathrm{min}}= (x_{\mathrm{min}},y_{\mathrm{min}},z_{\mathrm{min}})\) and upper corner \(p_{\mathrm{max}}= (x_{\mathrm{max}},y_{\mathrm{max}},z_{\mathrm{max}})\).
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
Cuboidrepresents the region \(\left\{\{x, y, z\}| x_{\mathrm{min}}\le x\le x_{\mathrm{max}}\land y_{\mathrm{min}}\le y\le y_{\mathrm{max}}\land z_{\mathrm{min}}\le z\le z_{\mathrm{max}}\right\}\)Calling
Cuboidwith no parameters is equivalent toCuboid(pmin=[0, 0, 0], pmax=[1, 1, 1]).Attributes
aAlias for Cuboid.lx.abcAlias for Cuboid.lengths.bAlias for Cuboid.ly.bounding_boxBounding Cuboid.cAlias for Cuboid.lz.centerAlias for centroid.centroidCuboidcentroid, \((c_x, c_y, c_z)\).fmtstrFormat string. lengthstupleof side lengthslxDistance between \(x_{\mathrm{max}}-x_{\mathrm{min}}\). lyDistance between \(y_{\mathrm{max}}-y_{\mathrm{min}}\). lzDistance between \(z_{\mathrm{max}}-z_{\mathrm{min}}\). measureAlias for volume, which is the measure of a 3D geometric region.ndimReturn the dimensions. pmaxPointat maximum extent.pminPointat minimum extent.volumeCuboidvolume, \(V=\ell_x\ell_y\ell_z\).xmax\(x_{\mathrm{max}}\) coordinate. xmin\(x_{\mathrm{min}}\) coordinate. ymax\(y_{\mathrm{max}}\) coordinate. ymin\(y_{\mathrm{min}}\) coordinate. zmax\(z_{\mathrm{max}}\) coordinate. zmin\(z_{\mathrm{min}}\) coordinate. Methods
center_centroid()Center centroidon origin.contains(point)Test region membership of pointinCuboid.get_points()Return list of points from GeometricRegion.pointsandGeometricRegion.vectorsrotate(**kwargs)Rotate GeometricRegionpointsandvectors.todict()Returns a dictof theCuboidconstructor parameters.translate(t[, fix_anchor_points])Translate GeometricRegionpointsandvectorsbyVectort.Attributes Summary
aAlias for Cuboid.lx.abcAlias for Cuboid.lengths.bAlias for Cuboid.ly.cAlias for Cuboid.lz.centroidCuboidcentroid, \((c_x, c_y, c_z)\).lengthstupleof side lengthslxDistance between \(x_{\mathrm{max}}-x_{\mathrm{min}}\). lyDistance between \(y_{\mathrm{max}}-y_{\mathrm{min}}\). lzDistance between \(z_{\mathrm{max}}-z_{\mathrm{min}}\). pmaxPointat maximum extent.pminPointat minimum extent.volumeCuboidvolume, \(V=\ell_x\ell_y\ell_z\).xmax\(x_{\mathrm{max}}\) coordinate. xmin\(x_{\mathrm{min}}\) coordinate. ymax\(y_{\mathrm{max}}\) coordinate. ymin\(y_{\mathrm{min}}\) coordinate. zmax\(z_{\mathrm{max}}\) coordinate. zmin\(z_{\mathrm{min}}\) coordinate. Methods Summary
contains(point)Test region membership of pointinCuboid.todict()Returns a dictof theCuboidconstructor parameters.Attributes Documentation
-
abc¶ Alias for
Cuboid.lengths.
-
centroid¶ Cuboidcentroid, \((c_x, c_y, c_z)\).Computed as the 3D
Point\((c_x, c_y, c_z)\) with coordinates:\[c_x = \frac{x_{\mathrm{min}} + x_{\mathrm{max}}}{2}\]\[c_y = \frac{y_{\mathrm{min}} + y_{\mathrm{max}}}{2}\]\[c_z = \frac{z_{\mathrm{min}} + z_{\mathrm{max}}}{2}\]Returns: 3D Pointof centroid.Return type: Point
-
lx¶ Distance between \(x_{\mathrm{max}}-x_{\mathrm{min}}\).
-
ly¶ Distance between \(y_{\mathrm{max}}-y_{\mathrm{min}}\).
-
lz¶ Distance between \(z_{\mathrm{max}}-z_{\mathrm{min}}\).
-
pmax¶ Pointat maximum extent.
-
pmin¶ Pointat minimum extent.
-
xmax¶ \(x_{\mathrm{max}}\) coordinate.
-
xmin¶ \(x_{\mathrm{min}}\) coordinate.
-
ymax¶ \(y_{\mathrm{max}}\) coordinate.
-
ymin¶ \(y_{\mathrm{min}}\) coordinate.
-
zmax¶ \(z_{\mathrm{max}}\) coordinate.
-
zmin¶ \(z_{\mathrm{min}}\) coordinate.
Methods Documentation
-
contains(point)[source] [edit on github][source]¶ Test region membership of
pointinCuboid.Parameters: point (array_like) – Returns: Trueifpointis withinCuboid,False, otherwise.Return type: boolNotes
A point \((p_x, p_y, p_z)\) is within the bounded region of a cuboid with lower corner at \(p_{\mathrm{min}}= (x_{\mathrm{min}}, y_{\mathrm{min}}, z_{\mathrm{min}})\) and upper corner at \(p_{\mathrm{max}}= (x_{\mathrm{max}}, y_{\mathrm{max}}, z_{\mathrm{max}})\) if the following is true:
\[x_{\mathrm{min}}\le x\le x_{\mathrm{max}}\land\]\[y_{\mathrm{min}}\le y\le y_{\mathrm{max}}\land\]\[z_{\mathrm{min}}\le z\le z_{\mathrm{max}}\]
- pmax (pmin,) – The minimum and maximum 3D point coordinates of the axis-aligned
cuboid from