CurveChainWithDistanceIndex Class

CurveChainWithDistanceIndex is a CurvePrimitive whose fractional parameterization is proportional to true distance along a path.

  • For example if the total length of the chain is L, then the distance along the chain from parameters t0 to t1 is easily computed as L*(t1-t0).
  • In this way the CurveChainWithDistanceIndex provides a global arc length parameterization for a CurveChain.
  • A CurveChainWithDistanceIndex can be created from any CurveChain, but a Path is stored internally.
  • Adding a CurveChainWithDistanceIndex to a CurveChain does not preserve the distance index; instead the internal path children are added directly to the CurveChain.

Extends

Methods

Name Description
chainDistanceToChainFraction(distance: number): number Convert distance along the chain to fraction along the chain.  
chainDistanceToFragment(distance: number, allowExtrapolation: boolean = false): PathFragment | undefined Return the PathFragment object at the given distance along the chain.  
chainDistanceToFragmentIndex(distance: number, allowExtrapolation: boolean = false): number | undefined Protected Return the index of the PathFragment at the given distance along the chain.  
clone(options?: StrokeOptions): CurveChainWithDistanceIndex Return a deep clone with its own distance index.  
clonePartialCurve(fractionA: number | CurveLocationDetail, fractionB: number | CurveLocationDetail, options?: StrokeOptions): CurveChainWithDistanceIndex | undefined Return a portion of this curve with its own distance index.  
cloneTransformed(transform: Transform, options?: StrokeOptions): CurveChainWithDistanceIndex Create a clone, transformed and with its own distance index.  
closestPoint(spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail): CurveLocationDetail | undefined Search for the curve point that is closest to the spacePoint.  
closestPointXY(spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail): CurveLocationDetail | undefined Search for the curve point that is closest to the spacePoint as viewed in the xy-plane (ignoring z).  
collectCurvePrimitivesGo(collectorArray: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLineStrings: boolean = false): void Return an array containing only the curve primitives.  
computeAndAttachRecursiveStrokeCounts(options?: StrokeOptions, parentStrokeMap?: StrokeCountMap): void Construct StrokeCountMap for each child, accumulating data to stroke count map for this primitive.  
computeChainDetail(childDetail: CurveLocationDetail, result?: CurveLocationDetail): CurveLocationDetail | undefined Compute the global chain detail corresponding to a local child detail.  
computeStrokeCountForOptions(options?: StrokeOptions): number Return the stroke count required for given options.  
constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): CurvePrimitive | CurvePrimitive[] | undefined Construct an offset of each child as viewed in the xy-plane (ignoring z).  
curveAndChildFractionToFragment(curve: CurvePrimitive, fraction: number): PathFragment | undefined Return the PathFragment object containing the point at the given fraction of the given child curve.  
curveLength(): number Returns the total length of this curve.  
curveLengthBetweenFractions(fraction0: number, fraction1: number): number Return a (high accuracy and positive) length of the curve between fractional positions  
dispatchToGeometryHandler(handler: GeometryHandler): any Second step of double dispatch: call this._path.dispatchToGeometryHandler (handler)  
emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void Ask the curve to announce points and simple subcurve fragments for stroking.  
emitStrokes(dest: LineString3d, options?: StrokeOptions): void Add strokes to caller-supplied linestring  
endPoint(result?: Point3d): Point3d Return the end point of of the chain.  
extendRange(rangeToExtend: Range3d, transform?: Transform): void Extend rangeToExtend as needed to include these curves (optionally transformed)  
fractionToPoint(fraction: number, result?: Point3d): Point3d Return the point (x,y,z) on the curve at fractional position along the chain.  
fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors | undefined Return a plane with  
fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d Return the point (x,y,z) and derivative on the curve at fractional position.  
fractionToPointAndUnitTangent(fraction: number, result?: Ray3d): Ray3d Return the point (x,y,z) and normalized derivative on the curve at fractional position.  
isAlmostEqual(other: GeometryQuery): boolean Test for equality conditions.  
isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean Ask if the curve is within tolerance of a plane.  
isSameGeometryClass(other: GeometryQuery): boolean Test if other is a CurveChainWithDistanceIndex  
moveSignedDistanceFromFraction(startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail): CurveLocationDetail (Attempt to) find a position on the curve at a signed distance from start fraction.  
projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of  
quickLength(): number Returns the total length of the path.  
reverseInPlace(): void Reverse the curve's data so that its fractional stroking moves in the opposite direction.  
startPoint(result?: Point3d): Point3d Return the start point of the chain.  
tryTransformInPlace(transform: Transform): boolean Transform the chain in place.  
convertChildDetailToChainDetail(pairs: CurveLocationDetailPair[], index0: number, chainA?: CurveChainWithDistanceIndex, chainB?: CurveChainWithDistanceIndex, compressAdjacent?: boolean): CurveLocationDetailPair[] Static Given a parent chain, convert the corresponding child details in the specified pairs.  
convertChildDetailToChainDetailSingle(pair: CurveLocationDetailPair, chainA?: CurveChainWithDistanceIndex, chainB?: CurveChainWithDistanceIndex): CurveLocationDetailPair Static Given a parent chain, convert the corresponding child detail in the specified pair.  
createCapture(path: CurveChain, options?: StrokeOptions): CurveChainWithDistanceIndex Static Capture (not clone) a path into a new CurveChainWithDistanceIndex.  
getClosestPointTestCounts(clear: boolean = true): { numAssigned: number, numCalls: number, numCandidate: number, numTested: number } Static Return an object summarizing closest point test counts.  

Inherited methods

Name Inherited from Description
addMappedStrokesToLineString3D(map: StrokeCountMap, linestring: LineString3d): number Inherited CurvePrimitive Evaluate strokes at fractions indicated in a StrokeCountMap.
allTangents(spacePoint: Point3d, options?: TangentOptions): CurveLocationDetail[] | undefined Inherited CurvePrimitive Return all points P on the curve such that the line containing spacePoint and P is tangent to the curve in
announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean Inherited CurvePrimitive Find intervals of this curve that are interior to the clipper.
appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number Inherited CurvePrimitive Compute intersections of the curve with a plane.
closestTangent(spacePoint: Point3d, options?: TangentOptions): CurveLocationDetail | undefined Inherited CurvePrimitive Return the point P on the curve such that the line containing spacePoint and P is tangent to the curve in
collectCurvePrimitives(collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLinestrings: boolean = false): CurvePrimitive[] Inherited CurvePrimitive Return an array containing only the curve primitives.
curveLengthWithFixedIntervalCountQuadrature(fraction0: number, fraction1: number, numInterval: number, numGauss: number = 5): number Inherited CurvePrimitive Run an integration (with a default Gaussian quadrature) with a fixed fractional step
emitTangents(spacePoint: Point3d, announceTangent: (tangent: CurveLocationDetail) => any, options?: TangentOptions): void Inherited CurvePrimitive Announce all points P on the curve such that the line containing spacePoint and P is tangent to the curve in
fractionAndDistanceToPointOnTangent(fraction: number, distance: number): Point3d Inherited CurvePrimitive Construct a point extrapolated along tangent at fraction.
fractionToCurvature(fraction: number): number | undefined Inherited CurvePrimitive Returns the (absolute) curvature magnitude.
fractionToFrenetFrame(fraction: number, result?: Transform): Transform | undefined Inherited CurvePrimitive Construct a Frenet frame:
fractionToSignedXYRadiusOfCurvature(fraction: number): number Inherited CurvePrimitive Construct signed distance from a point on the planar curve to its center of curvature (in xy only).
getFractionToDistanceScale(): number | undefined Inherited CurvePrimitive If the curve primitive has distance-along-curve strictly proportional to curve fraction, return the scale factor.
isPhysicallyClosedCurve(tolerance: number = Geometry.smallMetricDistance, xyOnly: boolean = false): boolean Inherited CurvePrimitive Whether the start and end points are defined and within tolerance.
moveSignedDistanceFromFractionGeneric(startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail): CurveLocationDetail Protected Inherited CurvePrimitive Generic algorithm to search for point at signed distance from a fractional startPoint.
range(transform?: Transform, result?: Range3d): Range3d Inherited CurvePrimitive Return the range of the entire GeometryQuery tree.
rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d Inherited CurvePrimitive Returns the range of the curve between fractional positions.
rangeBetweenFractionsByClone(fraction0: number, fraction1: number, transform?: Transform): Range3d Inherited CurvePrimitive Returns a high accuracy range of the curve between fractional positions using clonePartialCurve.
rangeBetweenFractionsByCount(fraction0: number, fraction1: number, count: number, transform?: Transform, extrapolationFactor: number = 0.0): Range3d Inherited CurvePrimitive Returns an approximate range based on a fixed number of evaluations.
reverse(): this Inherited CurvePrimitive Call reverseInPlace and return the instance.
tryTranslateInPlace(dx: number, dy: number = 0.0, dz: number = 0.0): boolean Inherited CurvePrimitive Try to move the geometry by dx,dy,dz.
areAlmostEqual(a: GeometryQuery, b: GeometryQuery): boolean Static Inherited CurvePrimitive Apply instance method isAlmostEqual if both are defined.
computeScaledTolerance(geom: GeometryQuery | GeometryQuery[], options?: ScaledToleranceOptions): number Static Inherited CurvePrimitive Compute a distance tolerance appropriate for comparing the coordinates of geom.
installStrokeCountMap(curve: CurvePrimitive, curveMap: StrokeCountMap, parentMap?: StrokeCountMap): void Static Inherited CurvePrimitive Final install step to save curveMap in curve.
scaleToleranceForGeometry(geom: GeometryQuery | GeometryQuery[], distanceTolerance: number, options?: ScaledToleranceOptions): number Static Inherited CurvePrimitive Scale the given distance tolerance as appropriate for comparing the coordinates of geom.

Properties

Name Type Description
curvePrimitiveType Readonly "curveChainWithDistanceIndex" String name for schema properties  
fragments Accessor ReadOnly PathFragment[] Reference to the fragments array.  
path Accessor ReadOnly Path Reference to the contained path.  

Inherited properties

Name Type Inherited from Description
children Accessor Inherited ReadOnly GeometryQuery[] | undefined CurvePrimitive Return GeometryQuery children for recursive queries.
* leaf classes do not need to implement.
geometryCategory Readonly Inherited "curvePrimitive" CurvePrimitive String name for schema properties
isExtensibleFractionSpace Accessor Inherited ReadOnly boolean CurvePrimitive * Returns true if the curve can be easily extended past its start/end point (i.e., beyond the usual
fraction space [0,1]). Otherwise, returns false.
* Base class default implementation returns false.
* These classes (and perhaps others in the future) will return true:
* LineSegment3d
* LineString3d
* Arc3d
parent Inherited any | undefined CurvePrimitive Data attached by various algorithms (e.g.
strokeData Inherited StrokeCountMap | undefined CurvePrimitive Data attached during stroking for facets.

Defined in

Last Updated: 24 September, 2026