CurvePrimitive Class
A curve primitive is bounded A curve primitive maps fractions in 0..1 to points in space. As the fraction proceeds from 0 towards 1, the point moves "forward" along the curve. True distance along the curve is not always strictly proportional to fraction.
- LineSegment3d always has proportional fraction and distance
- an Arc3d which is true circular has proportional fraction and distance
- A LineString3d is not proportional (except for special case of all segments of equal length)
- A Spiral3d is proportional
- A BsplineCurve3d is only proportional for special cases.
For fractions outside 0..1, the curve primitive class may either (a) return the near endpoint or (b) evaluate an extended curve.
Extends
Extended by
- BezierCurveBase
- BSplineCurve3dBase
- Arc3d
- CurveChainWithDistanceIndex
- LineSegment3d
- LineString3d
- ProxyCurve
- TransitionSpiral3d
Methods
Name | Description | |
---|---|---|
constructor(): CurvePrimitive Protected | ||
addMappedStrokesToLineString3D(map: StrokeCountMap, linestring: LineString3d): number | * evaluate strokes at fractions indicated in a StrokeCountMap. | |
announceClipIntervals(_clipper: Clipper, _announce?: AnnounceNumberNumberCurvePrimitive): boolean | Find intervals of this curvePrimitive that are interior to a clipper | |
appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number | Compute intersections with a plane. | |
clone(): CurvePrimitive Abstract | Return a deep clone. | |
clonePartialCurve(_fractionA: number, _fractionB: number): undefined | CurvePrimitive | Return (if possible) a curve primitive which is a portion of this curve. | |
cloneTransformed(transform: Transform): undefined | CurvePrimitive Abstract | Return a transformed deep clone. | |
closestPoint(spacePoint: Point3d, extend: VariantCurveExtendParameter): undefined | CurveLocationDetail | Search for the curve point that is closest to the spacePoint. | |
collectCurvePrimitives(collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLinestrings: boolean = false): CurvePrimitive[] | Return an array containing only the curve primitives. | |
collectCurvePrimitivesGo(collectorArray: CurvePrimitive[], _smallestPossiblePrimitives: boolean, _explodeLinestrings: boolean = false): void | Return an array containing only the curve primitives. | |
computeAndAttachRecursiveStrokeCounts(options?: StrokeOptions, parentMap?: StrokeCountMap): void | attach StrokeCountMap structure to this primitive (and recursively to any children) | |
computeStrokeCountForOptions(options?: StrokeOptions): number Abstract | return the stroke count required for given options. | |
constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): undefined | CurvePrimitive | CurvePrimitive[] Abstract | Construct an offset of the instance curve as viewed in the xy-plane (ignoring z). | |
curveLength(): number | return the length of the curve. | |
curveLengthBetweenFractions(fraction0: number, fraction1: number): number | Returns a (high accuracy) length of the curve between fractional positions | |
curveLengthWithFixedIntervalCountQuadrature(fraction0: number, fraction1: number, numInterval: number, numGauss: number = 5): number | * Run an integration (with a default gaussian quadrature) with a fixed fractional step | |
emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void Abstract | Ask the curve to announce points and simple subcurve fragments for stroking. | |
emitStrokes(dest: LineString3d, options?: StrokeOptions): void Abstract | Add strokes to caller-supplied linestring | |
endPoint(result?: Point3d): Point3d | return the end point of the primitive. | |
fractionAndDistanceToPointOnTangent(fraction: number, distance: number): Point3d | Construct a point extrapolated along tangent at fraction. | |
fractionToCurvature(fraction: number): undefined | number | Returns the (absolute) curvature magnitude. | |
fractionToFrenetFrame(fraction: number, result?: Transform): undefined | Transform | Construct a frenet frame: | |
fractionToPoint(fraction: number, result?: Point3d): Point3d Abstract | Return the point (x,y,z) on the curve at fractional position. | |
fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): undefined | Plane3dByOriginAndVectors Abstract | Return a plane with | |
fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d Abstract | Return the point (x,y,z) and derivative on the curve at fractional position. | |
fractionToPointAndUnitTangent(fraction: number, result?: Ray3d): Ray3d | Returns a ray whose origin is the curve point and direction is the unit tangent. | |
fractionToSignedXYRadiusOfCurvature(fraction: number): number | Construct signed distance from a point on the curve to its center of curvature (in xy only). | |
getFractionToDistanceScale(): undefined | number | * If the curve primitive has distance-along-curve strictly proportional to curve fraction, return the scale factor. | |
isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean Abstract | Ask if the curve is within tolerance of a plane. | |
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. | |
moveSignedDistanceFromFractionGeneric(startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail): CurveLocationDetail Protected | Generic algorithm to search for point at signed distance from a fractional startPoint. | |
projectedParameterRange(_ray: Ray3d | Vector3d, _lowHigh?: Range1d): undefined | Range1d | Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of projection. | |
quickLength(): number Abstract | Compute a length which may be an fast approximation to the true length. | |
rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d | Returns a (high accuracy) range of the curve between fractional positions | |
rangeBetweenFractionsByClone(fraction0: number, fraction1: number, transform?: Transform): Range3d | Returns a (high accuracy) range of the curve between fractional positions | |
rangeBetweenFractionsByCount(fraction0: number, fraction1: number, count: number, transform?: Transform, extrapolationFactor: number = 0.0): Range3d | Returns an approximate range based on a fixed number of evaluations | |
reverseInPlace(): void Abstract | Reverse the curve's data so that its fractional stroking moves in the opposite direction. | |
startPoint(result?: Point3d): Point3d | return the startPoint of the primitive. | |
installStrokeCountMap(curve: CurvePrimitive, curveMap: StrokeCountMap, parentMap?: StrokeCountMap): void Static | final install step to save curveMap in curve. |
Inherited methods
Name | Inherited from | Description |
---|---|---|
dispatchToGeometryHandler(handler: GeometryHandler): any Abstract | GeometryQuery | * "double dispatch" call pattern. |
extendRange(rangeToExtend: Range3d, transform?: Transform): void Abstract | GeometryQuery | extend rangeToExtend by the range of this geometry multiplied by the transform |
isAlmostEqual(other: GeometryQuery): boolean | GeometryQuery | test for exact structure and nearly identical geometry. |
isSameGeometryClass(other: GeometryQuery): boolean Abstract | GeometryQuery | test if (other instanceof this.Type). |
range(transform?: Transform, result?: Range3d): Range3d | GeometryQuery | return the range of the entire (tree) GeometryQuery |
tryTransformInPlace(transform: Transform): boolean Abstract | GeometryQuery | Attempt to transform in place. |
tryTranslateInPlace(dx: number, dy: number = 0.0, dz: number = 0.0): boolean | GeometryQuery | try to move the geometry by dx,dy,dz |
areAlmostEqual(a: undefined | GeometryQuery, b: undefined | GeometryQuery): boolean Static | GeometryQuery | apply instance method isAlmostEqual if both are defined. |
Properties
Name | Type | Description | |
---|---|---|---|
curvePrimitiveType AbstractReadonly | CurvePrimitiveType | String name for schema properties | |
geometryCategory Readonly | "curvePrimitive" | String name for schema properties | |
isExtensibleFractionSpace Accessor ReadOnly | boolean | * Returns true if the curve's fraction queries extend beyond 0..1. | |
parent | undefined | any | data attached by various algorithms (e.g. | |
strokeData | undefined | StrokeCountMap | data attached during stroking for facets. |
Inherited properties
Name | Type | Inherited from | Description |
---|---|---|---|
children Accessor ReadOnly | undefined | GeometryQuery[] | GeometryQuery | return GeometryQuery children for recursive queries. * leaf classes do not need to implement. |
Defined in
- curve/CurvePrimitive.ts Line 86
Last Updated: 20 June, 2023