s3dlib.surface.PolarSurface

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

Bases: Surface3DCollection

Flat disk 3D surface in polar coordinates.

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

Create flat disk surface of unit radius.

Parameters:
  • rez (integer, optional, default: 0) – Number of recursive subdivisions of the triangulated base faces. Rez values range from 0 to 7.

  • basetype ({'squ','hex','squ_s','hex_s','squ_c','hex_c'}, optional, default: 'hex') – Starting surface geometries from which the surface is constructed using recursive subdivisions of the triangular faces.

  • minrad (scalar, optional, default: 0.01) – For basetypes ‘squ_c’ and ‘hex_c, the minimum distance from the z-axis of any vertex coordinate.

  • name (string, optional, default: None.) – Descriptive identifier for the geometry.

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

Raises:

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

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

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

Parameters:
  • xyz (3xN array) – N number of vectors in either polar or cartesian coordinates.

  • tocart ({ True, False }, default: False) – If True, input is polar and output is cartesian. If False, input is cartesian and output is polar.

Returns:

list (3xN array) – Transformed coordinates.

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

Set the domain of the polar surface.

Used for setting the limits of the base polar plane.

Parameters:

radius (number, default : 1) – Radius of the polar surface. If set to None, the radius is unchanged.

zcoor: number, default0

Z offset of the polar plane. If set to None, the Z offset is unchanged.

Returns:

self (PolarSurface object)

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

PolarSurface with axial and radial faces.

Parameters:
  • nrad (integer, required.) – Number of radial subdivisions. Minimum value is 1

  • nang (integer, required.) – Number of angular subdivisions. Minimum value is 3.

  • basetype ({'d','s','q','w','r','x'}, 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.

  • name (string, optional, default: None.) – Descriptive identifier.

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

Raises:

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

Returns:

surface (PolarSurface object.)

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

PolarSurface from points in polar coordinates.

Parameters:
  • rtz_points (array, required.) – An N X 3, or N X 4, array of N polar coordinate points. For an N X 4 array, the 4th is the vertex scalar value.

  • name (string, optional, default: None.) – Descriptive identifier for the point surface.

Returns:

surface (PolarSurface object)

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

PolarSurface 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)

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

Raises:

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

Returns:

surface (PolarSurface object.)

set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, array=<UNSET>, capstyle=<UNSET>, clim=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, cmap=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, norm=<UNSET>, offset_transform=<UNSET>, offsets=<UNSET>, path_effects=<UNSET>, paths=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, sizes=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, sort_zpos=<UNSET>, surface_alpha=<UNSET>, transform=<UNSET>, url=<UNSET>, urls=<UNSET>, verts=<UNSET>, verts_and_codes=<UNSET>, vertvals=<UNSET>, visible=<UNSET>, zorder=<UNSET>, zsort=<UNSET>)

Set multiple properties at once.

Supported properties are

Properties:

agg_filter: a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array alpha: array-like or scalar or None animated: bool antialiased or aa or antialiaseds: bool or list of bools array: array-like or None capstyle: .CapStyle or {‘butt’, ‘projecting’, ‘round’} clim: (vmin: float, vmax: float) clip_box: .Bbox clip_on: bool clip_path: Patch or (Path, Transform) or None cmap: .Colormap or str or None color: color or list of rgba tuples edgecolor or ec or edgecolors: unknown facecolor or facecolors or fc: unknown figure: .Figure gid: str hatch: {‘/’, ‘\’, ‘|’, ‘-’, ‘+’, ‘x’, ‘o’, ‘O’, ‘.’, ‘*’} in_layout: bool joinstyle: .JoinStyle or {‘miter’, ‘round’, ‘bevel’} label: object linestyle or dashes or linestyles or ls: str or tuple or list thereof linewidth or linewidths or lw: float or list of floats norm: .Normalize or None offset_transform: .Transform offsets: (N, 2) or (2,) array-like path_effects: .AbstractPathEffect paths: list of array-like picker: None or bool or float or callable pickradius: float rasterized: bool sizes: ndarray or None sketch_params: (scale: float, length: float, randomness: float) snap: bool or None sort_zpos: unknown surface_alpha: scalar transform: .Transform url: str urls: list of str or None verts: unknown verts_and_codes: unknown vertvals: list or array of length N, where N is the visible: bool zorder: float zsort: {‘average’, ‘min’, ‘max’}