BezierCurve3dH Class

3d curve with homogeneous weights.

  • A control point with weight w and cartesian (projected) coordinates x,y,z has the weight multiplied into the coordinates, hence the control point as stored is (xw, yw, zw, w).

Extends

Methods

Name Description
constructor(blockSize: number, data: Float64Array): BezierCurve3dH Protected    
clone(): BezierCurve3dH Clone the entire curve.  
cloneTransformed(transform: Transform): BezierCurve3dH Return a curve after transform.  
dispatchToGeometryHandler(handler: GeometryHandler): any Second step of double dispatch: call handler.handleBezierCurve3dH(this)  
extendRange(rangeToExtend: Range3d, transform?: Transform): void Extend rangeToExtend, using candidate extrema at
both end points
any internal extrema in x,y,z
 
fractionToPoint(fraction: number, result?: Point3d): Point3d Return a (deweighted) point on the curve.  
fractionToPoint4d(fraction: number, result?: Point4d): Point4d Return a (deweighted) point on the curve.  
fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors Construct a plane with
origin at the fractional position along the arc
x axis is the first derivative, i.e.
 
fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d Return the cartesian point and derivative vector.  
getPolePoint3d(i: number, result?: Point3d): Point3d | undefined Return a specific pole normalized to weight 1  
getPolePoint4d(i: number, result?: Point4d): Point4d | undefined Return a specific pole as a full [x,y,z,x] Point4d  
isAlmostEqual(other: any): boolean test for nearly equal control points  
isSameGeometryClass(other: any): boolean test if other is also a BezierCurve3dH.  
isUnitWeight(tolerance?: number): boolean Returns true if all weights are within tolerance of 1.0  
loadSpan3dPolesWithWeight(data: Float64Array, spanIndex: number, weight: number): void Load order 4 doubles from data[3 spanIndex] as poles (with added weight)  
loadSpan4dPoles(data: Float64Array, spanIndex: number): void Load order 4 doubles from data[3 spanIndex] as poles (with added weight)  
poleProductsXYZW(products: Float64Array, ax: number, ay: number, az: number, aw: number): void Form dot products of each pole with given coefficients.  
tryMultiplyMatrix4dInPlace(matrix: Matrix4d): void Apply (multiply by) a perspective transform  
tryTransformInPlace(transform: Transform): boolean Apply (multiply by) an affine transform  
updateClosestPointByTruePerpendicular(spacePoint: Point3d, detail: CurveLocationDetail): boolean Find the closest point within the bezier span, using true perpendicular test (but no endpoint test)
If closer than previously recorded, update the CurveLocationDetail
This assumes this bezier is saturated.
 
create(data: Point3d[] | Point4d[] | Point2d[]): BezierCurve3dH | undefined Static Create a curve with given points.  
createOrder(order: number): BezierCurve3dH Static create a bezier curve of specified order, filled with zeros  

Inherited methods

Name Inherited from Description
addMappedStrokesToLineString3D(map: StrokeCountMap, linestring: LineString3d): number CurvePrimitive * evaluate strokes at fractions indicated in a StrokeCountMap.
allocateAndZeroBezierWorkData(primaryBezierOrder: number, orderA: number, orderB: number): void Protected BezierCurveBase set up the _workBezier members with specific order.
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.
clonePartialCurve(_fractionA: number, _fractionB: number): CurvePrimitive | undefined CurvePrimitive Return (if possible) a curve primitive which is a portion of this curve.
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.
computeStrokeCountForOptions(options?: StrokeOptions): number BezierCurveBase Assess length and turn to determine a stroke count.
copyPolesAsJsonArray(): any[] BezierCurveBase Return a simple array of arrays with the control points as [[x,y,z],[x,y,z],..]
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.
emitStrokableParts(handler: IStrokeHandler, _options?: StrokeOptions): void BezierCurveBase announce intervals with stroke counts
emitStrokes(dest: LineString3d, options?: StrokeOptions): void BezierCurveBase append stroke points to a linestring, based on strokeCount and fractionToPoint from derived class
endPoint(): Point3d BezierCurveBase Return the end point.
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.
fractionToParentFraction(fraction: number): number BezierCurveBase 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)
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.
isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean BezierCurveBase return true if all poles are on a plane.
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.
polygonLength(): number BezierCurveBase Return the length of the control polygon.
quickLength(): number BezierCurveBase Return the control polygon length as a quick length estimate.
range(transform?: Transform, result?: Range3d): Range3d GeometryQuery return the range of the entire (tree) GeometryQuery
reverseInPlace(): void BezierCurveBase reverse the poles in place
saturateInPlace(knotVector: KnotVector, spanIndex: number): boolean BezierCurveBase saturate the pole in place, using knot intervals from spanIndex of the knotVector
setInterval(a: number, b: number): void BezierCurveBase Set mapping to parent curve (e.g.
startPoint(): Point3d BezierCurveBase Return the start point.
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.

Inherited properties

Name Type Inherited from Description
_polygon Protected Bezier1dNd BezierCurveBase Control points
_workCoffsA Protected undefined | Float64Array BezierCurveBase scratch array for use by derived classes, using allocateAndZeroBezierWorkData for sizing.
_workCoffsB Protected undefined | Float64Array BezierCurveBase scratch array for use by derived classes, using allocateAndZeroBezierWorkData for sizing.
_workData0 Protected Float64Array BezierCurveBase scratch data blocks accessible by concrete class.
_workData1 Protected Float64Array BezierCurveBase scratch data blocks accessible by concrete class.
_workPoint0 Protected Point3d BezierCurveBase Scratch xyz point accessible by derived classes.
_workPoint1 Protected Point3d BezierCurveBase Scratch xyz point accessible by derived classes.
children Accessor ReadOnly GeometryQuery[] | undefined GeometryQuery return GeometryQuery children for recursive queries.

* leaf classes do not need to implement.
curvePrimitiveType "bezierCurve" = "bezierCurve" BezierCurveBase String name for schema properties
degree Accessor ReadOnly number BezierCurveBase (property accessor) Return the polynomial degree (one less than order)
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
numPoles Accessor ReadOnly number BezierCurveBase (property accessor) Return the number of poles (aka control points)
order Accessor ReadOnly number BezierCurveBase (property accessor) Return the polynomial order
strokeData undefined | StrokeCountMap CurvePrimitive data attached during stroking for facets.

Defined in

Last Updated: 08 January, 2020