Line
Introduction
vtkLine is a cell which representant a line. It contains static method to make some computations directly link to line.
See Also
vtkCell
Methods
distanceToLine
Compute the distance from x to the line composed by p1 and p2. If an object is set as a fourth argument, then the closest point on the line from x will be set into it.
{
t: tolerance of the distance
distance: quared distance between closest point and x
}| Argument | Type | Required | Description |
|---|---|---|---|
x | Vector3 | Yes | |
p1 | Vector3 | Yes | |
p2 | Vector3 | Yes | |
closestPoint | Vector3 | No |
evaluateLocation
Determine the global coordinates x' and parametric coordinates pcoords' in the cell.
evaluateOrientation
Determine the global orientation q' and parametric coordinates pcoords' in the cell. Use slerp to interpolate orientation Returns wether the orientation has been set in `q'
extend
Method used to decorate a given object (publicAPI+model) with vtkLine 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 | ILineInitialValues | No | (default: {}) |
getCellDimension
Get the topological dimensional of the cell (0, 1, 2 or 3).
getOrientations
Get the list of orientations (a list of quat) for each point of the line. Can be null if the line is not oriented
intersectWithLine
Compute the intersection point of the intersection between line and line defined by p1 and p2. tol Tolerance use for the position evaluation x is the point which intersect triangle (computed in function) pcoords parametric coordinates (computed in function) A javascript object is returned :
{
evaluation: define if the line has been intersected or not
subId: always set to 0
t: tolerance of the intersection
}| Argument | Type | Required | Description |
|---|---|---|---|
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 triangle. |
pcoords | Vector3 | Yes | The parametric coordinates. |
intersection
Performs intersection of two finite 3D lines. An intersection is found if the projection of the two lines onto the plane perpendicular to the cross product of the two lines intersect, and if the distance between the closest * points of approach are within a relative tolerance. The parameters (u,v) are the parametric coordinates of the lines at the position of closest approach. Careful, u and v are filled inside the function. Outside the function, they have to be access with : u[0] and v[0] return IntersectionState enum :
enum IntersectionState {
NO_INTERSECTION,
YES_INTERSECTION,
ON_LINE
}| Argument | Type | Required | Description |
|---|---|---|---|
a1 | Vector3 | Yes | |
a2 | Vector3 | Yes | |
b1 | Vector3 | Yes | |
b2 | Vector3 | Yes | |
u | Vector3 | Yes | |
v | Vector3 | Yes |
newInstance
Method used to create a new instance of vtkLine.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | ILineInitialValues | No | for pre-setting some of its content |
setOrientations
| Argument | Type | Required | Description |
|---|---|---|---|
orientations | Yes | The list of orientation per point of the centerline |