s3dlib.surface.Vector3DCollection

Contents

Geometry Properties

name

Descriptive identifier for the vector geometry.

bounds

Dictionary of vector geometric and value ranges.

alr

Arrow head to length ratio.

Color Properties/Methods

cname

Descriptive identifier for values indicated by color.

vlim

Range of values associated with color


The following methods will return the calling object (self).

map_color_from_op(operation[, rgb, cname])

Assignment of vector color from a function.

map_cmap_from_op(operation[, cmap, cname])

Functional assignment of a vector color from a color map.

map_cmap_from_direction([cmap, direction, cname])

Vector color assignment using vector direction relative to direction argument.

map_cmap_from_magnitude([cmap, cname])

Vector color assignment using vector magnitude.

Code Documentation

class s3dlib.surface.Vector3DCollection(location, vect, alr=None, name=None, **kwargs)[source]

Bases: Line3DCollection

Collection of 3D vectors represented as arrows.

Create a collection of 3D vectors.

Parameters:
  • location (N x 3 float array) – Cartesian coordinate location (tails) for N number of vectors.

  • vect (N x 3 float array) – N number of vectors in Cartesian coordinates.

  • alr (scalar, optional, default: 0.25) – Axis length ratio, head size to vector magnitude.

  • name (string identifier) –

  • **kwargs – All other parameters are passed on to mpl_toolkits.mplot3d.art3d.Line3DCollection. Valid keywords include: colors, linewidths.

property alr

Arrow head to length ratio.

property bounds

Dictionary of vector geometric and value ranges.

Each dictionary value is a 2 float array of minimum and maximum values of the vector location. Keys are:

‘xlim’ : x-coordinate

‘ylim’ : y-coordinate

‘zlim’ : z-coordinate

‘r_xy’ : radial distance from the z axis

‘rorg’ : radial distance from the origin

‘vlim’ : value functional assignments.

‘vertvlim: magnitude

Values are assigned from the geometry and color mapping methods.

property cname

Descriptive identifier for values indicated by color.

map_cmap_from_direction(cmap=None, direction=[1, 1, 1], cname=None)[source]

Vector color assignment using vector direction relative to direction argument.

The dot product of vector direction with the argument direction is used to assign vector colors from a colormap.

Parameters:
  • cmap (str or Colormap, optional, default: 'viridis') – A Colormap instance or registered colormap name. If not assigned, the surface Colormap is used. The colormap maps the dot product values to colors.

  • direction (list of size 3, optional, default: [1,1,1]) – A 3D vector in xyz Cartesian coordinates designating the reference direction.

  • refCoor (string, optional, default: "XYZ") – Direction coordinate system for the evaluation. (Not implimented)

Returns:

self (Vector3DCollection object)

map_cmap_from_magnitude(cmap=None, cname=None)[source]

Vector color assignment using vector magnitude.

Parameters:

cmap (str or Colormap, optional, default: 'viridis') – A Colormap instance or registered colormap name. If not assigned, the surface Colormap is used. The colormap maps the dot product values to colors.

Returns:

self (Vector3DCollection object)

map_cmap_from_op(operation, cmap=None, cname=None)[source]

Functional assignment of a vector color from a color map.

Location and direction coordinates are used to calculate a scalar which is then used to assign face colors from a colormap.

Parameters:
  • operation (function object) – Function that takes two arguments, both a 3xN Numpy array of xyz coordinates. The first and second arguments are the location and direction, respectively. The function returns a Numpy array of scalar values.

  • cmap (str or Colormap, optional) – A Colormap instance or registered colormap name. If not assigned, the surface Colormap is used. The colormap maps the function return values to colors.

Returns:

self (Vector3DCollection object)

map_color_from_op(operation, rgb=True, cname=None)[source]

Assignment of vector color from a function.

Vector colors are assigned from a function of direction and location coordinates.

Parameters:
  • operation (function object) – Function that takes two arguments, both a 3xN Numpy array of xyz coordinates. The first and second arguments are the location and direction, respectively. The function returns a 3xN color value.

  • rgb (bool {True, False}, optional, default: True) – By default, RGB color values are returned by the operation function. If set False, the operation returns HSV color values.

Returns:

self (Vector3DCollection object)

property name

Descriptive identifier for the vector geometry.

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>, colors=<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>, segments=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, sort_zpos=<UNSET>, transform=<UNSET>, url=<UNSET>, urls=<UNSET>, verts=<UNSET>, visible=<UNSET>, zorder=<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 colors colors: color or list of colors edgecolor or ec or edgecolors: color or list of colors or ‘face’ facecolor or facecolors or fc: color or list of colors 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: unknown picker: None or bool or float or callable pickradius: float rasterized: bool segments: unknown sketch_params: (scale: float, length: float, randomness: float) snap: bool or None sort_zpos: unknown transform: .Transform url: str urls: list of str or None verts: unknown visible: bool zorder: float

property vlim

Range of values associated with color