chainDistanceToFragmentIndex MethodProtected

Return the index of the PathFragment at the given distance along the chain.

chainDistanceToFragmentIndex(distance: number, allowExtrapolation: boolean = false): number | undefined

Parameter Type Description
distance number distance along the chain.
allowExtrapolation boolean if true, returns 0 for negative distances and returns last fragment index for
distances larger than curve length. If false returns undefined for those out of bound distances.

Returns - number | undefined

Defined in

Last Updated: 29 April, 2026