Introduction
vtkPolyLine is a cell which representant a poly line.
See Also
vtkCell
Methods
evaluateLocation
Determine global coordinate (x[3]) from subId and parametric coordinates.
Also set interpolation weights. (There are two weights for the two
points of the line segment specified by subId)
Argument | Type | Required | Description |
---|---|---|---|
subId |
number | Yes | |
pcoords |
Vector3 | Yes | The parametric coordinates |
x |
Vector3 | Yes | The global coordinate |
weights |
Vector2 | Yes | The interpolation weights |
evaluateOrientation
Determine global orientation (q[3]) from subId and parametric coordinates.
This uses the same algorithm as vtkLine (interpolates using slerp).
Also set interpolation weights. (There are two weights for the two
points of the line segment specified by subId)
Argument | Type | Required | Description |
---|---|---|---|
subId |
number | Yes | |
pcoords |
Vector3 | Yes | The parametric coordinates |
q |
Vector3 | Yes | The global orientation |
weights |
Vector2 | Yes | The interpolation weights |
Returns
Type | Description |
---|---|
boolean | Wether the orientation has been set in `q’ |
extend
Method used to decorate a given object (publicAPI+model) with vtkPolyLine characteristics.
Argument | Type | Required | Description |
---|---|---|---|
publicAPI |
Yes | object on which methods will be bounds (public) | |
model |
Yes | object on which data structure will be bounds (protected) | |
initialValues |
IPolyLineInitialValues | No | (default: {}) |
findPointIdAtDistanceFromFirstPoint
Returns the subId of the segment at the given distance from the first
point of the polyline
If the distance is negative or greater than the total length of the
polyline, returns -1
Argument | Type | Required | Description |
---|---|---|---|
distance |
Yes | The distance from the first point of the polyline |
getCellDimension
Get the topological dimensional of the cell (0, 1, 2 or 3).
getDistanceFunction
The function used in getDistancesToFirstPoint and in findPointIdAtDistanceFromFirstPoint
Defaults to vec3.dist of gl-matrix
getDistancesToFirstPoint
Returns an array containing for each pointIdx between 0 (included) and
numberOfPoints (excluded) the distance from the first point of the
polyline to the point at pointIdx
In particular if tda = publicAPI.getDistancesToFirstPoint(), then tda[0] = 0
and tda[tda.length - 1] is the total length of the polyline
getOrientations
An array of quaternions used to orient the polyline at each of its point
The length of the array has to be the same size as the number of points
Defaults to null.
intersectWithLine
Argument | Type | Required | Description |
---|---|---|---|
t1 |
number | Yes | |
t2 |
number | Yes | |
p1 |
Vector3 | Yes | The first point coordinate. |
p2 |
Vector3 | Yes | The second point coordinate. |
tol |
Number | Yes | The tolerance to use. |
x |
Vector3 | Yes | The point which intersect the line. |
pcoords |
Vector3 | Yes | The parametric coordinates. |
newInstance
Method used to create a new instance of vtkPolyLine.
Argument | Type | Required | Description |
---|---|---|---|
initialValues |
IPolyLineInitialValues | No | for pre-setting some of its content |
setDistanceFunction
Argument | Type | Required | Description |
---|---|---|---|
f |
Yes |
setOrientations
Argument | Type | Required | Description |
---|---|---|---|
orientations |
Yes |
Source
import { quat, vec3 } from 'gl-matrix'; |
import macro from 'vtk.js/Sources/macros'; |