XLineXYZ Module
Functions and values
| Function or value |
Description
|
Full Usage:
doIntersect (pAx, pAy, pAz, pBx, pBy, pBz, vAx, vAy, vAz, vBx, vBy, vBz, maxSkewDistance, tangent, tooShortTolerance)
Parameters:
float
-
The X coordinate of the start point on the first line.
pAy : float
-
The Y coordinate of the start point on the first line.
pAz : float
-
The Z coordinate of the start point on the first line.
pBx : float
-
The X coordinate of the start point on the second line.
pBy : float
-
The Y coordinate of the start point on the second line.
pBz : float
-
The Z coordinate of the start point on the second line.
vAx : float
-
The X component of the vector of the first line.
vAy : float
-
The Y component of the vector of the first line.
vAz : float
-
The Z component of the vector of the first line.
vBx : float
-
The X component of the vector of the second line.
vBy : float
-
The Y component of the vector of the second line.
vBz : float
-
The Z component of the vector of the second line.
maxSkewDistance : float
-
The maximum allowed distance at closest approach to still consider the lines intersecting.
tangent : float<MeasureProduct<tangent, MeasureOne>>
-
Is the tangent of the maximum allowed angle between the two line vectors.
Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
tooShortTolerance : float
-
Is a length tolerance.
If one or both lines are shorter than this, FALSE is returned.
Returns: bool
TRUE if the lines intersect within the given tolerance, FALSE if the segments are skew, parallel, or too short.
|
Checks if two non zero finite 3D lines intersect within a given tolerance.
|
Full Usage:
doOverlap (pAx, pAy, pAz, pBx, pBy, pBz, vAx, vAy, vAz, vBx, vBy, vBz, tolerance)
Parameters:
float
-
The X coordinate of the start point on the first line.
pAy : float
-
The Y coordinate of the start point on the first line.
pAz : float
-
The Z coordinate of the start point on the first line.
pBx : float
-
The X coordinate of the start point on the second line.
pBy : float
-
The Y coordinate of the start point on the second line.
pBz : float
-
The Z coordinate of the start point on the second line.
vAx : float
-
The X component of the vector of the first line.
vAy : float
-
The Y component of the vector of the first line.
vAz : float
-
The Z component of the vector of the first line.
vBx : float
-
The X component of the vector of the second line.
vBy : float
-
The Y component of the vector of the second line.
vBz : float
-
The Z component of the vector of the second line.
tolerance : float
-
Is a distance tolerance.
Used for checking if the distance between parallel lines is less than this value.
Returns: bool
TRUE if the lines are coincident and overlap or touch.
FALSE if the lines are not coincident or do not overlap nor touch.
|
Checks if 3D lines are not only parallel and coincident but are also overlapping or at least touching at their ends.
|
Full Usage:
doRaysIntersect (pAx, pAy, pAz, pBx, pBy, pBz, vAx, vAy, vAz, vBx, vBy, vBz, maxSkewDistance)
Parameters:
float
-
The X coordinate of the start point on the first ray.
pAy : float
-
The Y coordinate of the start point on the first ray.
pAz : float
-
The Z coordinate of the start point on the first ray.
pBx : float
-
The X coordinate of the start point on the second ray.
pBy : float
-
The Y coordinate of the start point on the second ray.
pBz : float
-
The Z coordinate of the start point on the second ray.
vAx : float
-
The X component of the vector of the first ray.
vAy : float
-
The Y component of the vector of the first ray.
vAz : float
-
The Z component of the vector of the first ray.
vBx : float
-
The X component of the vector of the second ray.
vBy : float
-
The Y component of the vector of the second ray.
vBz : float
-
The Z component of the vector of the second ray.
maxSkewDistance : float
-
Is a maximum distance tolerance.
Used for checking if the distance between the two lines at their closest approach is less than this value.
Returns: bool
TRUE if both rays intersect within the given maximum skew distance.
FALSE if the rays are parallel, coincident or the closest approach distance is larger than the given tolerance.
Modifiers: inline |
Checks if two 3D-rays actually intersect within a given maximum skew distance. Returns FALSE if rays are parallel or even identical, or if input lines are of zero length. Use XLine3D.getRayIntersection to check for those cases too.
|
Full Usage:
getClosestParameters (pAx, pAy, pAz, pBx, pBy, pBz, vAx, vAy, vAz, vBx, vBy, vBz, tangent, tooShortTolerance)
Parameters:
float
-
The X coordinate of the start point on the first line.
pAy : float
-
The Y coordinate of the start point on the first line.
pAz : float
-
The Z coordinate of the start point on the first line.
pBx : float
-
The X coordinate of the start point on the second line.
pBy : float
-
The Y coordinate of the start point on the second line.
pBz : float
-
The Z coordinate of the start point on the second line.
vAx : float
-
The X component of the vector of the first line.
vAy : float
-
The Y component of the vector of the first line.
vAz : float
-
The Z component of the vector of the first line.
vBx : float
-
The X component of the vector of the second line.
vBy : float
-
The Y component of the vector of the second line.
vBz : float
-
The Z component of the vector of the second line.
tangent : float<MeasureProduct<tangent, MeasureOne>>
-
This is a tolerance for considering lines parallel.
This is a precomputed tangent of the maximum allowed angle between the two line vectors.
Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
tooShortTolerance : float
-
Is a length tolerance.
If one or both lines are shorter than this, then the 'TooShort' union case is returned.
Returns: ClParams
A ClParams Discriminated Union with the following cases:
| Intersect of float*float
| Skew of float*float*float
| Parallel of float*float
| Apart of float*float*float
| TooShortBoth
| TooShortA
| TooShortB
|
Gets the parameters on the finite lines where the lines are closest to each other. For parallel lines, this will return the parameter at the middle point of any overlapping segment. For skew lines, this returns the closest approach parameters.
|
Full Usage:
getClosestPoints (pAx, pAy, pAz, pBx, pBy, pBz, vAx, vAy, vAz, vBx, vBy, vBz, tangent, tooShortTolerance)
Parameters:
float
-
The X coordinate of the start point on the first line.
pAy : float
-
The Y coordinate of the start point on the first line.
pAz : float
-
The Z coordinate of the start point on the first line.
pBx : float
-
The X coordinate of the start point on the second line.
pBy : float
-
The Y coordinate of the start point on the second line.
pBz : float
-
The Z coordinate of the start point on the second line.
vAx : float
-
The X component of the vector of the first line.
vAy : float
-
The Y component of the vector of the first line.
vAz : float
-
The Z component of the vector of the first line.
vBx : float
-
The X component of the vector of the second line.
vBy : float
-
The Y component of the vector of the second line.
vBz : float
-
The Z component of the vector of the second line.
tangent : float<MeasureProduct<tangent, MeasureOne>>
-
This is a tolerance for considering lines parallel.
This is a precomputed tangent of the maximum allowed angle between the two line vectors.
Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
tooShortTolerance : float
-
Is a length tolerance.
If one or both lines are shorter than this, then the 'TooShort' union case is returned.
Returns: ClPts
A ClPts Discriminated Union with the following cases:
| Intersect of Pnt
| Skew of Pnt * Pnt * float
| Parallel of Pnt * Pnt
| Apart of Pnt * Pnt * float
| TooShortBoth
| TooShortA
| TooShortB
|
Gets the point or points on the finite lines where the lines are closest to each other. For parallel lines, this will return the middle point of any overlapping segment. For skew lines, this returns the two closest approach points.
|
Full Usage:
getIntersection (pAx, pAy, pAz, pBx, pBy, pBz, vAx, vAy, vAz, vBx, vBy, vBz, maxSkewDistance, tangent, tooShortTolerance)
Parameters:
float
-
The X coordinate of the start point on the first line.
pAy : float
-
The Y coordinate of the start point on the first line.
pAz : float
-
The Z coordinate of the start point on the first line.
pBx : float
-
The X coordinate of the start point on the second line.
pBy : float
-
The Y coordinate of the start point on the second line.
pBz : float
-
The Z coordinate of the start point on the second line.
vAx : float
-
The X component of the vector of the first line.
vAy : float
-
The Y component of the vector of the first line.
vAz : float
-
The Z component of the vector of the first line.
vBx : float
-
The X component of the vector of the second line.
vBy : float
-
The Y component of the vector of the second line.
vBz : float
-
The Z component of the vector of the second line.
maxSkewDistance : float
-
The maximum allowed distance at closest approach to still consider the lines intersecting.
tangent : float<MeasureProduct<tangent, MeasureOne>>
-
Is the tangent of the maximum allowed angle between the two line vectors.
Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
tooShortTolerance : float
-
Is a length tolerance.
If one or both lines are shorter than this, then the 'TooShort' union case is returned.
Returns: XPnt
An XPt Discriminated Union with the following cases:
| Intersect of Pnt
| Skew of Pnt * Pnt * float
| Apart
| Parallel
| TooShortBoth
| TooShortA
| TooShortB
|
Tries to get intersection or closest approach point of two finite 3D lines.
|
Full Usage:
getIntersectionParam (pAx, pAy, pAz, pBx, pBy, pBz, vAx, vAy, vAz, vBx, vBy, vBz, maxSkewDistance, tangent, tooShortTolerance)
Parameters:
float
-
The X coordinate of the start point on the first line.
pAy : float
-
The Y coordinate of the start point on the first line.
pAz : float
-
The Z coordinate of the start point on the first line.
pBx : float
-
The X coordinate of the start point on the second line.
pBy : float
-
The Y coordinate of the start point on the second line.
pBz : float
-
The Z coordinate of the start point on the second line.
vAx : float
-
The X component of the vector of the first line.
vAy : float
-
The Y component of the vector of the first line.
vAz : float
-
The Z component of the vector of the first line.
vBx : float
-
The X component of the vector of the second line.
vBy : float
-
The Y component of the vector of the second line.
vBz : float
-
The Z component of the vector of the second line.
maxSkewDistance : float
-
The maximum allowed distance at closest approach to still consider the lines intersecting.
tangent : float<MeasureProduct<tangent, MeasureOne>>
-
Is the tangent of the maximum allowed angle between the two line vectors.
Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
tooShortTolerance : float
-
Is a length tolerance.
If one or both lines are shorter than this, then the 'TooShort' union case is returned.
Returns: XParam
An XParam Discriminated Union with the following cases:
| Intersect of float*float
| Skew of float*float*float
| Apart
| Parallel
| TooShortBoth
| TooShortA
| TooShortB
|
Tries to get intersection or closest approach parameters of two finite 3D-lines.
|
Full Usage:
getRayClosestParam (pAx, pAy, pAz, pBx, pBy, pBz, vAx, vAy, vAz, vBx, vBy, vBz, tangent, tooShortTolerance)
Parameters:
float
-
The X coordinate of the start point on the first ray.
pAy : float
-
The Y coordinate of the start point on the first ray.
pAz : float
-
The Z coordinate of the start point on the first ray.
pBx : float
-
The X coordinate of the start point on the second ray.
pBy : float
-
The Y coordinate of the start point on the second ray.
pBz : float
-
The Z coordinate of the start point on the second ray.
vAx : float
-
The X component of the vector of the first ray.
vAy : float
-
The Y component of the vector of the first ray.
vAz : float
-
The Z component of the vector of the first ray.
vBx : float
-
The X component of the vector of the second ray.
vBy : float
-
The Y component of the vector of the second ray.
vBz : float
-
The Z component of the vector of the second ray.
tangent : float<MeasureProduct<tangent, MeasureOne>>
-
Is the tangent of the maximum allowed angle between the two line vectors.
Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
tooShortTolerance : float
-
Is a length tolerance.
If one or both lines are shorter than this, then the 'TooShort' union case is returned.
Returns: XRayParam
An XRayParam Discriminated Union with the following cases:
| SkewOrX of float*float (parameters on both lines at closest approach)
| Parallel
| TooShortBoth
| TooShortA
| TooShortB
|
Tries to get closest approach parameters of two rays (rays are 3D lines extended infinitely).
|
Full Usage:
getRayIntersection (pAx, pAy, pAz, pBx, pBy, pBz, vAx, vAy, vAz, vBx, vBy, vBz, maxSkewDistance, tangent, tooShortTolerance)
Parameters:
float
-
The X coordinate of the start point on the first ray.
pAy : float
-
The Y coordinate of the start point on the first ray.
pAz : float
-
The Z coordinate of the start point on the first ray.
pBx : float
-
The X coordinate of the start point on the second ray.
pBy : float
-
The Y coordinate of the start point on the second ray.
pBz : float
-
The Z coordinate of the start point on the second ray.
vAx : float
-
The X component of the vector of the first ray.
vAy : float
-
The Y component of the vector of the first ray.
vAz : float
-
The Z component of the vector of the first ray.
vBx : float
-
The X component of the vector of the second ray.
vBy : float
-
The Y component of the vector of the second ray.
vBz : float
-
The Z component of the vector of the second ray.
maxSkewDistance : float
-
The maximum allowed distance at closest approach to still consider the lines intersecting.
tangent : float<MeasureProduct<tangent, MeasureOne>>
-
Is the tangent of the maximum allowed angle between the two line vectors.
Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
tooShortTolerance : float
-
Is a length tolerance.
If one or both lines are shorter than this, then the 'TooShort' union case is returned.
Returns: XRay
An XRay Discriminated Union with the following cases:
| Intersect of Pnt
| Skew of Pnt * Pnt * float
| Parallel
| TooShortBoth
| TooShortA
| TooShortB
|
Tries to get closest approach point of two rays (rays are 3D lines extended infinitely).
|
Full Usage:
parameterA (pAx, pAy, pAz, pBx, pBy, pBz, vAx, vAy, vAz, vBx, vBy, vBz)
Parameters:
float
-
The X coordinate of the start point on the first ray.
pAy : float
-
The Y coordinate of the start point on the first ray.
pAz : float
-
The Z coordinate of the start point on the first ray.
pBx : float
-
The X coordinate of the start point on the second ray.
pBy : float
-
The Y coordinate of the start point on the second ray.
pBz : float
-
The Z coordinate of the start point on the second ray.
vAx : float
-
The X component of the vector of the first ray.
vAy : float
-
The Y component of the vector of the first ray.
vAz : float
-
The Z component of the vector of the first ray.
vBx : float
-
The X component of the vector of the second ray.
vBy : float
-
The Y component of the vector of the second ray.
vBz : float
-
The Z component of the vector of the second ray.
Returns: float
The parameter at which the two rays intersect (or come closest) on line A.
This is NaN if A and B points are identical and the vectors are exactly parallel (zero divided by zero).
This is positive or negative Infinity for almost parallel lines.
Modifiers: inline |
Returns the closest approach parameter on the first ray (A) where ray A and ray B come closest. Returns NaN or Infinity for zero length or parallel lines.
|
Full Usage:
parameters (pAx, pAy, pAz, pBx, pBy, pBz, vAx, vAy, vAz, vBx, vBy, vBz)
Parameters:
float
-
The X coordinate of the start point on the first ray.
pAy : float
-
The Y coordinate of the start point on the first ray.
pAz : float
-
The Z coordinate of the start point on the first ray.
pBx : float
-
The X coordinate of the start point on the second ray.
pBy : float
-
The Y coordinate of the start point on the second ray.
pBz : float
-
The Z coordinate of the start point on the second ray.
vAx : float
-
The X component of the vector of the first ray.
vAy : float
-
The Y component of the vector of the first ray.
vAz : float
-
The Z component of the vector of the first ray.
vBx : float
-
The X component of the vector of the second ray.
vBy : float
-
The Y component of the vector of the second ray.
vBz : float
-
The Z component of the vector of the second ray.
Returns: float * float
A (t,u) tuple where t is the parameter on line A and u on line B at their closest approach.
These are NaN if A and B points are identical and the vectors are exactly parallel (zero divided by zero).
These are positive or negative Infinity for almost parallel lines.
Modifiers: inline |
Returns the closest approach parameters on both rays A and B. Returns NaN or Infinity for zero length or parallel lines.
|
Full Usage:
sqDistance (pAx, pAy, pAz, pBx, pBy, pBz, vAx, vAy, vAz, vBx, vBy, vBz)
Parameters:
float
-
The X coordinate of the start point on the first line.
pAy : float
-
The Y coordinate of the start point on the first line.
pAz : float
-
The Z coordinate of the start point on the first line.
pBx : float
-
The X coordinate of the start point on the second line.
pBy : float
-
The Y coordinate of the start point on the second line.
pBz : float
-
The Z coordinate of the start point on the second line.
vAx : float
-
The X component of the vector of the first line.
vAy : float
-
The Y component of the vector of the first line.
vAz : float
-
The Z component of the vector of the first line.
vBx : float
-
The X component of the vector of the second line.
vBy : float
-
The Y component of the vector of the second line.
vBz : float
-
The Z component of the vector of the second line.
Returns: float
the squared distance between the two lines
|
Gets the squared distance between two finite lines. Works on parallel and skew lines too.
|
Full Usage:
tryClosestParameterRayA (pAx, pAy, pAz, pBx, pBy, pBz, vAx, vAy, vAz, vBx, vBy, vBz)
Parameters:
float
-
The X coordinate of the start point on the first ray.
pAy : float
-
The Y coordinate of the start point on the first ray.
pAz : float
-
The Z coordinate of the start point on the first ray.
pBx : float
-
The X coordinate of the start point on the second ray.
pBy : float
-
The Y coordinate of the start point on the second ray.
pBz : float
-
The Z coordinate of the start point on the second ray.
vAx : float
-
The X component of the vector of the first ray.
vAy : float
-
The Y component of the vector of the first ray.
vAz : float
-
The Z component of the vector of the first ray.
vBx : float
-
The X component of the vector of the second ray.
vBy : float
-
The Y component of the vector of the second ray.
vBz : float
-
The Z component of the vector of the second ray.
Returns: float voption
The parameter at which the two rays come closest on line A if it is smaller than 1e12 in absolute value,
or ValueNone if the parameter is bigger than 1e12 or if they are parallel or coincident.
Modifiers: inline |
Returns the closest approach parameter on the first ray (A) where ray A and ray B come closest.
|
Full Usage:
tryClosestPntRayA (pAx, pAy, pAz, pBx, pBy, pBz, vAx, vAy, vAz, vBx, vBy, vBz)
Parameters:
float
-
The X coordinate of the start point on the first ray.
pAy : float
-
The Y coordinate of the start point on the first ray.
pAz : float
-
The Z coordinate of the start point on the first ray.
pBx : float
-
The X coordinate of the start point on the second ray.
pBy : float
-
The Y coordinate of the start point on the second ray.
pBz : float
-
The Z coordinate of the start point on the second ray.
vAx : float
-
The X component of the vector of the first ray.
vAy : float
-
The Y component of the vector of the first ray.
vAz : float
-
The Z component of the vector of the first ray.
vBx : float
-
The X component of the vector of the second ray.
vBy : float
-
The Y component of the vector of the second ray.
vBz : float
-
The Z component of the vector of the second ray.
Returns: Pnt voption
The point at which the two rays come closest (on Line A) if the parameter on Line A is smaller than 1e12 in absolute value,
or ValueNone if the parameter is bigger than 1e12 ( = the lines are far away or parallel) or if they are exactly parallel or coincident.
Modifiers: inline |
Tries to get closest approach point of two rays (rays are 3D lines extended infinitely).
|
Full Usage:
tryIntersect (pAx, pAy, pAz, pBx, pBy, pBz, vAx, vAy, vAz, vBx, vBy, vBz, maxSkewDistance, tangent, tooShortTolerance)
Parameters:
float
-
The X coordinate of the start point on the first line.
pAy : float
-
The Y coordinate of the start point on the first line.
pAz : float
-
The Z coordinate of the start point on the first line.
pBx : float
-
The X coordinate of the start point on the second line.
pBy : float
-
The Y coordinate of the start point on the second line.
pBz : float
-
The Z coordinate of the start point on the second line.
vAx : float
-
The X component of the vector of the first line.
vAy : float
-
The Y component of the vector of the first line.
vAz : float
-
The Z component of the vector of the first line.
vBx : float
-
The X component of the vector of the second line.
vBy : float
-
The Y component of the vector of the second line.
vBz : float
-
The Z component of the vector of the second line.
maxSkewDistance : float
-
The maximum allowed distance at closest approach to still consider the lines intersecting.
tangent : float<MeasureProduct<tangent, MeasureOne>>
-
Is the tangent of the maximum allowed angle between the two line vectors.
Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
tooShortTolerance : float
-
Is a length tolerance.
If one or both lines are shorter than this, ValueNone is returned.
Returns: Pnt voption
An intersection point on line A, or ValueNone if the segments are skew, parallel, or too short.
|
Tries to get an actual intersection point of two finite 3D lines.
|
Full Usage:
tryIntersectRay (pAx, pAy, pAz, pBx, pBy, pBz, vAx, vAy, vAz, vBx, vBy, vBz, maxSkewDistance, tangent, tooShortTolerance)
Parameters:
float
-
The X coordinate of the start point on the first ray.
pAy : float
-
The Y coordinate of the start point on the first ray.
pAz : float
-
The Z coordinate of the start point on the first ray.
pBx : float
-
The X coordinate of the start point on the second ray.
pBy : float
-
The Y coordinate of the start point on the second ray.
pBz : float
-
The Z coordinate of the start point on the second ray.
vAx : float
-
The X component of the vector of the first ray.
vAy : float
-
The Y component of the vector of the first ray.
vAz : float
-
The Z component of the vector of the first ray.
vBx : float
-
The X component of the vector of the second ray.
vBy : float
-
The Y component of the vector of the second ray.
vBz : float
-
The Z component of the vector of the second ray.
maxSkewDistance : float
-
The maximum allowed distance at closest approach to still consider the lines intersecting.
tangent : float<MeasureProduct<tangent, MeasureOne>>
-
Is the tangent of the maximum allowed angle between the two line vectors.
Use the module Euclid.UtilEuclid.Tangent to set another tolerance here.
tooShortTolerance : float
-
Is a length tolerance.
If one or both lines are shorter than this, ValueNone is returned.
Returns: Pnt voption
An intersection point on ray A, or ValueNone if the rays are skew, parallel, or too short.
|
Tries to get an actual intersection point of two rays (3D lines treated as infinite).
|
Euclid