PathFragment Class

Annotation of a fragment, i.e. an interval of a curve.

  • The interval is marked with two pairs of numbers:
    • fraction0, fraction1 = fraction parameters along the child curve.
    • distance0, distance1 = distances within containing CurveChainWithDistanceIndex.

Methods

Name Description
constructor(childFraction0: number, childFraction1: number, distance0: number, distance1: number, childCurve: CurvePrimitive, range?: Range3d): PathFragment Create a fragment with complete fraction, distance, and child data.  
chainDistanceToAccurateChildFraction(chainDistance: number, allowExtrapolation?: boolean): number Convert the given chainDistance to a fraction along this childCurve using moveSignedDistanceFromFraction.  
chainDistanceToInterpolatedChildFraction(distance: number): number Convert distance to local fraction and apply that to interpolate between the stored curve fractions.  
childFractionTChainDistance(fraction: number): number   Deprecated  
childFractionToChainDistance(fraction: number): number Convert a fractional position on the childCurve of this fragment to distance on the curve chain.  
containsChainDistance(distance: number): boolean Return true if the distance is within the distance limits of this fragment.  
containsChildCurveAndChildFraction(curve: CurvePrimitive, fraction: number): boolean Return true if this fragment addresses curve and brackets fraction.  
fractionScaleFactor(globalDistance: number): number Return the scale factor to map childCurve fraction derivatives to chain fraction derivatives.  
quickMinDistanceToChildCurve(spacePoint: Point3d): number Return a quick minimum distance from spacePoint to the curve.  
reverseFractionsAndDistances(totalDistance: number): void Reverse the fraction and distance data.  
collectSortedQuickMinDistances(fragments: PathFragment[], spacePoint: Point3d): PathFragment[] Static Return an array with (references to) all the input path fragments, sorted smallest to largest on the "a" value,  

Properties

Name Type Description
a number Working var for use in searches.  
chainDistance0 number Distance along parent to this fragment start.  
chainDistance1 number Distance along parent to this fragment end.  
childCurve CurvePrimitive Curve primitive of this fragment, as presented in stroker.  
childFraction0 number The start of this PathFragment, as a local fractional parameter of this.childCurve.  
childFraction1 number The end of this PathFragment, as a local fractional parameter of this.childCurve.  
range undefined | Range3d Optional range  

Defined in

Last Updated: 15 March, 2024