Skip to content

PolyLine ​

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)

ArgumentTypeRequiredDescription
subIdnumberYes
pcoordsVector3YesThe parametric coordinates
xVector3YesThe global coordinate
weightsVector2YesThe 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)

ArgumentTypeRequiredDescription
subIdnumberYes
pcoordsVector3YesThe parametric coordinates
qVector3YesThe global orientation
weightsVector2YesThe interpolation weights

Returns ​

TypeDescription
booleanWether the orientation has been set in `q'

extend ​

Method used to decorate a given object (publicAPI+model) with vtkPolyLine characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIPolyLineInitialValuesNo(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

ArgumentTypeRequiredDescription
distanceYesThe 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 ​

ArgumentTypeRequiredDescription
t1numberYes
t2numberYes
p1Vector3YesThe first point coordinate.
p2Vector3YesThe second point coordinate.
tolNumberYesThe tolerance to use.
xVector3YesThe point which intersect the line.
pcoordsVector3YesThe parametric coordinates.

newInstance ​

Method used to create a new instance of vtkPolyLine.

ArgumentTypeRequiredDescription
initialValuesIPolyLineInitialValuesNofor pre-setting some of its content

setDistanceFunction ​

ArgumentTypeRequiredDescription
fYes

setOrientations ​

ArgumentTypeRequiredDescription
orientationsYes