Skip to content
Michael Keilman edited this page Jul 20, 2022 · 16 revisions

in progress

VTK is open-source 3D rendering code authored by KitWare. We use it to visualize particle trajectories in WarpVND, magnets in Radia, and beamlines in SRW and OPAL. Many upcoming projects also feature 3D visualization.

VTK is available in several languages. Development is most active in C++; it can be useful as a guide to its capabilities. We use the javascript version, which though it lags C++, is still under very active development, often releasing several updates in a day. We wait on major versions ("x" of "x.y.z") (or soon thereafter).

We have wrapped common VTK code in our own classes for ease of reuse across apps; see the documentation below.

API

CoordMapper

Provides a mapping from "lab" coordinates to vtk's coordinates via a SIREPO.GEOMETRY.Transform. Also wraps the creation of various Bundles so the transform gets applied automatically

Constructor

new CoordMapper(transform)

Parameters:
Name Type Description
transform SIREPO.GEOMETRY.Transform a Transform to translate between "lab" and "local" coordinate systems

Source:

Methods

buildActorBundle(source, transform, actorProperties)

Creates a Bundle from an arbitrary source

Parameters:
Name Type Description
source * a vtk source, reader, etc.
transform SIREPO.GEOMETRY.Transform a Transform to translate between "lab" and "local" coordinate systems
actorProperties Object a map of actor properties (e.g. 'color') to values

Source:

buildBox(labSize, labCenter, actorProperties) → {BoxBundle}

Builds a box

Parameters:
Name Type Description
labSize Array.<number> array of the x, y, z sides of the box in the lab
labCenter Array.<number> array of the x, y, z coords of the box's center in the lab
actorProperties Object a map of actor properties (e.g. 'color') to values

Source:

Returns:

Type
BoxBundle

buildLine(labP1, labP2, actorProperties) → {LineBundle}

Builds a line

Parameters:
Name Type Description
labP1 Array.<number> 1st point
labP2 Array.<number> 2nd point
actorProperties Object a map of actor properties (e.g. 'color') to values

Source:

Returns:

Type
LineBundle

buildPlane(labOrigin, labP1, labP2, actorProperties) → {LineBundle}

Builds a plane

Parameters:
Name Type Description
labOrigin Array.<number> origin
labP1 Array.<number> 1st point
labP2 Array.<number> 2nd point
actorProperties Object a map of actor properties (e.g. 'color') to values

Source:

Returns:

Type
LineBundle

buildSphere(labCenter, radius, actorProperties) → {SphereBundle}

Builds a sphere

Parameters:
Name Type Description
labCenter Array.<number> center in the lab
radius number
actorProperties Object a map of actor properties (e.g. 'color') to values

Source:

Returns:

Type
SphereBundle

Documentation generated by JSDoc 3.6.10 on Wed Jul 13 2022 15:19:06 GMT+0000 (GMT)

Also see sirepo-geometry.js

Clone this wiki locally