moveSignedDistanceFromFraction Method

(Attempt to) find a position on the curve at a signed distance from start fraction.

  • Return the position as a CurveLocationDetail.
  • In the CurveLocationDetail, record:
    • fraction = fractional position
    • point = coordinates of the point
    • a = (signed!) distance moved. If allowExtension is false and the move reached the start or end of the curve, this distance is smaller than the requested signedDistance.
    • curveSearchStatus indicates one of:
      • error (unusual) computation failed not supported for this curve.
      • success full movement completed
      • stoppedAtBoundary partial movement completed. This can be due to either
        • allowExtension parameter sent as false
        • the curve type (e.g. bspline) does not support extended range.
  • if allowExtension is true, movement may still end at the startPoint or end point for curves that do not support extended geometry (specifically bsplines)
  • if the curve returns a value (i.e. not undefined) for curve.getFractionToDistanceScale(), the base class carries out the computation and returns a final location.
    • LineSegment3d relies on this.
  • If the curve does not implement the computation or the curve has zero length, the returned CurveLocationDetail has
    • fraction = the value of startFraction
    • point = result of curve.fractionToPoint(startFraction)
    • a = 0
    • curveStartState = CurveSearchStatus.error

moveSignedDistanceFromFraction(startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail): CurveLocationDetail

@returns A CurveLocationDetail annotated as above. Note that if the curve does not support the calculation, there is still a result which contains the point at the input startFraction, with failure indicated in the curveStartState member

Parameter Type Description
startFraction number fractional position where the move starts
signedDistance number distance to move. Negative distance is backwards in the fraction space
allowExtension boolean if true, allow the move to go beyond the startPoint or endpoint of the curve. If false,
do not allow movement beyond the startPoint or endpoint
result CurveLocationDetail optional result.

Returns - CurveLocationDetail

A CurveLocationDetail annotated as above. Note that if the curve does not support the calculation, there is still a result which contains the point at the input startFraction, with failure indicated in the curveStartState member

Defined in

Last Updated: 14 November, 2024