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 parameterst0
tot1
is easily computed asL*(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 aCurveChain
does not preserve the distance index; instead the internal path children are added directly to theCurveChain
.
Extends
Methods
Name | Description | |
---|---|---|
chainDistanceToChainFraction(distance: number): number | Convert distance along the chain to fraction along the chain. | |
chainDistanceToFragment(distance: number, allowExtrapolation: booleanfalse): undefined | PathFragment | Return the PathFragment object at the given distance along the chain. |
|
chainDistanceToFragmentIndex(distance: number, allowExtrapolation: booleanfalse): undefined | number 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): undefined | CurveChainWithDistanceIndex | Return a portion of this curve with its own distance index. | |
cloneTransformed(transform: Transform, options?: StrokeOptions): undefined | CurveChainWithDistanceIndex | Create a clone, transformed and with its own distance index. | |
closestPoint(spacePoint: Point3d, extend: VariantCurveExtendParameter, result?: CurveLocationDetail): undefined | CurveLocationDetail | Search for the curve point that is closest to the spacePoint. | |
collectCurvePrimitivesGo(collectorArray: CurvePrimitive[], smallestPossiblePrimitives: booleanfalse, explodeLineStrings: booleanfalse): 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): undefined | CurveLocationDetail | 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): undefined | CurvePrimitive | CurvePrimitive[] | Construct an offset of each child as viewed in the xy-plane (ignoring z). | |
curveAndChildFractionToFragment(curve: CurvePrimitive, fraction: number): undefined | PathFragment | 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 this curve. |
|
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): undefined | Plane3dByOriginAndVectors | 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): undefined | Range1d | 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 this curve. |
|
tryTransformInPlace(transform: Transform): boolean | Attempt to transform in place. | |
createCapture(path: CurveChain, options?: StrokeOptions): CurveChainWithDistanceIndex Static | Capture (not clone) a path into a new CurveChainWithDistanceIndex . |
|
getClosestPointTestCounts(clear: booleantrue): { 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. |
announceClipIntervals(_clipper: Clipper, _announce?: AnnounceNumberNumberCurvePrimitive): boolean Inherited | CurvePrimitive | Find intervals of this curvePrimitive that are interior to a clipper |
appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number Inherited | CurvePrimitive | Compute intersections of the curve with a plane. |
collectCurvePrimitives(collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: booleanfalse, explodeLinestrings: booleanfalse): CurvePrimitive[] Inherited | CurvePrimitive | Return an array containing only the curve primitives. |
curveLengthWithFixedIntervalCountQuadrature(fraction0: number, fraction1: number, numInterval: number, numGauss: number5): number Inherited | CurvePrimitive | Run an integration (with a default Gaussian quadrature) with a fixed fractional step |
fractionAndDistanceToPointOnTangent(fraction: number, distance: number): Point3d Inherited | CurvePrimitive | Construct a point extrapolated along tangent at fraction. |
fractionToCurvature(fraction: number): undefined | number Inherited | CurvePrimitive | Returns the (absolute) curvature magnitude. |
fractionToFrenetFrame(fraction: number, result?: Transform): undefined | Transform 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(): undefined | number Inherited | CurvePrimitive | If the curve primitive has distance-along-curve strictly proportional to curve fraction, return the scale factor. |
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 a (high accuracy) 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 |
rangeBetweenFractionsByCount(fraction0: number, fraction1: number, count: number, transform?: Transform, extrapolationFactor: number0.0): Range3d Inherited | CurvePrimitive | Returns an approximate range based on a fixed number of evaluations |
tryTranslateInPlace(dx: number, dy: number0.0, dz: number0.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. |
installStrokeCountMap(curve: CurvePrimitive, curveMap: StrokeCountMap, parentMap?: StrokeCountMap): void Static Inherited | CurvePrimitive | Final install step to save curveMap in curve. |
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 | undefined | GeometryQuery[] | 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
- curve/CurveChainWithDistanceIndex.ts Line 245
Last Updated: 14 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.