sknano.core.geometric_regions.Cylinder¶
-
class
sknano.core.geometric_regions.
Cylinder
(p1=None, p2=None, r=1)[source][source]¶ Geometric3DRegion
for a cylinder.New in version 0.3.10.
Represents a cylinder of radius r around the line from (x1,y1,z1) to (x2,y2,z2).
Parameters: p1, p2 : array_like, optional
3-tuples or
Point
class instances specifying theCylinder
axis from point p1=(x1,y1,z1) to p2=(x2,y2,z2).r : float, optional
Cylinder
radius rNotes
Cylinder
represents a cylinder region {p1+ρcos(θ)v1+ρsin(θ)v2+v3z|0≤θ≤2π∧0≤ρ≤1∧0≤z≤1} where v3=p2−p1 and the vectors {v1,v2,v3} are orthogonal with |v1|=|v2|=1, and p1=(x1,y1,z1) and p2=(x2,y2,z2).Calling
Cylinder
with no parameters is equivalent toCylinder
(p1=[0, 0, -1], p2=[0, 0, 1], r=1).Attributes
axis
Cylinder
axisVector
\boldsymbol{\ell}=p_2 - p_1.center
Alias for centroid
.centroid
Cylinder
centroid, (c_x, c_y, c_z).fmtstr
Format string. measure
Alias for volume
, which is the measure of a 3D geometric region.p1
Cylinder
axis point p_1=(x_1, y_1, z_1).p2
Cylinder
axis point p_2=(x_2, y_2, z_2).r
Cylinder
radius r.volume
Cylinder
volume, V=\pi r^2 \ell.Methods
center_centroid
()Center centroid
on origin.contains
(point)Test region membership of point in Cylinder
.rotate
([angle, axis, anchor_point, ...])Rotate GeometricRegion
points
andvectors
.todict
()Returns a dict
of theCylinder
constructor parameters.translate
(t[, fix_anchor_points])Translate GeometricRegion
points
andvectors
byVector
t.