Parallelepiped¶
-
class
sknano.core.geometric_regions.
Parallelepiped
(o=None, u=None, v=None, w=None)[source] [edit on github][source]¶ Bases:
sknano.core.geometric_regions.Geometric3DRegion
Geometric3DRegion
for a parallelepiped.New in version 0.3.0.
Represents a parallelepiped with origin (ox,oy,oz) and direction vectors u=(ux,uy,uz), v=(vx,vy,vz), and w=(wx,wy,wz).
Parameters: Notes
Parallelepiped
represents the bounded region {o+λ1u+λ2v+λ3w∈R3|0≤λi≤1}, where u, v, and w have to be linearly independent.Calling
Parallelepiped
with no parameters is equivalent toParallelepiped
(o=[0, 0, 0], u=[1, 0, 0], v=[1, 1, 0], w=[0, 1, 1])
.Attributes
a
Alias for Parallelepiped.u.length
.abc
Alias for Parallelepiped.lengths
.b
Alias for Parallelepiped.v.length
.bounding_box
Bounding Cuboid
.c
Alias for Parallelepiped.w.length
.center
Alias for centroid
.centroid
Parallelepiped centroid, (cx,cy,cz). fmtstr
Format string. lengths
tuple
of side lengthsmeasure
Alias for volume
, which is the measure of a 3D geometric region.ndim
Return the dimensions. o
3D point coordinates (ox,oy,oz) of origin. pmax
Point
at maximum extent.pmin
Point
at minimum extent.u
3D direction vector u=(ux,uy,uz), with origin o
v
3D direction vector v=(vx,vy,vz), with origin o
volume
Parallelepiped volume, V. w
3D direction vector w=(wx,wy,wz), with origin o
Methods
center_centroid
()Center centroid
on origin.contains
(point)Test region membership of point
inParallelepiped
.get_points
()Return list of points from GeometricRegion.points
andGeometricRegion.vectors
rotate
(**kwargs)Rotate GeometricRegion
points
andvectors
.todict
()Returns a dict
of theParallelepiped
constructor parameters.translate
(t[, fix_anchor_points])Translate GeometricRegion
points
andvectors
byVector
t
.Attributes Summary
a
Alias for Parallelepiped.u.length
.abc
Alias for Parallelepiped.lengths
.b
Alias for Parallelepiped.v.length
.c
Alias for Parallelepiped.w.length
.centroid
Parallelepiped centroid, (cx,cy,cz). lengths
tuple
of side lengthso
3D point coordinates (ox,oy,oz) of origin. u
3D direction vector u=(ux,uy,uz), with origin o
v
3D direction vector v=(vx,vy,vz), with origin o
volume
Parallelepiped volume, V. w
3D direction vector w=(wx,wy,wz), with origin o
Methods Summary
contains
(point)Test region membership of point
inParallelepiped
.todict
()Returns a dict
of theParallelepiped
constructor parameters.Attributes Documentation
-
a
¶ Alias for
Parallelepiped.u.length
.
-
abc
¶ Alias for
Parallelepiped.lengths
.
-
b
¶ Alias for
Parallelepiped.v.length
.
-
c
¶ Alias for
Parallelepiped.w.length
.
-
centroid
¶ Parallelepiped centroid, (cx,cy,cz).
Computed as the 3D point (cx,cy,cz) with coordinates:
cx=ox+ux+vx+wx2cy=oy+uy+vy+wy2cz=oz+uz+vz+wz2where (ox,oy,oz), (ux,uy,uz), (vx,vy,vz), and (wx,wy,wz) are the (x,y,z) coordinates of the origin o and (x,y,z) components of the direction vectors u, v, and w, respectively.
Returns: 3D Point
of centroid.Return type: Point
-
o
¶ 3D point coordinates (ox,oy,oz) of origin.
Returns: 3D Point
coordinates (ox,oy,oz) of origin.Return type: Point
-
volume
¶ Parallelepiped volume, V.
Computed as:
V=|u⋅v×w|
Methods Documentation
-
contains
(point)[source] [edit on github][source]¶ Test region membership of
point
inParallelepiped
.Parameters: point (array_like) – Returns: True
ifpoint
is withinParallelepiped
,False
otherwiseReturn type: bool
Notes
A
point
(px,py,pz) is within the bounded region of a parallelepiped with origin (ox,oy,oz) and direction vectors u=(ux,uy,uz), v=(vx,vy,vz), and w=(wx,wy,wz) if the following is true:0≤vz(wx(py−oy)+wy(ox−px))+wz(vx(oy−py)+vy(px−ox))+oz(vywx−vxwy)+pz(vxwy−vywx)uz(vxwy−vywx)+uy(vzwx−vxwz)+ux(vywz−vzwy)≤1∧0≤uz(wx(py−oy)+wy(ox−px))+wz(ux(oy−py)+uy(px−ox))+oz(uywx−uxwy)+pz(uxwy−uywx)uz(vywx−vxwy)+uy(vxwz−vzwx)+ux(vzwy−vywz)≤1∧0≤uz(vx(py−oy)+vy(ox−px))+vz(ux(oy−py)+uy(px−ox))+oz(uyvx−uxvy)+pz(uxvy−uyvx)uz(vxwy−vywx)+uy(vzwx−vxwz)+ux(vywz−vzwy)≤1
-
todict
()[source] [edit on github][source]¶ Returns a
dict
of theParallelepiped
constructor parameters.
-