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 positionpoint
= coordinates of the pointa
= (signed!) distance moved. IfallowExtension
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 completedstoppedAtBoundary
partial movement completed. This can be due to eitherallowExtension
parameter sent asfalse
- 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
) forcurve.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
hasfraction
= the value ofstartFraction
point
= result ofcurve.fractionToPoint(startFraction)
a
= 0curveStartState
=CurveSearchStatus.error
moveSignedDistanceFromFraction(startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail): CurveLocationDetail
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, all 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
- curve/CurvePrimitive.ts Line 355
Last Updated: 20 June, 2023