Header menu logo Euclid

AutoOpenLine3D Module

When Euclid is opened this module will be auto-opened. It only contains extension members for type Line3D.

Type extensions

Type extension Description

this.ClosestParameter

Full Usage: this.ClosestParameter

Parameters:
Returns: float
Modifiers: inline

Returns the parameter at which a point is closest to the (finite) line. The result is between 0.0 and 1.0. Does not fail on very short curves.

Extended Type: Line3D

p : Pnt
Returns: float

this.ClosestParameters

Full Usage: this.ClosestParameters

Parameters:
    lnB : Line3D - The second line.

Returns: float * float A tuple of two floats, the first is the parameter on lnA, the second on lnB.

Finds the parameters of closest points between two finite 3D Lines, also works on parallel and overlapping lines.

For parallel and overlapping lines the parameters returned are in the center of their overlap. If the lines intersect the returned parameters are for the intersection point. For skew lines, returns the parameters at the closest approach. Lines shorter than 1e-6 are considered too short. Lines with an angle less than 0.25 degrees are considered parallel. For more control over tolerances, use getClosestParameters.

Extended Type: Line3D

lnB : Line3D

The second line.

Returns: float * float

A tuple of two floats, the first is the parameter on lnA, the second on lnB.

this.ClosestPoint

Full Usage: this.ClosestPoint

Parameters:
Returns: Pnt
Modifiers: inline

Returns closest point on (finite) line. Does not fail on very short curves.

Extended Type: Line3D

p : Pnt
Returns: Pnt

this.ClosestPoints

Full Usage: this.ClosestPoints

Parameters:
    lnB : Line3D - The second line.

Returns: Pnt * Pnt

Finds the closest points between two finite 3D Lines, also works on parallel and overlapping lines.

For parallel and overlapping lines the points returned are in the center of their overlap. If the lines intersect the returned points are exactly the same. For skew lines, returns the two closest points on each line. Lines shorter than 1e-6 are considered too short. Lines with an angle less than 0.25 degrees are considered parallel. For more control over tolerances, use getClosestPoints.

Extended Type: Line3D

lnB : Line3D

The second line.

Returns: Pnt * Pnt

this.DistanceRayPoint

Full Usage: this.DistanceRayPoint

Parameters:
Returns: float
Modifiers: inline

Assumes Line3D to be an infinite ray. Returns distance from point to ray. Fails on curves shorter than 1e-6 units. (ln.DistanceToPnt does not.)

Extended Type: Line3D

p : Pnt
Returns: float

this.DistanceToPnt

Full Usage: this.DistanceToPnt

Parameters:
Returns: float
Modifiers: inline

Returns distance from point to (finite) line.

Extended Type: Line3D

p : Pnt
Returns: float

this.EvaluateAt

Full Usage: this.EvaluateAt

Parameters:
    p : float

Returns: Pnt
Modifiers: inline

Evaluate 3D line at a given parameter. Parameters 0.0 to 1.0 are on the line.

Extended Type: Line3D

p : float
Returns: Pnt

this.Extend

Full Usage: this.Extend

Parameters:
    distAtStart : float
    distAtEnd : float

Returns: Line3D
Modifiers: inline

Extend 3D line by absolute amount at start and end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

distAtStart : float
distAtEnd : float
Returns: Line3D

this.ExtendEnd

Full Usage: this.ExtendEnd

Parameters:
    distAtEnd : float

Returns: Line3D
Modifiers: inline

Extend 3D line by absolute amount at end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

distAtEnd : float
Returns: Line3D

this.ExtendEndRel

Full Usage: this.ExtendEndRel

Parameters:
    relAtEnd : float

Returns: Line3D
Modifiers: inline

Extend 3D line by relative amount at end. A relative amount of 0.5 extends the line by half its length. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

relAtEnd : float
Returns: Line3D

this.ExtendRel

Full Usage: this.ExtendRel

Parameters:
    relAtStart : float
    relAtEnd : float

Returns: Line3D
Modifiers: inline

Extend 3D line by relative amount at start and end. A relative amount of 0.5 extends the line by half its length on each side. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

relAtStart : float
relAtEnd : float
Returns: Line3D

this.ExtendStart

Full Usage: this.ExtendStart

Parameters:
    distAtStart : float

Returns: Line3D
Modifiers: inline

Extend 3D line by absolute amount at start. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

distAtStart : float
Returns: Line3D

this.ExtendStartRel

Full Usage: this.ExtendStartRel

Parameters:
    relAtStart : float

Returns: Line3D
Modifiers: inline

Extend 3D line by relative amount at start. A relative amount of 0.5 extends the line by half its length. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

relAtStart : float
Returns: Line3D

this.IsCoincidentAndOpposingToFast

Full Usage: this.IsCoincidentAndOpposingToFast

Parameters:
    other : Line3D
    squaredParallelogramAreaTolerance : float
    maxDotProduct : float

Returns: bool
Modifiers: inline

A fast version of IsCoincidentAndOpposingTo that uses cross-product magnitude to determine parallelism. Checks if two 3D lines are coincident on opposing rays within given tolerances. Lines are coincident if they are parallel (cross product magnitude squared less than squaredParallelogramAreaTolerance) and opposing if the dot-product is negative (smaller than maxDotProduct) and the vector between their start points is also parallel to the lines. The cross product magnitude corresponds to the area of the parallelogram spanned by the two direction vectors. Lines are opposing if dot product is negative. maxDotProduct must be NEGATIVE! just below zero, -1e-6 by default ! The maxDotProduct helps to make sure FALSE is returned on very short or zero length lines.

Extended Type: Line3D

other : Line3D
squaredParallelogramAreaTolerance : float
maxDotProduct : float
Returns: bool

this.IsCoincidentAndOrientedToFast

Full Usage: this.IsCoincidentAndOrientedToFast

Parameters:
    other : Line3D
    squaredParallelogramAreaTolerance : float
    minDotProduct : float

Returns: bool
Modifiers: inline

A fast version of IsCoincidentAndOrientedTo that uses cross-product magnitude to determine parallelism. Checks if two 3D lines are coincident on the same ray within given tolerances. Lines are coincident if they are parallel (cross product magnitude squared less than squaredParallelogramAreaTolerance) and oriented in the same direction if the dot-product is positive (bigger than minDotProduct) and the vector between their start points is also parallel to the lines. The cross product magnitude corresponds to the area of the parallelogram spanned by the two direction vectors. Lines are oriented if dot product is positive. minDotProduct must be POSITIVE! just above zero. 1e-6 by default. The minDotProduct argument helps to make sure FALSE is returned on very short or zero length lines.

Extended Type: Line3D

other : Line3D
squaredParallelogramAreaTolerance : float
minDotProduct : float
Returns: bool

this.IsCoincidentTo

Full Usage: this.IsCoincidentTo

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D lines are coincident within the distance tolerance. 1e-6 by default. This means that lines are parallel within the angle tolerance. and the distance of second start to the first line is less than the distance tolerance. Also returns false on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module.

Extended Type: Line3D

other : Line3D
distanceTolerance : float
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool

this.IsCoincidentToFast

Full Usage: this.IsCoincidentToFast

Parameters:
    other : Line3D
    squaredParallelogramAreaTolerance : float

Returns: bool
Modifiers: inline

A fast version of IsCoincidentTo that uses cross-product magnitude to determine parallelism. Checks if two 3D lines are coincident within a given tolerance for their cross product magnitude. Lines are coincident if they are parallel (cross product magnitude squared less than squaredParallelogramAreaTolerance) and the vector between their start points is also parallel to the lines. The cross product magnitude corresponds to the area of the parallelogram spanned by the two direction vectors. ATTENTION this method returns TRUE on zero length or very small lines. It returns FALSE on almost coincident lines that are very long. Pick a bigger squaredParallelogramAreaTolerance for longer lines.

Extended Type: Line3D

other : Line3D
squaredParallelogramAreaTolerance : float
Returns: bool

this.IsHorizontal

Full Usage: this.IsHorizontal

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Checks if 3D line is horizontal. The absolute deviation tolerance along Z axis is 1e-9 (axisAlignmentTolerance). Fails on lines shorter than 1e-6.

Extended Type: Line3D

() : unit
Returns: bool

this.IsNormalTo

Full Usage: this.IsNormalTo

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D lines are perpendicular to each other. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). Alias for ln.IsPerpendicularTo.

Extended Type: Line3D

other : Line3D
maxTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool

this.IsNormalTo

Full Usage: this.IsNormalTo

Parameters:
Returns: bool
Modifiers: inline

Checks if a 3D lines is perpendicular to a 3D vector. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines or vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12). Alias for ln.IsPerpendicularTo.

Extended Type: Line3D

other : Vec
maxTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool

this.IsNormalTo

Full Usage: this.IsNormalTo

Parameters:
Returns: bool
Modifiers: inline

Checks if a 3D lines is perpendicular to a 3D unit-vector. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). Alias for ln.IsPerpendicularTo.

Extended Type: Line3D

other : UnitVec
maxTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool

this.IsParallelAndOpposingToFast

Full Usage: this.IsParallelAndOpposingToFast

Parameters:
    other : Line3D
    squaredParallelogramAreaTolerance : float
    maxDotProduct : float

Returns: bool
Modifiers: inline

A fast version of IsParallelAndOpposingTo that uses cross-product magnitude to determine parallelism. Checks if two 3D lines are parallel within a given tolerance for their cross product magnitude and opposing by having a negative dot-product. Lines are parallel if cross product magnitude squared is less than given squaredParallelogramAreaTolerance. The cross product magnitude corresponds to the area of the parallelogram spanned by the two direction vectors. Lines are opposing if dot product is negative. maxDotProduct must be NEGATIVE! just below zero, -1e-6 by default ! The maxDotProduct helps to make sure FALSE is returned on very short or zero length lines.

Extended Type: Line3D

other : Line3D
squaredParallelogramAreaTolerance : float
maxDotProduct : float
Returns: bool

this.IsParallelAndOrientedTo

Full Usage: this.IsParallelAndOrientedTo

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D lines are parallel. Takes the line orientation into account too. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

other : Line3D
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool

this.IsParallelAndOrientedTo

Full Usage: this.IsParallelAndOrientedTo

Parameters:
Returns: bool
Modifiers: inline

Checks if a 3D lines is parallel to a 3D vector. Takes the line orientation into account too. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines or vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

other : Vec
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool

this.IsParallelAndOrientedTo

Full Usage: this.IsParallelAndOrientedTo

Parameters:
Returns: bool
Modifiers: inline

Checks if a 3D lines is parallel to a 3D unit-vector. Takes the line orientation into account too. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

other : UnitVec
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool

this.IsParallelAndOrientedToFast

Full Usage: this.IsParallelAndOrientedToFast

Parameters:
    other : Line3D
    squaredParallelogramAreaTolerance : float
    minDotProduct : float

Returns: bool
Modifiers: inline

A fast version of IsParallelAndOrientedTo that uses cross-product magnitude to determine parallelism. Checks if two 3D lines are parallel within a given tolerance for their cross product magnitude and oriented in the same direction by having a positive dot-product. Lines are parallel if cross product magnitude squared is less than given squaredParallelogramAreaTolerance. The cross product magnitude corresponds to the area of the parallelogram spanned by the two direction vectors. Lines are oriented if dot product is positive. minDotProduct must be POSITIVE! just above zero. 1e-6 by default. The minDotProduct argument helps to make sure FALSE is returned on very short or zero length lines.

Extended Type: Line3D

other : Line3D
squaredParallelogramAreaTolerance : float
minDotProduct : float
Returns: bool

this.IsParallelTo

Full Usage: this.IsParallelTo

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D lines are parallel. Ignores the line orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

other : Line3D
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool

this.IsParallelTo

Full Usage: this.IsParallelTo

Parameters:
Returns: bool
Modifiers: inline

Checks if a 3D lines is parallel to a 3D vector. Ignores the line orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines or vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

other : Vec
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool

this.IsParallelTo

Full Usage: this.IsParallelTo

Parameters:
Returns: bool
Modifiers: inline

Checks if a 3D lines is parallel to a 3D unit-vector. Ignores the line orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

other : UnitVec
minTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool

this.IsParallelToFast

Full Usage: this.IsParallelToFast

Parameters:
    other : Line3D
    squaredParallelogramAreaTolerance : float

Returns: bool
Modifiers: inline

A fast version of IsParallelTo that uses cross-product magnitude to determine parallelism. Checks if two 3D lines are parallel within a given tolerance for their cross product magnitude. Lines are parallel if cross product magnitude squared is less than squaredParallelogramAreaTolerance. The cross product magnitude corresponds to the area of the parallelogram spanned by the two direction vectors. ATTENTION this method returns TRUE on zero length or very small lines. It returns FALSE on almost parallel lines that are very long. Pick a bigger squaredParallelogramAreaTolerance for longer lines.

Extended Type: Line3D

other : Line3D
squaredParallelogramAreaTolerance : float
Returns: bool

this.IsPerpendicularTo

Full Usage: this.IsPerpendicularTo

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D lines are perpendicular to each other. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

other : Line3D
maxTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool

this.IsPerpendicularTo

Full Usage: this.IsPerpendicularTo

Parameters:
Returns: bool
Modifiers: inline

Checks if a 3D lines is perpendicular to a 3D vector. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines or vectors shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

other : Vec
maxTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool

this.IsPerpendicularTo

Full Usage: this.IsPerpendicularTo

Parameters:
Returns: bool
Modifiers: inline

Checks if a 3D lines is perpendicular to a 3D unit-vector. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

other : UnitVec
maxTangent : float<MeasureProduct<tangent, MeasureOne>>
Returns: bool

this.IsTiny

Full Usage: this.IsTiny

Parameters:
    tol : float

Returns: bool
Modifiers: inline

Returns TRUE if 3D line is shorter than tolerance. Or contains a NaN value

Extended Type: Line3D

tol : float
Returns: bool

this.IsTinySq

Full Usage: this.IsTinySq

Parameters:
    tol : float

Returns: bool
Modifiers: inline

Returns TRUE if 3D line is shorter than the squared tolerance. Or contains a NaN value

Extended Type: Line3D

tol : float
Returns: bool

this.IsVertical

Full Usage: this.IsVertical

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Checks if 3D line is parallel to the world Z axis. Ignoring orientation. The absolute deviation tolerance along X and Y axis is 1e-9 (axisAlignmentTolerance). Fails on lines shorter than 1e-6. Same as ln.IsZAligned

Extended Type: Line3D

() : unit
Returns: bool

this.IsXAligned

Full Usage: this.IsXAligned

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Checks if 3D line is parallel to the world X axis. Ignoring orientation. The absolute deviation tolerance along Y and Z axis is 1e-9 (axisAlignmentTolerance). Fails on lines shorter than 1e-6.

Extended Type: Line3D

() : unit
Returns: bool

this.IsYAligned

Full Usage: this.IsYAligned

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Checks if 3D line is parallel to the world Y axis. Ignoring orientation. The absolute deviation tolerance along X and Z axis is 1e-9 (axisAlignmentTolerance). Fails on lines shorter than 1e-6.

Extended Type: Line3D

() : unit
Returns: bool

this.IsZAligned

Full Usage: this.IsZAligned

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Checks if 3D line is parallel to the world Z axis. Ignoring orientation. The absolute deviation tolerance along X and Y axis is 1e-9 (axisAlignmentTolerance). Fails on lines shorter than 1e-6. Same as ln.IsVertical

Extended Type: Line3D

() : unit
Returns: bool

this.IsZeroLength

Full Usage: this.IsZeroLength

Parameters:
    () : unit

Returns: bool
Modifiers: inline

Check if the 3D line has exactly the same starting and ending point.

Extended Type: Line3D

() : unit
Returns: bool

this.LengthFromParam

Full Usage: this.LengthFromParam

Parameters:
    t : float

Returns: float
Modifiers: inline

Returns the length of the line segment from the given parameter till the line End. This length is negative if the parameter is bigger than 1.0.

Extended Type: Line3D

t : float
Returns: float

this.LengthTillParam

Full Usage: this.LengthTillParam

Parameters:
    p : float

Returns: float
Modifiers: inline

Returns the length of the line segment from the start point to the given parameter. This length is negative if the parameter is negative.

Extended Type: Line3D

p : float
Returns: float

this.MatchesOrientation

Full Usage: this.MatchesOrientation

Parameters:
Returns: bool
Modifiers: inline

Checks if the dot product between the two 3D lines is positive. So if the angle between their direction vectors is less than 90 degrees. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

otherLn : Line3D
Returns: bool

this.MatchesOrientation

Full Usage: this.MatchesOrientation

Parameters:
Returns: bool
Modifiers: inline

Checks if the dot product between the a 3D lines and a vector is positive. So if the angle between their direction vectors is less than 90 degrees. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

v : Vec
Returns: bool

this.MatchesOrientation

Full Usage: this.MatchesOrientation

Parameters:
Returns: bool
Modifiers: inline

Checks if the dot product between the a 3D lines and a unit-vector is positive. So if the angle between their direction vectors is less than 90 degrees. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

v : UnitVec
Returns: bool

this.MatchesOrientation45

Full Usage: this.MatchesOrientation45

Parameters:
Returns: bool
Modifiers: inline

Checks if the angle between the two 3D lines is less than 45 degrees. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

l : Line3D
Returns: bool

this.Mid

Full Usage: this.Mid

Parameters:
    () : unit

Returns: Pnt
Modifiers: inline

Returns the midpoint of the 3D line,

Extended Type: Line3D

() : unit
Returns: Pnt

this.Move

Full Usage: this.Move

Parameters:
Returns: Line3D
Modifiers: inline

Returns a Line3D moved by a vector.

Extended Type: Line3D

v : Vec
Returns: Line3D

this.MoveX

Full Usage: this.MoveX

Parameters:
    distance : float

Returns: Line3D
Modifiers: inline

Returns a Line3D moved by a given distance in X direction.

Extended Type: Line3D

distance : float
Returns: Line3D

this.MoveY

Full Usage: this.MoveY

Parameters:
    distance : float

Returns: Line3D
Modifiers: inline

Returns a Line3D moved by a given distance in Y direction.

Extended Type: Line3D

distance : float
Returns: Line3D

this.MoveZ

Full Usage: this.MoveZ

Parameters:
    distance : float

Returns: Line3D
Modifiers: inline

Returns a Line3D moved by a given distance in Z direction.

Extended Type: Line3D

distance : float
Returns: Line3D

this.RayClosestParameter

Full Usage: this.RayClosestParameter

Parameters:
Returns: float
Modifiers: inline

Assumes Line3D to be an infinite ray. Returns the parameter at which a point is closest to the ray. If it is smaller than 0.0 or bigger than 1.0 it is outside of the finite line. Fails on curves shorter than 1e-6 units. (ln.ClosestParameter does not)

Extended Type: Line3D

p : Pnt
Returns: float

this.RayClosestParameters

Full Usage: this.RayClosestParameters

Parameters:
    lnB : Line3D - The second line (treated as infinite ray).

Returns: (float * float) option Some tuple of two floats (parameter on this, parameter on lnB) if rays are not parallel and not too short, otherwise None.

Finds the closest approach parameters of two infinite rays (Line3D treated as rays).

Lines shorter than 1e-6 are considered too short. Lines with an angle less than 0.25 degrees are considered parallel. For more control over tolerances, use getRayClosestParam.

Extended Type: Line3D

lnB : Line3D

The second line (treated as infinite ray).

Returns: (float * float) option

Some tuple of two floats (parameter on this, parameter on lnB) if rays are not parallel and not too short, otherwise None.

this.RayClosestPoint

Full Usage: this.RayClosestPoint

Parameters:
Returns: Pnt
Modifiers: inline

Assumes Line3D to be an infinite ray. Returns closest point on ray. Fails on curves shorter than 1e-6 units. (ln.ClosestPoint does not.)

Extended Type: Line3D

p : Pnt
Returns: Pnt

this.RayClosestPoints

Full Usage: this.RayClosestPoints

Parameters:
    lnB : Line3D - The second line (treated as infinite ray).

Returns: (Pnt * Pnt) option Some tuple of two points (closest point on this, closest point on lnB) if rays are not parallel and not too short, otherwise None.

Finds the closest approach points of two infinite rays (Line3D treated as rays).

Lines shorter than 1e-6 are considered too short. Lines with an angle less than 0.25 degrees are considered parallel. For more control over tolerances, use getRayClosestParam.

Extended Type: Line3D

lnB : Line3D

The second line (treated as infinite ray).

Returns: (Pnt * Pnt) option

Some tuple of two points (closest point on this, closest point on lnB) if rays are not parallel and not too short, otherwise None.

this.Reversed

Full Usage: this.Reversed

Parameters:
    () : unit

Returns: Line3D
Modifiers: inline

Returns the 3D line reversed.

Extended Type: Line3D

() : unit
Returns: Line3D

this.Scale

Full Usage: this.Scale

Parameters:
    factor : float

Returns: Line3D
Modifiers: inline

Scales the 3D line by a given factor. Scale center is World Origin 0,0

Extended Type: Line3D

factor : float
Returns: Line3D

this.ScaleOn

Full Usage: this.ScaleOn

Parameters:
    cen : Pnt
    factor : float

Returns: Line3D
Modifiers: inline

Extended Type: Line3D

cen : Pnt
factor : float
Returns: Line3D

this.Segment

Full Usage: this.Segment

Parameters:
    a : float
    b : float

Returns: Line3D
Modifiers: inline

Returns a Line3D from point at Parameter a to point at Parameter b.

Extended Type: Line3D

a : float
b : float
Returns: Line3D

this.Shrink

Full Usage: this.Shrink

Parameters:
    distAtStart : float
    distAtEnd : float

Returns: Line3D
Modifiers: inline

Shrink 3D line by absolute amount at start and end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

distAtStart : float
distAtEnd : float
Returns: Line3D

this.ShrinkEnd

Full Usage: this.ShrinkEnd

Parameters:
    distAtEnd : float

Returns: Line3D
Modifiers: inline

Shrink 3D line by absolute amount at end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

distAtEnd : float
Returns: Line3D

this.ShrinkStart

Full Usage: this.ShrinkStart

Parameters:
    distAtStart : float

Returns: Line3D
Modifiers: inline

Shrink 3D line by absolute amount at start. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

distAtStart : float
Returns: Line3D

this.SqDistanceFromPoint

Full Usage: this.SqDistanceFromPoint

Parameters:
Returns: float
Modifiers: inline

Returns square distance from point to finite line.

Extended Type: Line3D

p : Pnt
Returns: float

this.SqDistanceRayPoint

Full Usage: this.SqDistanceRayPoint

Parameters:
Returns: float

Assumes Line3D to be an infinite ray. Returns square distance from point to ray. Fails on curves shorter than 1e-6 units. (ln.SqDistanceFromPoint does not.)

Extended Type: Line3D

p : Pnt
Returns: float

this.SubLine

Full Usage: this.SubLine

Parameters:
    start : float
    ende : float

Returns: Line3D
Modifiers: inline

Evaluate line at a given parameters (parameters 0.0 to 1.0 are on the line), Return a new line from evaluated points.

Extended Type: Line3D

start : float
ende : float
Returns: Line3D

this.Transform

Full Usage: this.Transform

Parameters:
Returns: Line3D
Modifiers: inline

Applies or multiplies a 4x4 transformation matrix to a 3D line.

Extended Type: Line3D

m : Matrix
Returns: Line3D

this.TransformRigid

Full Usage: this.TransformRigid

Parameters:
Returns: Line3D
Modifiers: inline

Multiplies (or applies) a RigidMatrix to a 3D line .

Extended Type: Line3D

m : RigidMatrix
Returns: Line3D

Line3D.areCoincident a b

Full Usage: Line3D.areCoincident a b

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D lines are coincident within tolerance. This means that lines are parallel within 0.25 degrees and the distance of second start point to the first line is less than 1e-6.

Extended Type: Line3D

a : Line3D
b : Line3D
Returns: bool

Line3D.areParallel l ln

Full Usage: Line3D.areParallel l ln

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D lines are parallel. Ignoring orientation. Calculates the Cross Product of the two line vectors. (= the area of the parallelogram) And checks if it is smaller than 1e-9 (NOTE: for very long lines a higher tolerance might be needed)

Extended Type: Line3D

l : Line3D
ln : Line3D
Returns: bool

Line3D.areParallelAndMatchOrientation l ln

Full Usage: Line3D.areParallelAndMatchOrientation l ln

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D lines are parallel and orientated the same way. Calculates the Cross Product of the two line vectors. (= the area of the parallelogram) And checks if it is smaller than 1e-9 Then calculates the dot product and checks if it is positive. (NOTE: for very long lines a higher tolerance might be needed)

Extended Type: Line3D

l : Line3D
ln : Line3D
Returns: bool

Line3D.arePerpendicular l ln

Full Usage: Line3D.arePerpendicular l ln

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D lines are perpendicular. Calculates the dot product and checks if it is smaller than 1e-9. (NOTE: for very long lines a higher tolerance might be needed)

Extended Type: Line3D

l : Line3D
ln : Line3D
Returns: bool

Line3D.closestParameter p ln

Full Usage: Line3D.closestParameter p ln

Parameters:
Returns: float
Modifiers: inline

Returns the parameter at which a point is closest to the (finite) line. The result is between 0.0 and 1.0.

Extended Type: Line3D

p : Pnt
ln : Line3D
Returns: float

Line3D.closestParameters lnA lnB

Full Usage: Line3D.closestParameters lnA lnB

Parameters:
    lnA : Line3D - The first line.
    lnB : Line3D - The second line.

Returns: float * float A tuple of two floats, the first is the parameter on lnA, the second on lnB.

Finds the parameters of closest points between two finite 3D Lines, also works on parallel and overlapping lines.

For parallel and overlapping lines the parameters returned are in the center of their overlap. If the lines intersect the returned parameters are for the intersection point. For skew lines, returns the parameters at the closest approach.

Extended Type: Line3D

lnA : Line3D

The first line.

lnB : Line3D

The second line.

Returns: float * float

A tuple of two floats, the first is the parameter on lnA, the second on lnB.

Line3D.closestPoint p ln

Full Usage: Line3D.closestPoint p ln

Parameters:
Returns: Pnt
Modifiers: inline

Returns closest point on (finite) line.

Extended Type: Line3D

p : Pnt
ln : Line3D
Returns: Pnt

Line3D.closestPoints lnA lnB

Full Usage: Line3D.closestPoints lnA lnB

Parameters:
    lnA : Line3D - The first line.
    lnB : Line3D - The second line.

Returns: Pnt * Pnt

Finds the closest points between two finite 3D Lines, also works on parallel and overlapping lines.

For parallel and overlapping lines the points returned are in the center of their overlap. If the lines intersect the returned points are exactly the same. For skew lines, returns the two closest points on each line.

Extended Type: Line3D

lnA : Line3D

The first line.

lnB : Line3D

The second line.

Returns: Pnt * Pnt

Line3D.createFromLine2D ln

Full Usage: Line3D.createFromLine2D ln

Parameters:
Returns: Line3D
Modifiers: inline

Creates a 3D line from 2D line. Setting Z to 0.0

Extended Type: Line3D

ln : Line2D
Returns: Line3D

Line3D.createFromLine2DwithZ zLevel ln

Full Usage: Line3D.createFromLine2DwithZ zLevel ln

Parameters:
Returns: Line3D
Modifiers: inline

Creates a 3D line from 2D line. Setting Z to given value.

Extended Type: Line3D

zLevel : float
ln : Line2D
Returns: Line3D

Line3D.createFromPntAndVec (p, v)

Full Usage: Line3D.createFromPntAndVec (p, v)

Parameters:
Returns: Line3D
Modifiers: inline

Creates a 3D line starting at given point and going to along the given vector.

Extended Type: Line3D

p : Pnt
v : Vec
Returns: Line3D

Line3D.createFromVec v

Full Usage: Line3D.createFromVec v

Parameters:
Returns: Line3D
Modifiers: inline

Creates a 3D line starting at World Origin and going to along the given vector.

Extended Type: Line3D

v : Vec
Returns: Line3D

Line3D.direction ln

Full Usage: Line3D.direction ln

Parameters:
Returns: Vec
Modifiers: inline

Same as Line3D.vector or Line3D.tangent. The returned vector has the same length as the Line3D.

Extended Type: Line3D

ln : Line3D
Returns: Vec

Line3D.distanceRayPoint p ln

Full Usage: Line3D.distanceRayPoint p ln

Parameters:
Returns: float
Modifiers: inline

Assumes Line3D to be an infinite ray. Returns distance from point to ray.

Extended Type: Line3D

p : Pnt
ln : Line3D
Returns: float

Line3D.distanceToLine lnA lnB

Full Usage: Line3D.distanceToLine lnA lnB

Parameters:
    lnA : Line3D - The first line.
    lnB : Line3D - The second line.

Returns: float The distance between the two lines. Works correctly for zero-length, parallel, and skew lines.

Computes the distance between two finite 3D lines.

Extended Type: Line3D

lnA : Line3D

The first line.

lnB : Line3D

The second line.

Returns: float

The distance between the two lines. Works correctly for zero-length, parallel, and skew lines.

Line3D.distanceToPnt p ln

Full Usage: Line3D.distanceToPnt p ln

Parameters:
Returns: float
Modifiers: inline

Returns distance from point to (finite) line.

Extended Type: Line3D

p : Pnt
ln : Line3D
Returns: float

Line3D.divide segments ln

Full Usage: Line3D.divide segments ln

Parameters:
Returns: Pnt[]

Divides a 3D line into given amount of segments. Returns an array of 3D points of length: segment count + 1. Includes start and endpoint of line.

Extended Type: Line3D

segments : int
ln : Line3D
Returns: Pnt[]

Line3D.divideEvery dist l

Full Usage: Line3D.divideEvery dist l

Parameters:
Returns: ResizeArray<Pnt>

Divides a 3D line into segments of given length. Includes start and end point. If the line length is smaller than the given distance just the start and end point is returned. Adds end point only if there is a remainder bigger than 0.1% of the segment length.

Extended Type: Line3D

dist : float
l : Line3D
Returns: ResizeArray<Pnt>

Line3D.divideInsideEvery dist l

Full Usage: Line3D.divideInsideEvery dist l

Parameters:
Returns: ResizeArray<Pnt>

Divides a 3D line into segments of given length. Excludes start and end point. If the line length is smaller than the given distance an empty array is returned. Adds last div point before end only if there is a remainder bigger than 0.1% of the segment length.

Extended Type: Line3D

dist : float
l : Line3D
Returns: ResizeArray<Pnt>

Line3D.divideMaxLength maxSegmentLength ln

Full Usage: Line3D.divideMaxLength maxSegmentLength ln

Parameters:
    maxSegmentLength : float
    ln : Line3D

Returns: Pnt[]

Divides a 3D line into as few as segments as possible respecting the maximum segment length. Returned Array includes start and endpoint of line. The input maxSegmentLength is multiplied by factor 0.999999 of to avoid numerical errors. That means in an edge case there are fewer segments returned, not more.

Extended Type: Line3D

maxSegmentLength : float
ln : Line3D
Returns: Pnt[]

Line3D.divideMinLength minSegmentLength ln

Full Usage: Line3D.divideMinLength minSegmentLength ln

Parameters:
    minSegmentLength : float
    ln : Line3D

Returns: Pnt[]

Divides a 3D line into as many as segments as possible respecting the minimum segment length. Returned Array includes start and endpoint of line. The input minSegmentLength is multiplied by factor 1.000001 of to avoid numerical errors. That means in an edge case there are more segments returned, not fewer.

Extended Type: Line3D

minSegmentLength : float
ln : Line3D
Returns: Pnt[]

Line3D.doIntersect lnA lnB

Full Usage: Line3D.doIntersect lnA lnB

Parameters:
    lnA : Line3D - The first line.
    lnB : Line3D - The second line.

Returns: bool

A fast test to check if two finite 3D lines truly intersect (or come very close in the skew case). Uses the default tolerance for parallel lines (0.25 degrees) and maximum skew distance (1e-6). Returns false on zero length lines or if lines are parallel, apart, or don't intersect within their finite segments.

Use the XLine3D module for more specialized intersection calculations with custom tolerances.

Extended Type: Line3D

lnA : Line3D

The first line.

lnB : Line3D

The second line.

Returns: bool

Line3D.doIntersectOrOverlap lnA lnB

Full Usage: Line3D.doIntersectOrOverlap lnA lnB

Parameters:
    lnA : Line3D - The first line.
    lnB : Line3D - The second line.

Returns: bool

Tests if two finite 3D lines intersect, touch, or overlap. Also returns TRUE if parallel lines are touching or overlapping each other. Also returns TRUE if zero length lines are at the same location.

This method uses an angle of 0.25 degrees to classify lines as parallel. In which case it also checks if they overlap or touch. Uses a skew distance of 1e-6 to classify lines as intersecting. Use the XLine3D module for more specialized intersection calculations.

Extended Type: Line3D

lnA : Line3D

The first line.

lnB : Line3D

The second line.

Returns: bool

Line3D.doRaysIntersect lnA lnB

Full Usage: Line3D.doRaysIntersect lnA lnB

Parameters:
    lnA : Line3D - The first ray.
    lnB : Line3D - The second ray.

Returns: bool

A fast test to check if two infinite rays (3D lines extended infinitely) intersect (or come very close in the skew case). Uses a maximum skew distance of 1e-6.

Use the XLine3D module for more specialized intersection calculations with custom tolerances.

Extended Type: Line3D

lnA : Line3D

The first ray.

lnB : Line3D

The second ray.

Returns: bool

Line3D.ende l

Full Usage: Line3D.ende l

Parameters:
Returns: Pnt
Modifiers: inline

Returns the End point of the line. Same as Line3D.to'

Extended Type: Line3D

l : Line3D
Returns: Pnt

Line3D.equals tol a b

Full Usage: Line3D.equals tol a b

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D lines are equal within tolerance. Identical Lines in opposite directions are not considered equal. Use a tolerance of 0.0 to check for an exact match.

Extended Type: Line3D

tol : float
a : Line3D
b : Line3D
Returns: bool

Line3D.evaluateAt t ln

Full Usage: Line3D.evaluateAt t ln

Parameters:
Returns: Pnt
Modifiers: inline

Evaluate line at a given parameter (parameters 0.0 to 1.0 are on the line)

Extended Type: Line3D

t : float
ln : Line3D
Returns: Pnt

Line3D.extend distAtStart distAtEnd ln

Full Usage: Line3D.extend distAtStart distAtEnd ln

Parameters:
    distAtStart : float
    distAtEnd : float
    ln : Line3D

Returns: Line3D
Modifiers: inline

Extend 3D line by absolute amount at start and end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

distAtStart : float
distAtEnd : float
ln : Line3D
Returns: Line3D

Line3D.extendEnd distAtEnd ln

Full Usage: Line3D.extendEnd distAtEnd ln

Parameters:
    distAtEnd : float
    ln : Line3D

Returns: Line3D
Modifiers: inline

Extend 3D line by absolute amount at end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

distAtEnd : float
ln : Line3D
Returns: Line3D

Line3D.extendEndRel relAtEnd ln

Full Usage: Line3D.extendEndRel relAtEnd ln

Parameters:
    relAtEnd : float
    ln : Line3D

Returns: Line3D
Modifiers: inline

Extend 3D line by relative amount at end. A relative amount of 0.5 extends the line by half its length. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

relAtEnd : float
ln : Line3D
Returns: Line3D

Line3D.extendRel relAtStart relAtEnd ln

Full Usage: Line3D.extendRel relAtStart relAtEnd ln

Parameters:
    relAtStart : float
    relAtEnd : float
    ln : Line3D

Returns: Line3D
Modifiers: inline

Extend 3D line by relative amount at start and end. A relative amount of 0.5 extends the line by half its length on each side. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

relAtStart : float
relAtEnd : float
ln : Line3D
Returns: Line3D

Line3D.extendStart distAtStart ln

Full Usage: Line3D.extendStart distAtStart ln

Parameters:
    distAtStart : float
    ln : Line3D

Returns: Line3D
Modifiers: inline

Extend 3D line by absolute amount at start. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

distAtStart : float
ln : Line3D
Returns: Line3D

Line3D.extendStartRel relAtStart ln

Full Usage: Line3D.extendStartRel relAtStart ln

Parameters:
    relAtStart : float
    ln : Line3D

Returns: Line3D
Modifiers: inline

Extend 3D line by relative amount at start. A relative amount of 0.5 extends the line by half its length. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

relAtStart : float
ln : Line3D
Returns: Line3D

Line3D.flip ln

Full Usage: Line3D.flip ln

Parameters:
Returns: Line3D
Modifiers: inline

Reverse or flip the 3D line (same as Line3D.reverse)

Extended Type: Line3D

ln : Line3D
Returns: Line3D

Line3D.from l

Full Usage: Line3D.from l

Parameters:
Returns: Pnt
Modifiers: inline

Returns the Start point of the line. Same as Line3D.start.

Extended Type: Line3D

l : Line3D
Returns: Pnt

Line3D.fromX l

Full Usage: Line3D.fromX l

Parameters:
Returns: float
Modifiers: inline

Returns the Start point's X coordinate of the line.

Extended Type: Line3D

l : Line3D
Returns: float

Line3D.fromY l

Full Usage: Line3D.fromY l

Parameters:
Returns: float
Modifiers: inline

Returns the Start point's Y coordinate of the line.

Extended Type: Line3D

l : Line3D
Returns: float

Line3D.fromZ l

Full Usage: Line3D.fromZ l

Parameters:
Returns: float
Modifiers: inline

Returns the Start point's Z coordinate of the line.

Extended Type: Line3D

l : Line3D
Returns: float

Line3D.intersectCone (ray, coneRadius, coneBaseZ, coneTipZ)

Full Usage: Line3D.intersectCone (ray, coneRadius, coneBaseZ, coneTipZ)

Parameters:
    ray : Line3D - The Line3D to intersect. It is considered as infinite ray.
    coneRadius : float - The radius of the cone at the base. Parallel to the XY plane.
    coneBaseZ : float - The Z coordinate of the cone base.
    coneTipZ : float - The Z coordinate of the cone tip.

Returns: Option<float * float> The two parameters on the ray where the intersections occur. If there is only one touching point both parameters are the same. If there is no intersection None is returned.

Intersects a ray with an infinite double cone that has its axis on the Z-axis.

Extended Type: Line3D

ray : Line3D

The Line3D to intersect. It is considered as infinite ray.

coneRadius : float

The radius of the cone at the base. Parallel to the XY plane.

coneBaseZ : float

The Z coordinate of the cone base.

coneTipZ : float

The Z coordinate of the cone tip.

Returns: Option<float * float>

The two parameters on the ray where the intersections occur. If there is only one touching point both parameters are the same. If there is no intersection None is returned.

Line3D.isCoincidentTo a b

Full Usage: Line3D.isCoincidentTo a b

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D lines are coincident within tolerance. This means that lines are parallel within 0.25 degrees and the distance of second start point to the first line is less than 1e-6.

Extended Type: Line3D

a : Line3D
b : Line3D
Returns: bool

Line3D.isHorizontal l

Full Usage: Line3D.isHorizontal l

Parameters:
Returns: bool
Modifiers: inline

Checks if 3D line is horizontal (Z component is almost zero). The absolute deviation tolerance along Z axis is 1e-9 (axisAlignmentTolerance). Fails on lines shorter than 1e-6.

Extended Type: Line3D

l : Line3D
Returns: bool

Line3D.isNormalTo lnA lnB

Full Usage: Line3D.isNormalTo lnA lnB

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D lines are perpendicular to each other. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). Same as Line3D.isPerpendicularTo

Extended Type: Line3D

lnA : Line3D
lnB : Line3D
Returns: bool

Line3D.isNormalTo' lnA lnB

Full Usage: Line3D.isNormalTo' lnA lnB

Parameters:
Returns: bool
Modifiers: inline

A faster Check if two 3D lines are perpendicular to each other. The angle tolerance is 89.75 to 90.25 degrees. This function does not do a check for very short lines. But will return false on zero-length lines. Same as Line3D.isPerpendicularTo'

Extended Type: Line3D

lnA : Line3D
lnB : Line3D
Returns: bool

Line3D.isNotParallelTo lnA lnB

Full Usage: Line3D.isNotParallelTo lnA lnB

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D lines are Not parallel. Ignoring orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

lnA : Line3D
lnB : Line3D
Returns: bool

Line3D.isNotParallelTo' lnA lnB

Full Usage: Line3D.isNotParallelTo' lnA lnB

Parameters:
Returns: bool
Modifiers: inline

A faster Check if two 3D lines are not parallel. Ignoring orientation. The angle tolerance is 0.25 degrees. This function does not do a check for very short lines. But will return false on zero-length lines.

Extended Type: Line3D

lnA : Line3D
lnB : Line3D
Returns: bool

Line3D.isParallelAndOrientedTo lnA lnB

Full Usage: Line3D.isParallelAndOrientedTo lnA lnB

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D lines are parallel and orientated the same way. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

lnA : Line3D
lnB : Line3D
Returns: bool

Line3D.isParallelTo lnA lnB

Full Usage: Line3D.isParallelTo lnA lnB

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D lines are parallel. Ignoring orientation. The default angle tolerance is 0.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

lnA : Line3D
lnB : Line3D
Returns: bool

Line3D.isParallelTo' lnA lnB

Full Usage: Line3D.isParallelTo' lnA lnB

Parameters:
Returns: bool
Modifiers: inline

A faster Check if two 3D lines are parallel. Ignoring orientation. The angle tolerance is 0.25 degrees. This function does not do a check for very short lines. But will return false on zero-length lines.

Extended Type: Line3D

lnA : Line3D
lnB : Line3D
Returns: bool

Line3D.isPerpendicularTo lnA lnB

Full Usage: Line3D.isPerpendicularTo lnA lnB

Parameters:
Returns: bool
Modifiers: inline

Checks if two 3D lines are perpendicular to each other. The default angle tolerance is 89.75 to 90.25 degrees. This tolerance can be customized by an optional minimum Tangent value. See Euclid.Tangent module. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). Same as Line3D.isNormalTo

Extended Type: Line3D

lnA : Line3D
lnB : Line3D
Returns: bool

Line3D.isPerpendicularTo' lnA lnB

Full Usage: Line3D.isPerpendicularTo' lnA lnB

Parameters:
Returns: bool
Modifiers: inline

A faster Check if two 3D lines are perpendicular to each other. The angle tolerance is 89.75 to 90.25 degrees. This function does not do a check for very short lines. But will return false on zero-length lines. Same as Line3D.isNormalTo'

Extended Type: Line3D

lnA : Line3D
lnB : Line3D
Returns: bool

Line3D.isTiny tol l

Full Usage: Line3D.isTiny tol l

Parameters:
Returns: bool
Modifiers: inline

Returns TRUE if line is shorter than tolerance. Also checks if any component is a NaN.

Extended Type: Line3D

tol : float
l : Line3D
Returns: bool

Line3D.isTinySq tol l

Full Usage: Line3D.isTinySq tol l

Parameters:
Returns: bool
Modifiers: inline

Returns TRUE if the lines square length is shorter than squared tolerance. Also checks if any component is a NaN.

Extended Type: Line3D

tol : float
l : Line3D
Returns: bool

Line3D.isTouchingEndOf squareTolerance a b

Full Usage: Line3D.isTouchingEndOf squareTolerance a b

Parameters:
    squareTolerance : float - The squared tolerance for the distance between the end points.
    a : Line3D - The first line.
    b : Line3D - The second line.

Returns: bool

Checks if the two finite 3D lines are touching each other at any of end points within the given tolerance. This will also return TRUE if the lines are touching on both points.

Use getEndsTouching to get more detailed information about which ends are touching.

Extended Type: Line3D

squareTolerance : float

The squared tolerance for the distance between the end points.

a : Line3D

The first line.

b : Line3D

The second line.

Returns: bool

Line3D.isVertical l

Full Usage: Line3D.isVertical l

Parameters:
Returns: bool
Modifiers: inline

Checks if 3D line is parallel to the world Z axis. Ignoring orientation. The absolute deviation tolerance along X and Y axis is 1e-9 (axisAlignmentTolerance). Fails on lines shorter than 1e-6. Same as ln.IsZAligned

Extended Type: Line3D

l : Line3D
Returns: bool

Line3D.isXAligned l

Full Usage: Line3D.isXAligned l

Parameters:
Returns: bool
Modifiers: inline

Checks if 3D line is parallel to the world X axis. Ignoring orientation. The absolute deviation tolerance along Y and Z axis is 1e-9 (axisAlignmentTolerance). Fails on lines shorter than 1e-6.

Extended Type: Line3D

l : Line3D
Returns: bool

Line3D.isYAligned l

Full Usage: Line3D.isYAligned l

Parameters:
Returns: bool
Modifiers: inline

Checks if 3D line is parallel to the world Y axis. Ignoring orientation. The absolute deviation tolerance along X and Z axis is 1e-9 (axisAlignmentTolerance). Fails on lines shorter than 1e-6.

Extended Type: Line3D

l : Line3D
Returns: bool

Line3D.isZAligned l

Full Usage: Line3D.isZAligned l

Parameters:
Returns: bool
Modifiers: inline

Checks if 3D line is parallel to the world Z axis. Ignoring orientation. The absolute deviation tolerance along X and Y axis is 1e-9 (axisAlignmentTolerance). Fails on lines shorter than 1e-6. Same as ln.IsVertical

Extended Type: Line3D

l : Line3D
Returns: bool

Line3D.isZeroLength l

Full Usage: Line3D.isZeroLength l

Parameters:
Returns: bool
Modifiers: inline

Check if the line has same starting and ending point.

Extended Type: Line3D

l : Line3D
Returns: bool

Line3D.length l

Full Usage: Line3D.length l

Parameters:
Returns: float
Modifiers: inline

Returns the length of the line.

Extended Type: Line3D

l : Line3D
Returns: float

Line3D.lengthSq l

Full Usage: Line3D.lengthSq l

Parameters:
Returns: float
Modifiers: inline

Returns the square length of the line.

Extended Type: Line3D

l : Line3D
Returns: float

Line3D.lengthToPtOnLine ln pt

Full Usage: Line3D.lengthToPtOnLine ln pt

Parameters:
Returns: float
Modifiers: inline

Get distance from start of line to point projected onto line, may be negative. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

ln : Line3D
pt : Pnt
Returns: float

Line3D.matchOrientation orientationToMatch lineToFlip

Full Usage: Line3D.matchOrientation orientationToMatch lineToFlip

Parameters:
Returns: Line3D
Modifiers: inline

Ensure 3D line has a positive dot product with given orientation line.

Extended Type: Line3D

orientationToMatch : Line3D
lineToFlip : Line3D
Returns: Line3D

Line3D.matchUnitVecOrientation orientationToMatch lineToFlip

Full Usage: Line3D.matchUnitVecOrientation orientationToMatch lineToFlip

Parameters:
Returns: Line3D
Modifiers: inline

Ensure 3D line has a positive dot product with given 3D vector.

Extended Type: Line3D

orientationToMatch : UnitVec
lineToFlip : Line3D
Returns: Line3D

Line3D.matchVecOrientation orientationToMatch lineToFlip

Full Usage: Line3D.matchVecOrientation orientationToMatch lineToFlip

Parameters:
    orientationToMatch : Vec
    lineToFlip : Line3D

Returns: Line3D
Modifiers: inline

Ensure 3D line has a positive dot product with given 3D vector.

Extended Type: Line3D

orientationToMatch : Vec
lineToFlip : Line3D
Returns: Line3D

Line3D.matchesOrientation l ln

Full Usage: Line3D.matchesOrientation l ln

Parameters:
Returns: bool
Modifiers: inline

Checks if the dot product between the two 3D lines is positive. So if the angle between their direction vectors is less than 90 degrees. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

l : Line3D
ln : Line3D
Returns: bool

Line3D.matchesOrientation45 l ln

Full Usage: Line3D.matchesOrientation45 l ln

Parameters:
Returns: bool
Modifiers: inline

Checks if the angle between the two 3D lines is less than 45 degrees. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

l : Line3D
ln : Line3D
Returns: bool

Line3D.mid ln

Full Usage: Line3D.mid ln

Parameters:
Returns: Pnt
Modifiers: inline

Get point at center of line.

Extended Type: Line3D

ln : Line3D
Returns: Pnt

Line3D.move v ln

Full Usage: Line3D.move v ln

Parameters:
Returns: Line3D
Modifiers: inline

Move a 3D line by a vector. (same as Line3D.translate)

Extended Type: Line3D

v : Vec
ln : Line3D
Returns: Line3D

Line3D.moveX distance ln

Full Usage: Line3D.moveX distance ln

Parameters:
    distance : float
    ln : Line3D

Returns: Line3D
Modifiers: inline

Returns a 3D line moved by a given distance in X direction.

Extended Type: Line3D

distance : float
ln : Line3D
Returns: Line3D

Line3D.moveY distance ln

Full Usage: Line3D.moveY distance ln

Parameters:
    distance : float
    ln : Line3D

Returns: Line3D
Modifiers: inline

Returns a 3D line moved by a given distance in Y direction.

Extended Type: Line3D

distance : float
ln : Line3D
Returns: Line3D

Line3D.moveZ distance ln

Full Usage: Line3D.moveZ distance ln

Parameters:
    distance : float
    ln : Line3D

Returns: Line3D
Modifiers: inline

Returns a 3D line moved by a given distance in Z direction.

Extended Type: Line3D

distance : float
ln : Line3D
Returns: Line3D

Line3D.notEquals tol a b

Full Usage: Line3D.notEquals tol a b

Parameters:
Returns: bool

Check if two 3D lines are not equal within a given tolerance. Use a tolerance of 0.0 to check if the two lines are not exactly equal.

Extended Type: Line3D

tol : float
a : Line3D
b : Line3D
Returns: bool

Line3D.offset distHorizontal distNormal l

Full Usage: Line3D.offset distHorizontal distNormal l

Parameters:
    distHorizontal : float
    distNormal : float
    l : Line3D

Returns: Line3D

Offsets a 3D line by two given distances. The fist distance (distHorizontal) is applied in in X-Y plane. The second distance (distNormal) is applied perpendicular to the line (made by the two 3D points) and perpendicular to the horizontal offset direction. This is in World.Z direction if both points are at the same Z level. If points are closer than 1e-6 units the World.Xaxis is used as first direction and World Z-axis as second direction.

Extended Type: Line3D

distHorizontal : float
distNormal : float
l : Line3D
Returns: Line3D

Line3D.offsetXY amount ln

Full Usage: Line3D.offsetXY amount ln

Parameters:
Returns: Line3D

Offset line parallel to XY-Plane to left side in line direction. Z values are not changed. Fails on vertical lines or lines shorter than UtilEuclid.zeroLengthTolerance (1e-12). If amount is 0.0 no offset is computed and the input line is returned.

Extended Type: Line3D

amount : float
ln : Line3D
Returns: Line3D

Line3D.pointAtDistance dist ln

Full Usage: Line3D.pointAtDistance dist ln

Parameters:
Returns: Pnt
Modifiers: inline

Finds point at given distance from line start. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

dist : float
ln : Line3D
Returns: Pnt

Line3D.projectOntoRay rayToProjectOnto lineToProject

Full Usage: Line3D.projectOntoRay rayToProjectOnto lineToProject

Parameters:
Returns: Line3D

Project a 3D line onto another line considered infinite in both directions. Returns the projected line. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

rayToProjectOnto : Line3D
lineToProject : Line3D
Returns: Line3D

Line3D.projectOntoRayParam rayToProjectOnto lineToProject

Full Usage: Line3D.projectOntoRayParam rayToProjectOnto lineToProject

Parameters:
Returns: float * float

Project a 3D line onto another line considered infinite in both directions. Returns the start and end parameters of the projected line on the target line. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

rayToProjectOnto : Line3D
lineToProject : Line3D
Returns: float * float

Line3D.rayClosestParameter p ln

Full Usage: Line3D.rayClosestParameter p ln

Parameters:
Returns: float
Modifiers: inline

Assumes Line3D to be an infinite ray. Returns the parameter at which a point is closest to the ray. If it is smaller than 0.0 or bigger than 1.0 it is outside of the finite line.

Extended Type: Line3D

p : Pnt
ln : Line3D
Returns: float

Line3D.rayClosestParameters lnA lnB

Full Usage: Line3D.rayClosestParameters lnA lnB

Parameters:
    lnA : Line3D - The first line (treated as infinite ray).
    lnB : Line3D - The second line (treated as infinite ray).

Returns: (float * float) option Some tuple of two floats (parameter on lnA, parameter on lnB) if rays are not parallel and not too short, otherwise None.

Finds the closest approach parameters of two infinite rays (Line3D treated as rays).

Extended Type: Line3D

lnA : Line3D

The first line (treated as infinite ray).

lnB : Line3D

The second line (treated as infinite ray).

Returns: (float * float) option

Some tuple of two floats (parameter on lnA, parameter on lnB) if rays are not parallel and not too short, otherwise None.

Line3D.rayClosestPoint p ln

Full Usage: Line3D.rayClosestPoint p ln

Parameters:
Returns: Pnt
Modifiers: inline

Assumes Line3D to be an infinite ray. Returns closest point on ray.

Extended Type: Line3D

p : Pnt
ln : Line3D
Returns: Pnt

Line3D.rayClosestPoints lnA lnB

Full Usage: Line3D.rayClosestPoints lnA lnB

Parameters:
    lnA : Line3D - The first line (treated as infinite ray).
    lnB : Line3D - The second line (treated as infinite ray).

Returns: (Pnt * Pnt) option Some tuple of two points (closest point on lnA, closest point on lnB) if rays are not parallel and not too short, otherwise None.

Finds the closest approach points of two infinite rays (Line3D treated as rays).

Extended Type: Line3D

lnA : Line3D

The first line (treated as infinite ray).

lnB : Line3D

The second line (treated as infinite ray).

Returns: (Pnt * Pnt) option

Some tuple of two points (closest point on lnA, closest point on lnB) if rays are not parallel and not too short, otherwise None.

Line3D.reverse ln

Full Usage: Line3D.reverse ln

Parameters:
Returns: Line3D
Modifiers: inline

Reverse or flip the 3D line (same as Line3D.flip)

Extended Type: Line3D

ln : Line3D
Returns: Line3D

Line3D.rotate q ln

Full Usage: Line3D.rotate q ln

Parameters:
Returns: Line3D
Modifiers: inline

Multiplies (or applies) a Quaternion to a 3D line. The resulting line has the same length as the input.

Extended Type: Line3D

q : Quaternion
ln : Line3D
Returns: Line3D

Line3D.rotate2D r ln

Full Usage: Line3D.rotate2D r ln

Parameters:
Returns: Line3D
Modifiers: inline

Rotation a 3D line around Z-Axis.

Extended Type: Line3D

r : Rotation2D
ln : Line3D
Returns: Line3D

Line3D.rotate2dOn cen r ln

Full Usage: Line3D.rotate2dOn cen r ln

Parameters:
Returns: Line3D
Modifiers: inline

Rotation a 3D line round given Center point an a local Z-axis.

Extended Type: Line3D

cen : Pnt
r : Rotation2D
ln : Line3D
Returns: Line3D

Line3D.rotateWithCenter cen q ln

Full Usage: Line3D.rotateWithCenter cen q ln

Parameters:
Returns: Line3D
Modifiers: inline

Multiplies (or applies) a Quaternion to a 3D line around a given center point. The resulting line has the same length as the input.

Extended Type: Line3D

cen : Pnt
q : Quaternion
ln : Line3D
Returns: Line3D

Line3D.scale factor ln

Full Usage: Line3D.scale factor ln

Parameters:
Returns: Line3D
Modifiers: inline

Scale the 3D line by a given factor. Scale center is World Origin 0,0,0

Extended Type: Line3D

factor : float
ln : Line3D
Returns: Line3D

Line3D.segment a b ln

Full Usage: Line3D.segment a b ln

Parameters:
    a : float
    b : float
    ln : Line3D

Returns: Line3D
Modifiers: inline

Returns new 3D line from point at Parameter a to point at Parameter b.

Extended Type: Line3D

a : float
b : float
ln : Line3D
Returns: Line3D

Line3D.setEnd pt ln

Full Usage: Line3D.setEnd pt ln

Parameters:
Returns: Line3D
Modifiers: inline

Set Line3D end point, returns a new line.

Extended Type: Line3D

pt : Pnt
ln : Line3D
Returns: Line3D

Line3D.setStart pt ln

Full Usage: Line3D.setStart pt ln

Parameters:
Returns: Line3D
Modifiers: inline

Set Line3D start point, returns a new line.

Extended Type: Line3D

pt : Pnt
ln : Line3D
Returns: Line3D

Line3D.shrink distAtStart distAtEnd ln

Full Usage: Line3D.shrink distAtStart distAtEnd ln

Parameters:
    distAtStart : float
    distAtEnd : float
    ln : Line3D

Returns: Line3D
Modifiers: inline

Shrink 3D line by absolute amount at start and end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

distAtStart : float
distAtEnd : float
ln : Line3D
Returns: Line3D

Line3D.shrinkEnd distAtEnd ln

Full Usage: Line3D.shrinkEnd distAtEnd ln

Parameters:
    distAtEnd : float
    ln : Line3D

Returns: Line3D
Modifiers: inline

Shrink 3D line by absolute amount at end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

distAtEnd : float
ln : Line3D
Returns: Line3D

Line3D.shrinkStart distAtStart ln

Full Usage: Line3D.shrinkStart distAtStart ln

Parameters:
    distAtStart : float
    ln : Line3D

Returns: Line3D
Modifiers: inline

Shrink 3D line by absolute amount at start. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

distAtStart : float
ln : Line3D
Returns: Line3D

Line3D.split gap segments ln

Full Usage: Line3D.split gap segments ln

Parameters:
    gap : float
    segments : int
    ln : Line3D

Returns: Line3D[]

Divides a 3D line into given amount of segments. Includes a gap between the segments. But not at the start or end. Returns an array of 3D lines. Returns an empty array if the length of the line is less than gap-size x segment-count-minus-1.

Extended Type: Line3D

gap : float
segments : int
ln : Line3D
Returns: Line3D[]

Line3D.splitMaxLength gap maxSegmentLength ln

Full Usage: Line3D.splitMaxLength gap maxSegmentLength ln

Parameters:
    gap : float
    maxSegmentLength : float
    ln : Line3D

Returns: Line3D[]

Divides a 3D line into as few as segments as possible respecting the maximum segment length and the gap. Includes a gap between the segments. But not at the start or end. Returns an array ofe3D lines The input maxSegmentLength is multiplied by factor 0.999999 of to avoid numerical errors. That means in an edge case there are fewer segments returned, not more.

Extended Type: Line3D

gap : float
maxSegmentLength : float
ln : Line3D
Returns: Line3D[]

Line3D.splitMinLength gap minSegmentLength ln

Full Usage: Line3D.splitMinLength gap minSegmentLength ln

Parameters:
    gap : float
    minSegmentLength : float
    ln : Line3D

Returns: Line3D[]

Divides a 3D line into as many as segments as possible respecting the minimum segment length and the gap. Includes a gap between the segments. But not at the start or end. Returns an array ofe3D lines The input minSegmentLength is multiplied by factor 1.000001 of to avoid numerical errors. That means in an edge case there are more segments returned, not fewer.

Extended Type: Line3D

gap : float
minSegmentLength : float
ln : Line3D
Returns: Line3D[]

Line3D.sqDistanceFromPoint p ln

Full Usage: Line3D.sqDistanceFromPoint p ln

Parameters:
Returns: float
Modifiers: inline

Returns the square distance from point to (finite) line.

Extended Type: Line3D

p : Pnt
ln : Line3D
Returns: float

Line3D.sqDistanceRayPoint p ln

Full Usage: Line3D.sqDistanceRayPoint p ln

Parameters:
Returns: float
Modifiers: inline

Assumes Line3D to be an infinite ray. Returns the square distance from point to ray.

Extended Type: Line3D

p : Pnt
ln : Line3D
Returns: float

Line3D.sqDistanceToLine lnA lnB

Full Usage: Line3D.sqDistanceToLine lnA lnB

Parameters:
    lnA : Line3D - The first line.
    lnB : Line3D - The second line.

Returns: float The squared distance between the two lines. Works correctly for zero-length, parallel, and skew lines.

Computes the squared distance between two finite 3D lines.

Extended Type: Line3D

lnA : Line3D

The first line.

lnB : Line3D

The second line.

Returns: float

The squared distance between the two lines. Works correctly for zero-length, parallel, and skew lines.

Line3D.start l

Full Usage: Line3D.start l

Parameters:
Returns: Pnt
Modifiers: inline

Returns the Start point of the line. Same as Line3D.from.

Extended Type: Line3D

l : Line3D
Returns: Pnt

Line3D.tangent ln

Full Usage: Line3D.tangent ln

Parameters:
Returns: Vec
Modifiers: inline

Same as Line3D.vector or Line3D.direction. The returned vector has the same length as the Line3D.

Extended Type: Line3D

ln : Line3D
Returns: Vec

Line3D.to' l

Full Usage: Line3D.to' l

Parameters:
Returns: Pnt
Modifiers: inline

Returns the End point of the line. Same as Line3D.ende.

Extended Type: Line3D

l : Line3D
Returns: Pnt

Line3D.toLine2D ln

Full Usage: Line3D.toLine2D ln

Parameters:
Returns: Line2D
Modifiers: inline

Creates a 2D line from 3D line. Ignoring Z value.

Extended Type: Line3D

ln : Line3D
Returns: Line2D

Line3D.toX l

Full Usage: Line3D.toX l

Parameters:
Returns: float
Modifiers: inline

Returns the End point's X coordinate of the line.

Extended Type: Line3D

l : Line3D
Returns: float

Line3D.toY l

Full Usage: Line3D.toY l

Parameters:
Returns: float
Modifiers: inline

Returns the End point's Y coordinate of the line.

Extended Type: Line3D

l : Line3D
Returns: float

Line3D.toZ l

Full Usage: Line3D.toZ l

Parameters:
Returns: float
Modifiers: inline

Returns the End point's Z coordinate of the line.

Extended Type: Line3D

l : Line3D
Returns: float

Line3D.transform m ln

Full Usage: Line3D.transform m ln

Parameters:
Returns: Line3D
Modifiers: inline

Applies or multiplies a 4x4 transformation matrix to a 3D line.

Extended Type: Line3D

m : Matrix
ln : Line3D
Returns: Line3D

Line3D.transformRigid m ln

Full Usage: Line3D.transformRigid m ln

Parameters:
Returns: Line3D
Modifiers: inline

Multiplies (or applies) a RigidMatrix to a 3D line .

Extended Type: Line3D

m : RigidMatrix
ln : Line3D
Returns: Line3D

Line3D.translate v ln

Full Usage: Line3D.translate v ln

Parameters:
Returns: Line3D
Modifiers: inline

Move a 3D line by a vector. (same as Line3D.move)

Extended Type: Line3D

v : Vec
ln : Line3D
Returns: Line3D

Line3D.tryGetOverlap lnA lnB

Full Usage: Line3D.tryGetOverlap lnA lnB

Parameters:
    lnA : Line3D - The first line.
    lnB : Line3D - The second line.

Returns: (float * float) option An option of a tuple of two floats. Returns the tuple containing the start and end parameter of the overlap on lnA if the lines are parallel and overlapping. Returns None if the lines are not parallel, not overlapping, or just touching at ends, or too short.

Checks if lines are parallel, coincident and overlapping.

If the first parameter in the overlap is smaller than the second the lines are oriented in the same direction. If the first parameter is greater than the second the lines are oriented in the opposite direction.

Extended Type: Line3D

lnA : Line3D

The first line.

lnB : Line3D

The second line.

Returns: (float * float) option

An option of a tuple of two floats. Returns the tuple containing the start and end parameter of the overlap on lnA if the lines are parallel and overlapping. Returns None if the lines are not parallel, not overlapping, or just touching at ends, or too short.

Line3D.tryIntersect lnA lnB

Full Usage: Line3D.tryIntersect lnA lnB

Parameters:
    lnA : Line3D - The first line.
    lnB : Line3D - The second line.

Returns: Pnt option A Pnt on line A if the lines intersect or are very close (skew distance less than 1e-6), None if apart, lines too short, or if parallel lines are touching or overlapping.

A fast intersection of two finite 3D lines. Returns the intersection point or the midpoint of closest approach for skew lines within tolerance. Does not use a default tolerance for parallel or coincident lines.

Use the XLine3D module for more specialized intersection calculations.

Extended Type: Line3D

lnA : Line3D

The first line.

lnB : Line3D

The second line.

Returns: Pnt option

A Pnt on line A if the lines intersect or are very close (skew distance less than 1e-6), None if apart, lines too short, or if parallel lines are touching or overlapping.

Line3D.tryIntersectOrOverlap lnA lnB

Full Usage: Line3D.tryIntersectOrOverlap lnA lnB

Parameters:
    lnA : Line3D - The first line.
    lnB : Line3D - The second line.

Returns: Pnt option An option of Pnt. If the lines are coincident and overlapping this point is in the center of their overlap.

Intersects two finite 3D Lines. Also returns a point if parallel lines are touching or overlapping each other. Also returns a point if zero length lines are at the same location within 1e-6 distance.

This method uses an angle of 0.25 degrees to classify Lines as parallel. In which case it also checks if they overlap or touch. For skew lines that are very close (less than 1e-6), returns the midpoint between closest points. Use the XLine3D module for more specialized intersection calculations.

Extended Type: Line3D

lnA : Line3D

The first line.

lnB : Line3D

The second line.

Returns: Pnt option

An option of Pnt. If the lines are coincident and overlapping this point is in the center of their overlap.

Line3D.tryIntersectRay lineA lineB

Full Usage: Line3D.tryIntersectRay lineA lineB

Parameters:
Returns: Pnt option The point at which the two rays intersect or the midpoint of closest approach for skew lines, or None.

Tries to get intersection point of two rays (rays are 3D lines extended infinitely).

If the lines are parallel or coincident, or if they are skew with distance > 1e-6, None is returned. For skew lines within tolerance, returns the midpoint between the two closest points.

Extended Type: Line3D

lineA : Line3D

First ray.

lineB : Line3D

Second ray.

Returns: Pnt option

The point at which the two rays intersect or the midpoint of closest approach for skew lines, or None.

Line3D.tryProjectOntoLine onToLine lineToProject

Full Usage: Line3D.tryProjectOntoLine onToLine lineToProject

Parameters:
Returns: Line3D option

Tries to project a 3D line onto another line considered finite. Returns Some Line3D if there is an overlap. Returns None if there is no overlap. Keeps the orientation of the line to project. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

onToLine : Line3D
lineToProject : Line3D
Returns: Line3D option

Line3D.tryProjectOntoLineParam onToLine lineToProject

Full Usage: Line3D.tryProjectOntoLineParam onToLine lineToProject

Parameters:
Returns: (float * float) option

Tries to project a 3D line onto another line considered finite. Returns None if there is no overlap. Returns Some (startParam, endParam) if there is an overlap. The parameters are between 0.0 and 1.0 on the target line. The first parameter is from the start of the line to project. The second parameter is from the end of the line to project. So if the first parameter is bigger than the second, the lines are oriented in opposite direction. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

onToLine : Line3D
lineToProject : Line3D
Returns: (float * float) option

Line3D.unitTangent ln

Full Usage: Line3D.unitTangent ln

Parameters:
Returns: UnitVec
Modifiers: inline

Returns a unit-vector of the line Direction.

Extended Type: Line3D

ln : Line3D
Returns: UnitVec

Line3D.vector ln

Full Usage: Line3D.vector ln

Parameters:
Returns: Vec
Modifiers: inline

Same as Line3D.tangent or Line3D.direction. The returned vector has the same length as the Line3D.

Extended Type: Line3D

ln : Line3D
Returns: Vec

Line3D.withLengthFromMid len ln

Full Usage: Line3D.withLengthFromMid len ln

Parameters:
Returns: Line3D
Modifiers: inline

Returns new Line3D with given length. Fixed in the midpoint. Missing length is added to or subtracted from both the end and start of the line. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

len : float
ln : Line3D
Returns: Line3D

Line3D.withLengthFromStart len ln

Full Usage: Line3D.withLengthFromStart len ln

Parameters:
Returns: Line3D
Modifiers: inline

Returns new Line3D with given length, going out from start in direction of end. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

len : float
ln : Line3D
Returns: Line3D

Line3D.withLengthToEnd len ln

Full Usage: Line3D.withLengthToEnd len ln

Parameters:
Returns: Line3D
Modifiers: inline

Returns new Line3D ending at current LineEnd with given length coming from direction of start. Fails on lines shorter than UtilEuclid.zeroLengthTolerance (1e-12).

Extended Type: Line3D

len : float
ln : Line3D
Returns: Line3D

Type something to start searching.