BezierCurveBase Class
Base class for CurvePrimitive (necessarily 3D) with _polygon.
- This has a Bezier1dNd polygon as a member, and implements dimension-independent methods
- This exists to support
- BezierCurve3d -- 3 coordinates x,y,z per block in the Bezier1dNd poles
- BezierCurve3dH -- 4 coordinates x,y,z,w per block in the Bezier1dNd poles
- The implementations of "pure 3d" queries is based on calling
getPolePoint3d
. - This has the subtle failure difference that
getPolePoint3d
call with a valid index on on a 3d curve always succeeds, but on 3dH curve fails when weight is zero.
Extends
Extended by
Methods
Name | Description | |
---|---|---|
constructor(blockSize: number, data: Float64Array): BezierCurveBase Protected | ||
allocateAndZeroBezierWorkData(primaryBezierOrder: number, orderA: number, orderB: number): void Protected | set up the _workBezier members with specific order. | |
computeStrokeCountForOptions(options?: StrokeOptions): number | Assess length and turn to determine a stroke count. | |
copyPolesAsJsonArray(): any[] | Return a simple array of arrays with the control points as [[x,y,z],[x,y,z],..] |
|
emitStrokableParts(handler: IStrokeHandler, _options?: StrokeOptions): void | announce intervals with stroke counts | |
emitStrokes(dest: LineString3d, options?: StrokeOptions): void | append stroke points to a linestring, based on strokeCount and fractionToPoint from derived class |
|
endPoint(): Point3d | Return the end point. | |
extendRange(rangeToExtend: Range3d, transform?: Transform): void Abstract | Concrete classes must implement extendRange . | |
fractionToParentFraction(fraction: number): number | map fraction from this Bezier curves inherent 0..1 range to the (a,b) range of parent* ( The parent range should have been previously defined with setInterval ) |
|
getPolePoint3d(i: number, point?: Point3d): Point3d | undefined Abstract | Get pole i as a Point3d. |
|
getPolePoint4d(i: number, point?: Point4d): Point4d | undefined Abstract | Get pole i as a Point4d. |
|
isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean | return true if all poles are on a plane. | |
polygonLength(): number | Return the length of the control polygon. | |
quickLength(): number | Return the control polygon length as a quick length estimate. | |
reverseInPlace(): void | reverse the poles in place | |
saturateInPlace(knotVector: KnotVector, spanIndex: number): boolean | saturate the pole in place, using knot intervals from spanIndex of the knotVector |
|
setInterval(a: number, b: number): void | Set mapping to parent curve (e.g. | |
startPoint(): Point3d | Return the start point. |
Inherited methods
Name | Inherited from | Description |
---|---|---|
addMappedStrokesToLineString3D(map: StrokeCountMap, linestring: LineString3d): number | CurvePrimitive | * evaluate strokes at fractions indicated in a StrokeCountMap. |
announceClipIntervals(_clipper: Clipper, _announce?: AnnounceNumberNumberCurvePrimitive): boolean | CurvePrimitive | Find intervals of this curvePrimitive that are interior to a clipper |
appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number | CurvePrimitive | Compute intersections with a plane. |
clone(): GeometryQuery | undefined Abstract | GeometryQuery | return a clone |
clonePartialCurve(_fractionA: number, _fractionB: number): CurvePrimitive | undefined | CurvePrimitive | Return (if possible) a curve primitive which is a portion of this curve. |
cloneTransformed(transform: Transform): GeometryQuery | undefined Abstract | GeometryQuery | return a transformed clone. |
closestPoint(spacePoint: Point3d, extend: VariantCurveExtendParameter): CurveLocationDetail | undefined | CurvePrimitive | Search for the curve point that is closest to the spacePoint. |
computeAndAttachRecursiveStrokeCounts(options?: StrokeOptions, parentMap?: StrokeCountMap): void | CurvePrimitive | attach StrokeCountMap structure to this primitive (and recursively to any children) * Base class implementation (here) gets the simple count from computeStrokeCountForOptions and attaches it. |
curveLength(): number | CurvePrimitive | return the length of the curve. |
curveLengthBetweenFractions(fraction0: number, fraction1: number): number | CurvePrimitive | Returns a (high accuracy) length of the curve between fractional positions * Curve length is always positive. |
curveLengthWithFixedIntervalCountQuadrature(fraction0: number, fraction1: number, numInterval: number, numGauss: number = 5): number | CurvePrimitive | Run an integration (with a default gaussian quadrature) with a fixed fractional step This is typically called by specific curve type implementations of curveLengthBetweenFractions. |
dispatchToGeometryHandler(handler: GeometryHandler): any Abstract | GeometryQuery | * "double dispatch" call pattern. |
fractionAndDistanceToPointOnTangent(fraction: number, distance: number): Point3d | CurvePrimitive | Construct a point extrapolated along tangent at fraction. |
fractionToFrenetFrame(fraction: number, result?: Transform): Transform | undefined | CurvePrimitive | Construct a frenet frame: origin at the point on the curve x axis is unit vector along the curve (tangent) * y axis is perpendicular and in the plane of the osculating circle. |
fractionToPoint(fraction: number, result?: Point3d): Point3d Abstract | CurvePrimitive | Return the point (x,y,z) on the curve at fractional position. |
fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors | undefined Abstract | CurvePrimitive | Return a plane with origin at fractional position along the curve vectorU is the first derivative, i.e. |
fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d Abstract | CurvePrimitive | Return the point (x,y,z) and derivative on the curve at fractional position. |
fractionToPointAndUnitTangent(fraction: number, result?: Ray3d): Ray3d | CurvePrimitive | Returns a ray whose origin is the curve point and direction is the unit tangent. |
getFractionToDistanceScale(): number | undefined | CurvePrimitive | If the curve primitive has distance-along-curve strictly proportional to curve fraction, return true If distance-along-the-curve is not proportional, return undefined. |
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). |
moveSignedDistanceFromFraction(startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail): CurveLocationDetail | CurvePrimitive | * (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 | CurvePrimitive | Generic algorithm to search for point at signed distance from a fractional startPoint. |
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, dz: number = 0): boolean | GeometryQuery | try to move the geometry by dx,dy,dz |
installStrokeCountMap(curve: CurvePrimitive, curveMap: StrokeCountMap, parentMap?: StrokeCountMap): void Static | CurvePrimitive | final install step to save curveMap in curve. |
Properties
Name | Type | Description | |
---|---|---|---|
_polygon Protected | Bezier1dNd | Control points | |
_workCoffsA Protected | undefined | Float64Array | scratch array for use by derived classes, using allocateAndZeroBezierWorkData for sizing. | |
_workCoffsB Protected | undefined | Float64Array | scratch array for use by derived classes, using allocateAndZeroBezierWorkData for sizing. | |
_workData0 Protected | Float64Array | scratch data blocks accessible by concrete class. | |
_workData1 Protected | Float64Array | scratch data blocks accessible by concrete class. | |
_workPoint0 Protected | Point3d | Scratch xyz point accessible by derived classes. | |
_workPoint1 Protected | Point3d | Scratch xyz point accessible by derived classes. | |
curvePrimitiveType | "bezierCurve" = "bezierCurve" | String name for schema properties | |
degree Accessor ReadOnly | number | (property accessor) Return the polynomial degree (one less than order) | |
numPoles Accessor ReadOnly | number | (property accessor) Return the number of poles (aka control points) | |
order Accessor ReadOnly | number | (property accessor) Return the polynomial order |
Inherited properties
Name | Type | Inherited from | Description |
---|---|---|---|
children Accessor ReadOnly | GeometryQuery[] | undefined | GeometryQuery | return GeometryQuery children for recursive queries. * leaf classes do not need to implement. |
geometryCategory | "curvePrimitive" = "curvePrimitive" | CurvePrimitive | String name for schema properties |
isExtensibleFractionSpace Accessor ReadOnly | boolean | CurvePrimitive | Returns true if the curve's fraction queries extend beyond 0..1. Base class default implementation returns false. These class (and perhaps others in the future) will return true: LineSegment3d LineString3d Arc3d |
strokeData | undefined | StrokeCountMap | CurvePrimitive | data attached during stroking for facets. |
Defined in
Last Updated: 08 January, 2020