s3dlib.surface.CylindricalSurface

class s3dlib.surface.CylindricalSurface(rez=0, basetype=None, name=None, **kwargs)[source]

Bases: s3dlib.surface.Surface3DCollection

Cylindrical 3D surface in cylindrical coordinates.

Methods are inherited from the Surface3DCollection. Cylindrical surface geometries are created in this subclass.

Create cylindrical surface of unit radius and length 2.

Parameters:
  • rez (integer, optional, default: 0) – Number of recursive subdivisions of the triangulated base faces. Rez values range from 0 to 7.
  • basetype ({'tri','squ','tri2','squ2','tri_s','squ_s', 'tri_v','squ_v','tri2_v','squ2_v','tri_sv','squ_sv'}, optional, default: 'tri') – Starting surface geometries from which the surface is constructed using recursive subdivisions of the triangular faces.
  • name (string, optional, default: None.) – Descriptive identifier for the geometry.
Raises:

ValueError – If rez is not an integer in range 0 to 7. If basetype is not recognized for this surface constructor.

Other Parameters:
 

**kwargs – All other parameters are passed on to ‘s3dlib.surface.Surface3DCollection’.

static coor_convert(xyz, tocart=False)[source]

Transformation between cylindrical and Cartesian coordinates. The angular coordinate is in radians with domain 0 to 2pi.

Parameters:
  • xyz (3xN) – N number of vectors in either cylindrical or cartesian coordinates, including the z coordinate( which remains unchanged).
  • tocart ({ True, False }, default: False) – If True, input is cylindrical and output is cartesian. If False, input is cartesian and output is cylindrical.
Returns:

list (3xN array) – Transformed coordinates.

domain(radius=None, zlim=None)[source]

Set the domain of the cylindrical surface.

Used for setting the limits of the base cylinder.

Parameters:
  • radius (number, default : 1) – Radius of the cylindrical surface. If set to None, the domain is unchanged.
  • zlim (2d array) – Minimum and maximum values of the arrays are used to scale and translate the surface from an intial domain of [ -1, 1 ] If set to None, the Z-domain is unchanged.
Returns:

self (CylindricalSurface object)

classmethod grid(nver, nang, basetype='d', minrad=None, numR=None, name=None, **kwargs)[source]

CylindricalSurface with axial and vertical faces.

Parameters:
  • nver (integer, required.) – Number of vertical subdivisions. Minimum value is 1
  • nang (integer, required.) – Number of angular subdivisions. Minimum value is 3.
  • basetype ({'d','q','r','s','w','x', 'dv','qv','rv','sv','wv','xv'}, optional, default: 'd') – Starting surface geometries from which the surface is constructed indicating face shape and if split.
  • minrad (scalar, optional, default: 0.01) – The minimum distance from the z-axis of any vertex coordinate. Use is dependent on basetype.
  • numR (integer, optional, default: None) – Only applicable for volume cylinder geometries. Number of radial subdivisions for volume cylinders. When None, default is half the number of vertical subdivisions.
  • name (string, optional, default: None.) – Descriptive identifier.
Raises:

ValueError – If nver is not an integer greater or equal to 1. If nang is not an integer greater or equal to 3.

Other Parameters:
 

**kwargs – All other parameters are passed on to ‘s3dlib.surface.Surface3DCollection’.

Returns:

surface (CylindricalSurface object.)

classmethod pntsurf(rtz_points, name=None, **kargs)[source]

CylindricalSurface from points in cylindrical coordinates.

Parameters:
  • rtz_points (array, required.) – An N X 3 array of N cylindrical coordinate points.
  • name (string, optional, default: None.) – Descriptive identifier for the point surface.
Returns:

surface (CylindricalSurface object)

static rand(rez=0, seed=None, name=None, kind=None, **kargs)[source]

CylindricalSurface with random triangular faces.

Parameters:
  • rez (number, optional, default: 0) – Number of ‘recursive’ subdivisions of the triangulated base faces. Rez values range from 0 to 7.
  • seed (integer, optional, default: None) – An initialization seed for random generation.
  • name (string, optional, default: None.) – Descriptive identifier for the geometry.
  • kind (string, optional, default: None) – (reserved, not implemented)
Raises:

ValueError – If rez is not an integer in range 0 to 7. If basetype is not recognized for this surface constructor.

Other Parameters:
 

**kwargs – All other parameters are passed on to ‘s3dlib.surface.Surface3DCollection’.

Returns:

surface (CylindricalSurface object.)