@itwin/core-geometry 5.10.2 → 5.11.0-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +1 -1
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.d.ts +2 -2
- package/lib/cjs/clipping/BooleanClipNode.js +2 -2
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +8 -2
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +8 -2
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts +26 -24
- package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +44 -35
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +1 -1
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.d.ts +4 -3
- package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipVector.js +4 -3
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +2 -2
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +2 -2
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +1 -1
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +1 -1
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.d.ts +5 -2
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.d.ts.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js +5 -2
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts +21 -5
- package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js +27 -4
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.d.ts +7 -1
- package/lib/cjs/solid/SolidPrimitive.d.ts.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js +8 -1
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts +1 -1
- package/lib/esm/bspline/BSplineCurve.js +1 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.d.ts +2 -2
- package/lib/esm/clipping/BooleanClipNode.js +2 -2
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +8 -2
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +8 -2
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts +26 -24
- package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +44 -35
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +1 -1
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.d.ts +4 -3
- package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
- package/lib/esm/clipping/ClipVector.js +4 -3
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +2 -2
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +2 -2
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +1 -1
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +1 -1
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.d.ts +5 -2
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.d.ts.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js +5 -2
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts +21 -5
- package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/esm/solid/RotationalSweep.js +26 -4
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.d.ts +7 -1
- package/lib/esm/solid/SolidPrimitive.d.ts.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js +6 -0
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log - @itwin/core-geometry
|
|
2
2
|
|
|
3
|
-
This log was last generated on Thu, 11 Jun 2026 21:
|
|
3
|
+
This log was last generated on Thu, 11 Jun 2026 21:11:10 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
## 5.10.2
|
|
6
6
|
Thu, 11 Jun 2026 21:09:38 GMT
|
|
@@ -98,7 +98,7 @@ export declare abstract class BSplineCurve3dBase extends CurvePrimitive {
|
|
|
98
98
|
get order(): number;
|
|
99
99
|
/**
|
|
100
100
|
* Return the number of Bezier spans in the curve. Note that this number includes the number of null
|
|
101
|
-
* spans at repeated
|
|
101
|
+
* spans at repeated knots.
|
|
102
102
|
*/
|
|
103
103
|
get numSpan(): number;
|
|
104
104
|
/** Return the number of poles. */
|
|
@@ -113,7 +113,7 @@ class BSplineCurve3dBase extends CurvePrimitive_1.CurvePrimitive {
|
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
115
115
|
* Return the number of Bezier spans in the curve. Note that this number includes the number of null
|
|
116
|
-
* spans at repeated
|
|
116
|
+
* spans at repeated knots.
|
|
117
117
|
*/
|
|
118
118
|
get numSpan() {
|
|
119
119
|
return this._bcurve.numSpan;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BSplineCurve.js","sourceRoot":"","sources":["../../../src/bspline/BSplineCurve.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,sEAAsF;AACtF,4DAAyD;AACzD,yFAAsF;AACtF,mGAAgG;AAEhG,0DAAuD;AACvD,kEAA+D;AAE/D,0CAA+D;AAE/D,qEAAkE;AAElE,uFAAoF;AACpF,mEAAkE;AAClE,6DAA0D;AAC1D,+CAAuD;AACvD,+CAA4C;AAE5C,mDAAgD;AAChD,qEAAiE;AAEjE,6CAA0C;AAC1C,mDAAgD;AAChD,qDAAkD;AAElD,+CAA4C;AAC5C,uDAAoD;AAEpD,6CAA2D;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,MAAsB,kBAAmB,SAAQ,+BAAc;IAC7D,yCAAyC;IACzB,kBAAkB,GAAG,cAAc,CAAC;IACpD,mEAAmE;IACzD,OAAO,CAAc;IACvB,eAAe,CAAO;IAC9B,IAAW,cAAc,CAAC,IAAS;QACjC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC;IACD,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IACD,YAAsB,aAAqB,EAAE,QAAgB,EAAE,KAAa,EAAE,KAAiB;QAC7F,KAAK,EAAE,CAAC;QACR,I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MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;CACF;AAxbD,wCAwbC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Bspline\n */\n\nimport { VariantCurveExtendParameter } from \"../curve/CurveExtendMode\";\nimport { CurveIntervalRole, CurveLocationDetail } from \"../curve/CurveLocationDetail\";\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { CurveOffsetXYHandler } from \"../curve/internalContexts/CurveOffsetXYHandler\";\nimport { PlaneAltitudeRangeContext } from \"../curve/internalContexts/PlaneAltitudeRangeContext\";\nimport { LineString3d } from \"../curve/LineString3d\";\nimport { OffsetOptions } from \"../curve/OffsetOptions\";\nimport { StrokeCountMap } from \"../curve/Query/StrokeCountMap\";\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\nimport { Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { GeometryHandler, IStrokeHandler } from \"../geometry3d/GeometryHandler\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Point3dArray } from \"../geometry3d/PointHelpers\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { Point4d } from \"../geometry4d/Point4d\";\nimport { UnivariateBezier } from \"../numerics/BezierPolynomials\";\nimport { AkimaCurve3dOptions } from \"./AkimaCurve3d\";\nimport { Bezier1dNd } from \"./Bezier1dNd\";\nimport { BezierCurve3d } from \"./BezierCurve3d\";\nimport { BezierCurve3dH } from \"./BezierCurve3dH\";\nimport { BezierCurveBase } from \"./BezierCurveBase\";\nimport { BSpline1dNd } from \"./BSpline1dNd\";\nimport { BSplineCurveOps } from \"./BSplineCurveOps\";\nimport { InterpolationCurve3dOptions } from \"./InterpolationCurve3d\";\nimport { BSplineWrapMode, KnotVector } from \"./KnotVector\";\n\n/**\n * Base class for BSplineCurve3d and BSplineCurve3dH.\n * * A B-spline curve consists of an array of `knots`, an array of `poles`, and a `degree`.\n * * The knot array is a non-decreasing sequence of numbers. It is also called a \"knot vector\".\n * * The curve is a parametric function whose domain is a sub-range of its knots.\n * * The API sometimes refers to a domain parameter `u` as a \"knot\", even if `u` is not actually an entry in the\n * knot array.\n * * The curve loosely \"follows\" the line string formed by the poles, aka the \"control polygon\".\n * * The curve is a chain of polynomial segments, aka \"spans\" or \"fragments\". B-spline theory identifies these as\n * Bezier curves.\n * * The polynomial spans all have same `degree`.\n * * Each span is controlled by `order = degree + 1` contiguous points in the pole array.\n * * There is a strict relationship between knot and poles counts: `numPoles + order = numKnots + 2'.\n * * The number of spans is `numSpan = numPoles - degree`.\n * * For a span with index `spanIndex`:\n * * The `order` relevant poles begin at pole index `spanIndex`.\n * * The `2*degree` relevant knots begin at knot index `spanIndex`.\n * * The span domain is the knot range `[knot[spanIndex+degree-1], knot[spanIndex+degree]]`.\n * * The curve domain is the knot range `[knot[degree-1], knot[numSpan+degree-1]]`, or equivalently\n * `[knot[degree-1], knot[numPoles-1]]`. The API refers to this domain as the \"active knot interval\" of the curve.\n *\n * Nearly all B-spline curves are \"clamped\".\n * * This means that in the `knots` array, the first `degree` knots are equal, and the last `degree` knots are equal.\n * We say the smallest knot and the largest knot have multiplicity `degree`.\n * * Clamping make the curve pass through its first and last poles, with tangents directed along the first and\n * last edges of the control polygon.\n * * For instance, a cubic B-spline curve with knot vector `[0,0,0,1,2,3,3,3]`\n * * can be evaluated at parameter values in the range `[0, 3]`\n * * has 3 spans, with domains `[0, 1]`, `[1, 2]`, and `[2, 3]`\n * * has 6 poles\n * * passes through its first and last poles.\n * * The `create` methods may allow the classic convention that has an extra knot at the beginning and end of the\n * knot vector.\n * * These two extra knots are not actually needed to define the B-spline curve.\n * * When the `create` methods recognize the classic setup (`numPoles + order = numKnots`), the extra knots are\n * not saved with the BSplineCurve3dBase knots.\n *\n * * The weighted variant [[BSplineCurve3dH]] has the problem that `CurvePrimitive` 3D typing does not allow the\n * undefined result where a homogeneous pole has zero weight; the convention in this case is to return 000.\n *\n * * Note the class relationships:\n * * [[BSpline1dNd]] knows the definitional B-spline recurrence relation with no physical interpretation for the poles.\n * * BsplineCurve3dBase owns a protected BSpline1dNd.\n * * `BsplineCurve3dBase` is derived from [[CurvePrimitive]], which creates obligation to act as a 3D curve, e.g.,\n * * evaluate fraction to point and derivatives wrt fraction.\n * * compute intersection with plane.\n * * [[BSplineCurve3d]] and [[BSplineCurve3dH]] have variant logic driven by whether or not there are \"weights\" on the poles.\n * * For `BSplineCurve3d`, the xyz value of pole calculations are \"final\" values for 3d evaluation.\n * * For `BSplineCurve3dH`, various `BSpline1dNd` results with xyzw have to be normalized back to xyz.\n *\n * * These classes do not support \"periodic\" variants.\n * * Periodic curves historically have carried a flag (e.g., \"closed\") indicating that certain un-stored\n * leading/trailing knots and poles are understood to wrap around periodically.\n * * Instead, these classes carry no such flag. They represent such curves with explicitly wrapped knots/poles.\n *\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/BSpline/\n * @public\n */\nexport abstract class BSplineCurve3dBase extends CurvePrimitive {\n /** String name for schema properties. */\n public readonly curvePrimitiveType = \"bsplineCurve\";\n /** The underlying blocked-pole spline, with simple x,y,z poles. */\n protected _bcurve: BSpline1dNd;\n private _definitionData?: any;\n public set definitionData(data: any) {\n this._definitionData = data;\n }\n public get definitionData(): any {\n return this._definitionData;\n }\n protected constructor(poleDimension: number, numPoles: number, order: number, knots: KnotVector) {\n super();\n this._bcurve = BSpline1dNd.create(numPoles, poleDimension, order, knots);\n }\n /** Return the degree (one less than the order) of the curve. */\n public get degree(): number {\n return this._bcurve.degree;\n }\n /** Return the order (one more than degree) of the curve. */\n public get order(): number {\n return this._bcurve.order;\n }\n /**\n * Return the number of Bezier spans in the curve. Note that this number includes the number of null\n * spans at repeated knows.\n */\n public get numSpan(): number {\n return this._bcurve.numSpan;\n }\n /** Return the number of poles. */\n public get numPoles(): number {\n return this._bcurve.numPoles;\n }\n /** Return live reference to the poles of the curve. */\n public get polesRef(): Float64Array {\n return this._bcurve.packedData;\n }\n /** Return live reference to the knots of the curve. */\n public get knotsRef(): Float64Array {\n return this._bcurve.knots.knots;\n }\n /**\n * Number of components per pole, e.g.,\n * * 3 for conventional (x,y,z) curve.\n * * 4 for weighted (wx,wy,wz,w) curve.\n */\n public get poleDimension(): number {\n return this._bcurve.poleLength;\n }\n /** Return a simple array form of the knots. Optionally replicate the first and last in classic over-clamped manner. */\n public copyKnots(includeExtraEndKnot: boolean): number[] {\n return this._bcurve.knots.copyKnots(includeExtraEndKnot);\n }\n /** Get the flag indicating the curve might be suitable for having wrapped \"closed\" interpretation. */\n public getWrappable(): BSplineWrapMode {\n return this._bcurve.knots.wrappable;\n }\n /** Set the flag indicating the curve might be suitable for having wrapped \"closed\" interpretation. */\n public setWrappable(value: BSplineWrapMode) {\n this._bcurve.knots.wrappable = value;\n }\n /**\n * Test knots and poles to determine if it is possible to close (aka \"wrap\") the curve.\n * @returns the manner in which it is possible to close the curve. See `BSplineWrapMode` for particulars of each mode.\n */\n public get isClosableCurve(): BSplineWrapMode {\n const mode = this._bcurve.knots.wrappable;\n if (mode === BSplineWrapMode.None)\n return BSplineWrapMode.None;\n if (!this._bcurve.knots.testClosable(mode))\n return BSplineWrapMode.None;\n if (!this._bcurve.testClosablePolygon(mode))\n return BSplineWrapMode.None;\n return mode;\n }\n /** Evaluate the curve at a fractional position within a given span. */\n public abstract evaluatePointInSpan(spanIndex: number, spanFraction: number, result?: Point3d): Point3d;\n /**\n * Evaluate the curve and derivative at a fractional position within a given span.\n * * The derivative is with respect to the span fractional parameter, _not_ to the curve's parameter or fractional parameter.\n */\n public abstract evaluatePointAndDerivativeInSpan(spanIndex: number, spanFraction: number, result?: Ray3d): Ray3d;\n /** Evaluate the curve at the given parameter. */\n public abstract knotToPoint(knot: number, result?: Point3d): Point3d;\n /** Evaluate the curve and derivative at the given parameter. */\n public abstract knotToPointAndDerivative(knot: number, result?: Ray3d): Ray3d;\n /** Evaluate the curve and two derivatives at the given parameter. */\n public abstract knotToPointAnd2Derivatives(knot: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors;\n /** Evaluate the curve point at the given fractional parameter. */\n public fractionToPoint(fraction: number, result?: Point3d): Point3d {\n return this.knotToPoint(this._bcurve.knots.fractionToKnot(fraction), result);\n }\n /** Evaluate the curve and derivative at the given fractional parameter. */\n public fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d {\n const knot = this._bcurve.knots.fractionToKnot(fraction);\n result = this.knotToPointAndDerivative(knot, result);\n result.direction.scaleInPlace(this._bcurve.knots.knotLength01);\n return result;\n }\n /** Evaluate the curve and two derivatives at the given fractional parameter. */\n public fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n const knot = this._bcurve.knots.fractionToKnot(fraction);\n result = this.knotToPointAnd2Derivatives(knot, result);\n const a = this._bcurve.knots.knotLength01;\n result.vectorU.scaleInPlace(a);\n result.vectorV.scaleInPlace(a * a);\n return result;\n }\n /** Return the start point of the curve. */\n public override startPoint(result?: Point3d): Point3d {\n return this.evaluatePointInSpan(0, 0.0, result);\n }\n /** Return the end point of the curve. */\n public override endPoint(result?: Point3d): Point3d {\n return this.evaluatePointInSpan(this.numSpan - 1, 1.0, result);\n }\n /**\n * Reverse the curve in place.\n * * Poles are reversed.\n * * Knot values are mirrored around the middle of the knot array.\n */\n public reverseInPlace(): void {\n this._bcurve.reverseInPlace();\n }\n /** Return an array with this curve's Bezier fragments. */\n public collectBezierSpans(prefer3dH: boolean): BezierCurveBase[] {\n const result: BezierCurveBase[] = [];\n const numSpans = this.numSpan;\n for (let i = 0; i < numSpans; i++) {\n if (this._bcurve.knots.isIndexOfRealSpan(i)) {\n const span = this.getSaturatedBezierSpan3dOr3dH(i, prefer3dH);\n if (span)\n result.push(span);\n }\n }\n return result;\n }\n /**\n * Return the Bezier fragment corresponding to the given span of this curve.\n * * The concrete return type may be [[BezierCurve3d]] or [[BezierCurve3dH]] according to the instance type and `prefer3dH`.\n * @param spanIndex index of span.\n * @param prefer3dH true to force promotion to homogeneous.\n * @param result optional reusable curve. This will only be reused if its type and order matches.\n */\n public abstract getSaturatedBezierSpan3dOr3dH(\n spanIndex: number, prefer3dH: boolean, result?: BezierCurveBase,\n ): BezierCurveBase | undefined;\n /**\n * Return a specified pole as a Point4d.\n * * BSplineCurve3d appends weight 1 to its xyz.\n * * BSplineCurve3dH with pole whose \"normalized\" point is (x,y,z) but has weight w returns the weighted form (wx,wy,wz,w).\n */\n public abstract getPolePoint4d(poleIndex: number, result?: Point4d): Point4d | undefined;\n /**\n * Return a specified pole as a Point3d.\n * * BSplineCurve3d returns its simple xyz.\n * * BSplineCurve3dH attempts to normalize its (wx,wy,wz,w) back to (x,y,z), and returns undefined if weight is zero.\n * @param poleIndex index of the pole.\n * @param result optional result.\n */\n public abstract getPolePoint3d(poleIndex: number, result?: Point3d): Point3d | undefined;\n /** Given a pole index, return the starting index for the contiguous array. */\n public poleIndexToDataIndex(poleIndex: number): number | undefined {\n if (poleIndex >= 0 && poleIndex < this.numPoles)\n return poleIndex * this._bcurve.poleLength;\n return undefined;\n }\n /**\n * Search for the curve point that is closest to the spacePoint.\n * * If the space point is exactly on the curve, this is the reverse of fractionToPoint.\n * * Since CurvePrimitive should always have start and end available as candidate points, this method should always\n * succeed.\n * @param spacePoint point in space.\n * @param _extend ignored (pass false). A BSplineCurve3dBase cannot be extended.\n * @param result optional pre-allocated detail to populate and return.\n * @returns details of the closest point.\n */\n public override closestPoint(\n spacePoint: Point3d, _extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\n ): CurveLocationDetail | undefined {\n // seed at start point; final point comes with final bezier perpendicular step\n const point = this.fractionToPoint(0);\n result = CurveLocationDetail.createCurveFractionPointDistance(this, 0.0, point, point.distance(spacePoint), result);\n let span: BezierCurve3dH | undefined;\n const numSpans = this.numSpan;\n for (let i = 0; i < numSpans; i++) {\n if (this._bcurve.knots.isIndexOfRealSpan(i)) {\n span = this.getSaturatedBezierSpan3dOr3dH(i, true, span) as BezierCurve3dH;\n if (span) {\n // if the B-spline is discontinuous, both ends should be tested; ignore that possibility\n if (span.updateClosestPointByTruePerpendicular(spacePoint, result, false, true)) {\n // the detail records the span bezier; promote it to the parent curve\n result.curve = this;\n result.fraction = span.fractionToParentFraction(result.fraction);\n }\n }\n }\n }\n return result;\n }\n /** Return a deep clone. */\n public abstract override clone(): BSplineCurve3dBase;\n /** Return a transformed deep clone. */\n public override cloneTransformed(transform: Transform): BSplineCurve3dBase {\n const curve = this.clone();\n curve.tryTransformInPlace(transform);\n return curve;\n }\n /**\n * Return a curve primitive which is a portion of this curve.\n * @param fractionA start fraction.\n * @param fractionB end fraction.\n */\n public override clonePartialCurve(fractionA: number, fractionB: number): BSplineCurve3dBase {\n let clone: BSplineCurve3dBase;\n if (fractionA > fractionB) {\n clone = this.clonePartialCurve(fractionB, fractionA);\n clone.reverseInPlace();\n return clone;\n }\n clone = this.clone();\n const origNumKnots = clone._bcurve.knots.knots.length;\n let knotA = clone._bcurve.knots.fractionToKnot(fractionA);\n let knotB = clone._bcurve.knots.fractionToKnot(fractionB);\n clone._bcurve.addKnot(knotA, clone.degree);\n clone._bcurve.addKnot(knotB, clone.degree);\n if (origNumKnots === clone._bcurve.knots.knots.length)\n return clone; // full curve\n if (knotA > knotB)\n [knotA, knotB] = [knotB, knotA];\n // choose first/last knot and pole such that knotA/knotB has degree multiplicity in the new knot sequence\n const iStartKnot = clone._bcurve.knots.knotToLeftKnotIndex(knotA) - clone.degree + 1;\n const iStartPole = iStartKnot * clone._bcurve.poleLength;\n const iLastKnot = clone._bcurve.knots.knotToLeftKnotIndex(knotB);\n let iLastKnotLeftMultiple = iLastKnot - clone._bcurve.knots.getKnotMultiplicityAtIndex(iLastKnot) + 1;\n if (clone._bcurve.knots.knots[iLastKnot] < knotB)\n iLastKnotLeftMultiple = iLastKnot + 1;\n const iEndPole = (iLastKnotLeftMultiple + 1) * clone._bcurve.poleLength; // one past last pole\n const iEndKnot = iLastKnotLeftMultiple + clone.degree; // one past last knot\n // trim the arrays (leave knots unnormalized)\n clone._bcurve.knots.setKnotsCapture(clone._bcurve.knots.knots.slice(iStartKnot, iEndKnot));\n clone._bcurve.packedData = clone._bcurve.packedData.slice(iStartPole, iEndPole);\n clone.setWrappable(BSplineWrapMode.None); // always open\n return clone;\n }\n /**\n * Implement `CurvePrimitive.appendPlaneIntersections` to compute intersections of the curve with a plane.\n * @param plane the plane with which to intersect the curve. Concrete types include [[Plane3dByOriginAndUnitNormal]],\n * [[Point4d]], etc.\n * @param result growing array of plane intersections.\n * @return number of intersections appended to the array.\n */\n public override appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number {\n const numPole = this.numPoles;\n const order = this.order;\n const allCoffs = new Float64Array(numPole);\n const numSpan = this.numSpan;\n const point4d = Point4d.create();\n // compute all pole altitudes from the plane\n const minMax = Range1d.createNull();\n // put the altitudes of all the B-spline poles in one array\n for (let i = 0; i < numPole; i++) {\n this.getPolePoint4d(i, point4d);\n allCoffs[i] = plane.weightedAltitude(point4d);\n minMax.extendX(allCoffs[i]);\n }\n // A univariate B-spline through the altitude poles gives altitude as function of the B-spline knot.\n // The (bspline) altitude function for each span is `order` consecutive altitudes.\n // If those altitudes bracket zero, the span may potentially have a crossing.\n let univariateBezier: UnivariateBezier | undefined;\n let numFound = 0;\n let previousFraction = -1000.0;\n if (minMax.containsX(0.0)) {\n for (let spanIndex = 0; spanIndex < numSpan; spanIndex++) {\n if (this._bcurve.knots.isIndexOfRealSpan(spanIndex)) { // ignore trivial knot intervals\n // outer range test ...\n minMax.setNull();\n minMax.extendArraySubset(allCoffs, spanIndex, order);\n if (minMax.containsX(0.0)) {\n // pack the B-spline support into a univariate bezier\n univariateBezier = UnivariateBezier.createArraySubset(allCoffs, spanIndex, order, univariateBezier);\n // saturate and solve the bezier\n Bezier1dNd.saturate1dInPlace(univariateBezier.coffs, this._bcurve.knots, spanIndex);\n const roots = univariateBezier.roots(0.0, true);\n if (roots) {\n for (const spanFraction of roots) {\n // promote each local bezier fraction to global fraction and save the curve evaluation at that fraction\n numFound++;\n const fraction = this._bcurve.knots.spanFractionToFraction(spanIndex, spanFraction);\n if (!Geometry.isAlmostEqualNumber(fraction, previousFraction)) {\n const detail = CurveLocationDetail.createCurveEvaluatedFraction(this, fraction);\n detail.intervalRole = CurveIntervalRole.isolated;\n result.push(detail);\n previousFraction = fraction;\n }\n }\n }\n }\n }\n }\n }\n return numFound;\n }\n /**\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object.\n */\n public override constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): BSplineCurve3d | undefined {\n const options = OffsetOptions.create(offsetDistanceOrOptions);\n const handler = new CurveOffsetXYHandler(this, options.leftOffsetDistance);\n this.emitStrokableParts(handler, options.strokeOptions);\n return handler.claimResult();\n }\n /**\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters\n * of projection.\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\n * @param lowHigh optional receiver for output.\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\n * end of the ray.\n */\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\n }\n}\n/**\n * A BSplineCurve3d is a B-spline curve whose poles are Point3d.\n * See BSplineCurve3dBase for description of knots, order, degree, and poles.\n * @public\n */\nexport class BSplineCurve3d extends BSplineCurve3dBase {\n private _workBezier?: BezierCurve3d;\n private initializeWorkBezier(): BezierCurve3d {\n if (this._workBezier === undefined)\n this._workBezier = BezierCurve3d.createOrder(this.order);\n return this._workBezier;\n }\n private constructor(numPoles: number, order: number, knots: KnotVector) {\n super(3, numPoles, order, knots);\n }\n /** Test if `other` is an instance of BSplineCurve3d. */\n public isSameGeometryClass(other: any): boolean {\n return other instanceof BSplineCurve3d;\n }\n /** Apply `transform` to the poles. */\n public tryTransformInPlace(transform: Transform): boolean {\n Point3dArray.multiplyInPlace(transform, this._bcurve.packedData);\n return true;\n }\n /** Get a pole as a simple Point3d. */\n public getPolePoint3d(poleIndex: number, result?: Point3d): Point3d | undefined {\n const k = this.poleIndexToDataIndex(poleIndex);\n if (k !== undefined) {\n const data = this._bcurve.packedData;\n return Point3d.create(data[k], data[k + 1], data[k + 2], result);\n }\n return undefined;\n }\n /** Get a pole as Point4d with weight 1. */\n public getPolePoint4d(poleIndex: number, result?: Point4d): Point4d | undefined {\n const k = this.poleIndexToDataIndex(poleIndex);\n if (k !== undefined) {\n const data = this._bcurve.packedData;\n return Point4d.create(data[k], data[k + 1], data[k + 2], 1.0, result);\n }\n return undefined;\n }\n /**\n * Convert the fractional position in the given span to a knot.\n * * The returned value is not necessarily a knot, but it is a valid parameter in the domain of the B-spline curve.\n */\n public spanFractionToKnot(spanIndex: number, spanFraction: number): number {\n return this._bcurve.spanFractionToKnot(spanIndex, spanFraction);\n }\n /** Return a simple array of arrays with the poles as `[[x,y,z],[x,y,z],..]`. */\n public copyPoints(): any[] {\n return Point3dArray.unpackNumbersToNestedArrays(this._bcurve.packedData, 3);\n }\n /** Return a simple array of poles' coordinates. */\n public copyPointsFloat64Array(): Float64Array {\n return this._bcurve.packedData.slice();\n }\n /** Return a simple array form of the knots. Optionally replicate the first and last in classic over-clamped manner. */\n public override copyKnots(includeExtraEndKnot: boolean): number[] {\n return this._bcurve.knots.copyKnots(includeExtraEndKnot);\n }\n /** Create a B-spline with uniform knots. */\n public static createUniformKnots(\n poles: Point3d[] | Float64Array | GrowableXYZArray, order: number,\n ): BSplineCurve3d | undefined {\n const numPoles = poles instanceof Float64Array ? poles.length / 3 : poles.length;\n if (order < 2 || numPoles < order)\n return undefined;\n const knots = KnotVector.createUniformClamped(numPoles, order - 1, 0.0, 1.0);\n const curve = new BSplineCurve3d(numPoles, order, knots);\n if (poles instanceof Float64Array) {\n for (let i = 0; i < 3 * numPoles; i++)\n curve._bcurve.packedData[i] = poles[i];\n } else if (poles instanceof GrowableXYZArray) {\n curve._bcurve.packedData = poles.float64Data().slice(0, 3 * numPoles);\n } else {\n let i = 0;\n for (const p of poles) {\n curve._bcurve.packedData[i++] = p.x;\n curve._bcurve.packedData[i++] = p.y;\n curve._bcurve.packedData[i++] = p.z;\n }\n }\n return curve;\n }\n /**\n * Create a smoothly closed B-spline curve with uniform knots.\n * * Note that the curve does not start at the first pole.\n */\n public static createPeriodicUniformKnots(\n poles: Point3d[] | Float64Array | GrowableXYZArray, order: number,\n ): BSplineCurve3d | undefined {\n if (order < 2)\n return undefined;\n let numPoles = poles instanceof Float64Array ? poles.length / 3 : poles.length;\n if (numPoles < 2)\n return undefined;\n const startPoint = Point3d.createZero();\n const endPoint = Point3d.createZero();\n let hasClosurePoint = false;\n do {\n if (poles instanceof Float64Array) {\n startPoint.set(poles[0], poles[1], poles[2]);\n endPoint.set(poles[3 * numPoles - 3], poles[3 * numPoles - 2], poles[3 * numPoles - 1]);\n } else if (poles instanceof GrowableXYZArray) {\n poles.getPoint3dAtUncheckedPointIndex(0, startPoint);\n poles.getPoint3dAtUncheckedPointIndex(numPoles - 1, endPoint);\n } else {\n startPoint.setFromPoint3d(poles[0]);\n endPoint.setFromPoint3d(poles[numPoles - 1]);\n }\n if (hasClosurePoint = startPoint.isAlmostEqual(endPoint))\n --numPoles; // remove wraparound pole if found\n } while (hasClosurePoint && numPoles > 1);\n if (numPoles < order)\n return undefined;\n const degree = order - 1;\n const numIntervals = numPoles;\n const knots = KnotVector.createUniformWrapped(numIntervals, degree, 0.0, 1.0);\n knots.wrappable = BSplineWrapMode.OpenByAddingControlPoints;\n // append degree wraparound poles\n const curve = new BSplineCurve3d(numPoles + degree, order, knots);\n if (poles instanceof Float64Array) {\n let i = 0;\n for (let j = 0; j < 3 * numPoles; j++)\n curve._bcurve.packedData[i++] = poles[j];\n for (let j = 0; j < 3 * degree; j++)\n curve._bcurve.packedData[i++] = poles[j];\n } else if (poles instanceof GrowableXYZArray) {\n let i = 0;\n for (let j = 0; j < 3 * numPoles; j++)\n curve._bcurve.packedData[i++] = poles.float64Data()[j];\n for (let j = 0; j < 3 * degree; j++)\n curve._bcurve.packedData[i++] = poles.float64Data()[j];\n } else {\n let i = 0;\n for (let j = 0; j < numPoles; j++) {\n curve._bcurve.packedData[i++] = poles[j].x;\n curve._bcurve.packedData[i++] = poles[j].y;\n curve._bcurve.packedData[i++] = poles[j].z;\n }\n for (let j = 0; j < degree; j++) {\n curve._bcurve.packedData[i++] = poles[j].x;\n curve._bcurve.packedData[i++] = poles[j].y;\n curve._bcurve.packedData[i++] = poles[j].z;\n }\n }\n return curve;\n }\n /**\n * Create a C2 cubic B-spline curve that interpolates the given points and optional end tangents.\n * @param options collection of points and end conditions.\n */\n public static createFromInterpolationCurve3dOptions(options: InterpolationCurve3dOptions): BSplineCurve3d | undefined {\n return BSplineCurveOps.createThroughPointsC2Cubic(options);\n }\n /**\n * Create a B-spline curve from an Akima curve.\n * @param options collection of points and end conditions.\n */\n public static createFromAkimaCurve3dOptions(options: AkimaCurve3dOptions): BSplineCurve3d | undefined {\n return BSplineCurveOps.createThroughPoints(options.fitPoints, 4); // temporary\n }\n /**\n * Create a B-spline curve with given knots.\n * * The poles have several variants:\n * * Float64Array(3 * numPoles) in blocks of [x,y,z].\n * * Point3d[].\n * * number[][], with inner dimension 3.\n * * Two count conditions are recognized:\n * * If poleArray.length + order === knotArray.length, the first and last are assumed to be the extraneous knots\n * of classic clamping.\n * * If poleArray.length + order === knotArray.length + 2, the knots are in modern form.\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/BSpline/\n */\n public static create(\n poleArray: Float64Array | Point3d[] | number[][], knotArray: Float64Array | number[], order: number,\n ): BSplineCurve3d | undefined {\n if (order < 2)\n return undefined;\n let numPoles = poleArray.length;\n if (poleArray instanceof Float64Array)\n numPoles = Math.floor(numPoles / 3); // blocked as xyz\n if (numPoles < order)\n return undefined;\n const numKnots = knotArray.length;\n const skipFirstAndLast = (numPoles + order === numKnots); // classic over-clamped input knots\n if (!skipFirstAndLast && numPoles + order !== numKnots + 2) // modern knots\n return undefined;\n const knots = KnotVector.create(knotArray, order - 1, skipFirstAndLast);\n const curve = new BSplineCurve3d(numPoles, order, knots);\n let i = 0;\n if (poleArray instanceof Float64Array) {\n for (const coordinate of poleArray)\n curve._bcurve.packedData[i++] = coordinate;\n } else if (poleArray[0] instanceof Point3d) {\n for (const p of poleArray as Point3d[]) {\n curve._bcurve.packedData[i++] = p.x;\n curve._bcurve.packedData[i++] = p.y;\n curve._bcurve.packedData[i++] = p.z;\n }\n } else if (Array.isArray(poleArray[0]) && poleArray[0].length === 3) {\n for (const point of poleArray as number[][])\n for (const coord of point)\n curve._bcurve.packedData[i++] = coord;\n } else {\n return undefined; // unexpected poleArray type\n }\n return curve;\n }\n /** Return a deep clone. */\n public override clone(): BSplineCurve3d {\n const knotVector = this._bcurve.knots.clone();\n const curve = new BSplineCurve3d(this.numPoles, this.order, knotVector);\n curve._bcurve.packedData = this._bcurve.packedData.slice();\n return curve;\n }\n /** Evaluate the curve at a fractional position within a given span. */\n public evaluatePointInSpan(spanIndex: number, spanFraction: number, result?: Point3d): Point3d {\n this._bcurve.evaluateBuffersInSpan(spanIndex, spanFraction);\n return Point3d.createFrom(this._bcurve.poleBuffer, result);\n }\n /**\n * Evaluate the curve and derivative at a fractional position within a given span.\n * * The derivative is with respect to the span fractional parameter, _not_ to the curve's parameter or fractional parameter.\n */\n public evaluatePointAndDerivativeInSpan(spanIndex: number, spanFraction: number): Ray3d {\n this._bcurve.evaluateBuffersInSpan1(spanIndex, spanFraction);\n return Ray3d.createCapture(\n Point3d.createFrom(this._bcurve.poleBuffer),\n Vector3d.createFrom(this._bcurve.poleBuffer1),\n );\n }\n /**\n * Evaluate the curve at the given parameter.\n * @param u parameter in curve domain.\n * @param result optional result.\n * @returns the point on the curve.\n */\n public knotToPoint(u: number, result?: Point3d): Point3d {\n this._bcurve.evaluateBuffersAtKnot(u);\n return Point3d.createFrom(this._bcurve.poleBuffer, result);\n }\n /**\n * Evaluate the curve and derivative at the given parameter.\n * @param u parameter in curve domain.\n * @param result optional result.\n * @returns the ray with origin at the curve point and direction as the derivative.\n */\n public knotToPointAndDerivative(u: number, result?: Ray3d): Ray3d {\n this._bcurve.evaluateBuffersAtKnot(u, 1);\n if (!result)\n return Ray3d.createCapture(\n Point3d.createFrom(this._bcurve.poleBuffer),\n Vector3d.createFrom(this._bcurve.poleBuffer1),\n );\n result.origin.setFrom(this._bcurve.poleBuffer);\n result.direction.setFrom(this._bcurve.poleBuffer1);\n return result;\n }\n /**\n * Evaluate the curve and two derivatives at the given parameter.\n * @param u parameter in the curve domain.\n * @param result optional result.\n * @returns the plane with origin at the curve point, vectorU as the 1st derivative, and vectorV as the 2nd derivative.\n */\n public knotToPointAnd2Derivatives(u: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n this._bcurve.evaluateBuffersAtKnot(u, 2);\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\n this._bcurve.poleBuffer[0], this._bcurve.poleBuffer[1], this._bcurve.poleBuffer[2],\n this._bcurve.poleBuffer1[0], this._bcurve.poleBuffer1[1], this._bcurve.poleBuffer1[2],\n this._bcurve.poleBuffer2[0], this._bcurve.poleBuffer2[1], this._bcurve.poleBuffer2[2],\n result,\n );\n }\n /** Test if `this` is almost the same curve as `other`. */\n public override isAlmostEqual(other: any): boolean {\n if (other instanceof BSplineCurve3d) {\n return this._bcurve.knots.isAlmostEqual(other._bcurve.knots)\n && Point3dArray.isAlmostEqual(this._bcurve.packedData, other._bcurve.packedData);\n }\n return false;\n }\n /** Test if this curve lies entirely in the given plane. */\n public isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean {\n return Point3dArray.isCloseToPlane(this._bcurve.packedData, plane);\n }\n /**\n * Return the control polygon length as an approximation to the curve length.\n * * The returned length is always an overestimate.\n */\n public quickLength(): number {\n return Point3dArray.sumEdgeLengths(this._bcurve.packedData);\n }\n /** Emit Beziers or strokes (selected by the stroke options) to the handler. */\n public emitStrokableParts(handler: IStrokeHandler, options?: StrokeOptions): void {\n const workBezier = this.initializeWorkBezier();\n const numSpan = this.numSpan;\n let numStrokes;\n for (let spanIndex = 0; spanIndex < numSpan; spanIndex++) {\n const bezier = this.getSaturatedBezierSpan3dOr3dH(spanIndex, false, workBezier);\n if (bezier) {\n numStrokes = bezier.computeStrokeCountForOptions(options);\n if (handler.announceBezierCurve) {\n handler.announceBezierCurve(\n bezier,\n numStrokes,\n this,\n spanIndex,\n this._bcurve.knots.spanFractionToFraction(spanIndex, 0.0),\n this._bcurve.knots.spanFractionToFraction(spanIndex, 1.0),\n );\n\n } else {\n handler.announceIntervalForUniformStepStrokes(\n this,\n numStrokes,\n this._bcurve.knots.spanFractionToFraction(spanIndex, 0.0),\n this._bcurve.knots.spanFractionToFraction(spanIndex, 1.0),\n );\n }\n }\n }\n }\n /**\n * Assess length and turn to determine a stroke count.\n * @param options stroke options structure.\n */\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\n const workBezier = this.initializeWorkBezier();\n const numSpan = this.numSpan;\n let numStroke = 0;\n for (let spanIndex = 0; spanIndex < numSpan; spanIndex++) {\n const bezier = this.getSaturatedBezierSpan3d(spanIndex, workBezier);\n if (bezier)\n numStroke += bezier.computeStrokeCountForOptions(options);\n }\n return numStroke;\n }\n /**\n * Compute individual segment stroke counts. Attach in a StrokeCountMap.\n * @param options StrokeOptions that determine count\n * @param parentStrokeMap evolving parent map.\n * @alpha\n */\n public override computeAndAttachRecursiveStrokeCounts(options?: StrokeOptions, parentStrokeMap?: StrokeCountMap) {\n const workBezier = this.initializeWorkBezier();\n const numSpan = this.numSpan;\n const myData = StrokeCountMap.createWithCurvePrimitiveAndOptionalParent(this, parentStrokeMap, []);\n for (let spanIndex = 0; spanIndex < numSpan; spanIndex++) {\n const bezier = this.getSaturatedBezierSpan3d(spanIndex, workBezier);\n if (bezier) {\n const segmentLength = workBezier.curveLength();\n const numStrokeOnSegment = workBezier.computeStrokeCountForOptions(options);\n myData.addToCountAndLength(numStrokeOnSegment, segmentLength);\n }\n }\n CurvePrimitive.installStrokeCountMap(this, myData, parentStrokeMap);\n }\n /** Append strokes to the given linestring. */\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\n const workBezier = this.initializeWorkBezier();\n const numSpan = this.numSpan;\n for (let spanIndex = 0; spanIndex < numSpan; spanIndex++) {\n const bezier = this.getSaturatedBezierSpan3d(spanIndex, workBezier);\n if (bezier)\n bezier.emitStrokes(dest, options);\n }\n }\n /**\n * Test knots and poles to determine if it is possible to close (aka \"wrap\") the curve.\n * @returns the manner in which it is possible to close the curve. See `BSplineWrapMode` for particulars of each mode.\n */\n public get isClosable(): BSplineWrapMode {\n return this.isClosableCurve;\n }\n /**\n * Return the Bezier fragment corresponding to the given span of this curve.\n * * The concrete return type may be [[BezierCurve3d]] or [[BezierCurve3dH]] according to the instance type and `prefer3dH`.\n * @param spanIndex index of span.\n * @param result optional reusable curve. This will only be reused if its type and order matches.\n */\n public getSaturatedBezierSpan3dOr3dH(\n spanIndex: number, prefer3dH: boolean, result?: BezierCurveBase,\n ): BezierCurveBase | undefined {\n if (prefer3dH)\n return this.getSaturatedBezierSpan3dH(spanIndex, result);\n return this.getSaturatedBezierSpan3d(spanIndex, result);\n }\n /**\n * Return the Bezier fragment corresponding to the given span of this curve.\n * @param spanIndex index of span.\n * @param result optional reusable curve. This will only be reused if its type and order matches.\n */\n public getSaturatedBezierSpan3d(spanIndex: number, result?: BezierCurveBase): BezierCurve3d | undefined {\n if (spanIndex < 0 || spanIndex >= this.numSpan)\n return undefined;\n const order = this.order;\n if (result === undefined || !(result instanceof BezierCurve3d) || result.order !== order)\n result = BezierCurve3d.createOrder(order);\n const bezier = result as BezierCurve3d;\n bezier.loadSpanPoles(this._bcurve.packedData, spanIndex);\n if (bezier.saturateInPlace(this._bcurve.knots, spanIndex))\n return bezier;\n return undefined;\n }\n /**\n * Return the Bezier fragment corresponding to the given span of this curve.\n * @param spanIndex index of span.\n * @param result optional reusable curve. This will only be reused if its type and order matches.\n */\n public getSaturatedBezierSpan3dH(spanIndex: number, result?: BezierCurveBase): BezierCurve3dH | undefined {\n if (spanIndex < 0 || spanIndex >= this.numSpan)\n return undefined;\n const order = this.order;\n if (result === undefined || !(result instanceof BezierCurve3dH) || result.order !== order)\n result = BezierCurve3dH.createOrder(order);\n const bezier = result as BezierCurve3dH;\n bezier.loadSpan3dPolesWithWeight(this._bcurve.packedData, spanIndex, 1.0);\n if (bezier.saturateInPlace(this._bcurve.knots, spanIndex))\n return bezier;\n return undefined;\n }\n /** Second step of double dispatch: call `handler.handleBSplineCurve3d(this)`. */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleBSplineCurve3d(this);\n }\n /**\n * Extend a range so it contains the range of this curve.\n * * This computation is based on the poles, not the curve itself, so the returned range is generally larger than the\n * tightest possible range.\n * @param rangeToExtend range to extend.\n * @param transform transform to apply to the poles as they are entered into the range.\n */\n public extendRange(rangeToExtend: Range3d, transform?: Transform): void {\n const buffer = this._bcurve.packedData;\n const n = buffer.length - 2;\n if (transform) {\n for (let i0 = 0; i0 < n; i0 += 3)\n rangeToExtend.extendTransformedXYZ(transform, buffer[i0], buffer[i0 + 1], buffer[i0 + 2]);\n } else {\n for (let i0 = 0; i0 < n; i0 += 3)\n rangeToExtend.extendXYZ(buffer[i0], buffer[i0 + 1], buffer[i0 + 2]);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BSplineCurve.js","sourceRoot":"","sources":["../../../src/bspline/BSplineCurve.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,sEAAsF;AACtF,4DAAyD;AACzD,yFAAsF;AACtF,mGAAgG;AAEhG,0DAAuD;AACvD,kEAA+D;AAE/D,0CAA+D;AAE/D,qEAAkE;AAElE,uFAAoF;AACpF,mEAAkE;AAClE,6DAA0D;AAC1D,+CAAuD;AACvD,+CAA4C;AAE5C,mDAAgD;AAChD,qEAAiE;AAEjE,6CAA0C;AAC1C,mDAAgD;AAChD,qDAAkD;AAElD,+CAA4C;AAC5C,uDAAoD;AAEpD,6CAA2D;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,MAAsB,kBAAmB,SAAQ,+BAAc;IAC7D,yCAAyC;IACzB,kBAAkB,GAAG,cAAc,CAAC;IACpD,mEAAmE;IACzD,OAAO,CAAc;IACvB,eAAe,CAAO;IAC9B,IAAW,cAAc,CAAC,IAAS;QACjC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC;IACD,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IACD,YAAsB,aAAqB,EAAE,QAAgB,EAAE,KAAa,EAAE,KAAiB;QAC7F,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,yBAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC3E,CAAC;IACD,gEAAgE;IAChE,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IAC7B,CAAC;IACD,4DAA4D;IAC5D,IAAW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,MAAwB,CAAC;QACxC,MAAM,CAAC,yBAAyB,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;QAC1E,IAAI,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC;YACvD,OAAO,MAAM,CAAC;QAChB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,iFAAiF;IAC1E,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IACD;;;;;;OAMG;IACI,WAAW,CAAC,aAAsB,EAAE,SAAqB;QAC9D,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;QACvC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QAC5B,IAAI,SAAS,EAAE,CAAC;YACd,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC;gBAC9B,aAAa,CAAC,oBAAoB,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9F,CAAC;aAAM,CAAC;YACN,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC;gBAC9B,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;CACF;AAxbD,wCAwbC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Bspline\n */\n\nimport { VariantCurveExtendParameter } from \"../curve/CurveExtendMode\";\nimport { CurveIntervalRole, CurveLocationDetail } from \"../curve/CurveLocationDetail\";\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { CurveOffsetXYHandler } from \"../curve/internalContexts/CurveOffsetXYHandler\";\nimport { PlaneAltitudeRangeContext } from \"../curve/internalContexts/PlaneAltitudeRangeContext\";\nimport { LineString3d } from \"../curve/LineString3d\";\nimport { OffsetOptions } from \"../curve/OffsetOptions\";\nimport { StrokeCountMap } from \"../curve/Query/StrokeCountMap\";\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\nimport { Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { GeometryHandler, IStrokeHandler } from \"../geometry3d/GeometryHandler\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Point3dArray } from \"../geometry3d/PointHelpers\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { Point4d } from \"../geometry4d/Point4d\";\nimport { UnivariateBezier } from \"../numerics/BezierPolynomials\";\nimport { AkimaCurve3dOptions } from \"./AkimaCurve3d\";\nimport { Bezier1dNd } from \"./Bezier1dNd\";\nimport { BezierCurve3d } from \"./BezierCurve3d\";\nimport { BezierCurve3dH } from \"./BezierCurve3dH\";\nimport { BezierCurveBase } from \"./BezierCurveBase\";\nimport { BSpline1dNd } from \"./BSpline1dNd\";\nimport { BSplineCurveOps } from \"./BSplineCurveOps\";\nimport { InterpolationCurve3dOptions } from \"./InterpolationCurve3d\";\nimport { BSplineWrapMode, KnotVector } from \"./KnotVector\";\n\n/**\n * Base class for BSplineCurve3d and BSplineCurve3dH.\n * * A B-spline curve consists of an array of `knots`, an array of `poles`, and a `degree`.\n * * The knot array is a non-decreasing sequence of numbers. It is also called a \"knot vector\".\n * * The curve is a parametric function whose domain is a sub-range of its knots.\n * * The API sometimes refers to a domain parameter `u` as a \"knot\", even if `u` is not actually an entry in the\n * knot array.\n * * The curve loosely \"follows\" the line string formed by the poles, aka the \"control polygon\".\n * * The curve is a chain of polynomial segments, aka \"spans\" or \"fragments\". B-spline theory identifies these as\n * Bezier curves.\n * * The polynomial spans all have same `degree`.\n * * Each span is controlled by `order = degree + 1` contiguous points in the pole array.\n * * There is a strict relationship between knot and poles counts: `numPoles + order = numKnots + 2'.\n * * The number of spans is `numSpan = numPoles - degree`.\n * * For a span with index `spanIndex`:\n * * The `order` relevant poles begin at pole index `spanIndex`.\n * * The `2*degree` relevant knots begin at knot index `spanIndex`.\n * * The span domain is the knot range `[knot[spanIndex+degree-1], knot[spanIndex+degree]]`.\n * * The curve domain is the knot range `[knot[degree-1], knot[numSpan+degree-1]]`, or equivalently\n * `[knot[degree-1], knot[numPoles-1]]`. The API refers to this domain as the \"active knot interval\" of the curve.\n *\n * Nearly all B-spline curves are \"clamped\".\n * * This means that in the `knots` array, the first `degree` knots are equal, and the last `degree` knots are equal.\n * We say the smallest knot and the largest knot have multiplicity `degree`.\n * * Clamping make the curve pass through its first and last poles, with tangents directed along the first and\n * last edges of the control polygon.\n * * For instance, a cubic B-spline curve with knot vector `[0,0,0,1,2,3,3,3]`\n * * can be evaluated at parameter values in the range `[0, 3]`\n * * has 3 spans, with domains `[0, 1]`, `[1, 2]`, and `[2, 3]`\n * * has 6 poles\n * * passes through its first and last poles.\n * * The `create` methods may allow the classic convention that has an extra knot at the beginning and end of the\n * knot vector.\n * * These two extra knots are not actually needed to define the B-spline curve.\n * * When the `create` methods recognize the classic setup (`numPoles + order = numKnots`), the extra knots are\n * not saved with the BSplineCurve3dBase knots.\n *\n * * The weighted variant [[BSplineCurve3dH]] has the problem that `CurvePrimitive` 3D typing does not allow the\n * undefined result where a homogeneous pole has zero weight; the convention in this case is to return 000.\n *\n * * Note the class relationships:\n * * [[BSpline1dNd]] knows the definitional B-spline recurrence relation with no physical interpretation for the poles.\n * * BsplineCurve3dBase owns a protected BSpline1dNd.\n * * `BsplineCurve3dBase` is derived from [[CurvePrimitive]], which creates obligation to act as a 3D curve, e.g.,\n * * evaluate fraction to point and derivatives wrt fraction.\n * * compute intersection with plane.\n * * [[BSplineCurve3d]] and [[BSplineCurve3dH]] have variant logic driven by whether or not there are \"weights\" on the poles.\n * * For `BSplineCurve3d`, the xyz value of pole calculations are \"final\" values for 3d evaluation.\n * * For `BSplineCurve3dH`, various `BSpline1dNd` results with xyzw have to be normalized back to xyz.\n *\n * * These classes do not support \"periodic\" variants.\n * * Periodic curves historically have carried a flag (e.g., \"closed\") indicating that certain un-stored\n * leading/trailing knots and poles are understood to wrap around periodically.\n * * Instead, these classes carry no such flag. They represent such curves with explicitly wrapped knots/poles.\n *\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/BSpline/\n * @public\n */\nexport abstract class BSplineCurve3dBase extends CurvePrimitive {\n /** String name for schema properties. */\n public readonly curvePrimitiveType = \"bsplineCurve\";\n /** The underlying blocked-pole spline, with simple x,y,z poles. */\n protected _bcurve: BSpline1dNd;\n private _definitionData?: any;\n public set definitionData(data: any) {\n this._definitionData = data;\n }\n public get definitionData(): any {\n return this._definitionData;\n }\n protected constructor(poleDimension: number, numPoles: number, order: number, knots: KnotVector) {\n super();\n this._bcurve = BSpline1dNd.create(numPoles, poleDimension, order, knots);\n }\n /** Return the degree (one less than the order) of the curve. */\n public get degree(): number {\n return this._bcurve.degree;\n }\n /** Return the order (one more than degree) of the curve. */\n public get order(): number {\n return this._bcurve.order;\n }\n /**\n * Return the number of Bezier spans in the curve. Note that this number includes the number of null\n * spans at repeated knots.\n */\n public get numSpan(): number {\n return this._bcurve.numSpan;\n }\n /** Return the number of poles. */\n public get numPoles(): number {\n return this._bcurve.numPoles;\n }\n /** Return live reference to the poles of the curve. */\n public get polesRef(): Float64Array {\n return this._bcurve.packedData;\n }\n /** Return live reference to the knots of the curve. */\n public get knotsRef(): Float64Array {\n return this._bcurve.knots.knots;\n }\n /**\n * Number of components per pole, e.g.,\n * * 3 for conventional (x,y,z) curve.\n * * 4 for weighted (wx,wy,wz,w) curve.\n */\n public get poleDimension(): number {\n return this._bcurve.poleLength;\n }\n /** Return a simple array form of the knots. Optionally replicate the first and last in classic over-clamped manner. */\n public copyKnots(includeExtraEndKnot: boolean): number[] {\n return this._bcurve.knots.copyKnots(includeExtraEndKnot);\n }\n /** Get the flag indicating the curve might be suitable for having wrapped \"closed\" interpretation. */\n public getWrappable(): BSplineWrapMode {\n return this._bcurve.knots.wrappable;\n }\n /** Set the flag indicating the curve might be suitable for having wrapped \"closed\" interpretation. */\n public setWrappable(value: BSplineWrapMode) {\n this._bcurve.knots.wrappable = value;\n }\n /**\n * Test knots and poles to determine if it is possible to close (aka \"wrap\") the curve.\n * @returns the manner in which it is possible to close the curve. See `BSplineWrapMode` for particulars of each mode.\n */\n public get isClosableCurve(): BSplineWrapMode {\n const mode = this._bcurve.knots.wrappable;\n if (mode === BSplineWrapMode.None)\n return BSplineWrapMode.None;\n if (!this._bcurve.knots.testClosable(mode))\n return BSplineWrapMode.None;\n if (!this._bcurve.testClosablePolygon(mode))\n return BSplineWrapMode.None;\n return mode;\n }\n /** Evaluate the curve at a fractional position within a given span. */\n public abstract evaluatePointInSpan(spanIndex: number, spanFraction: number, result?: Point3d): Point3d;\n /**\n * Evaluate the curve and derivative at a fractional position within a given span.\n * * The derivative is with respect to the span fractional parameter, _not_ to the curve's parameter or fractional parameter.\n */\n public abstract evaluatePointAndDerivativeInSpan(spanIndex: number, spanFraction: number, result?: Ray3d): Ray3d;\n /** Evaluate the curve at the given parameter. */\n public abstract knotToPoint(knot: number, result?: Point3d): Point3d;\n /** Evaluate the curve and derivative at the given parameter. */\n public abstract knotToPointAndDerivative(knot: number, result?: Ray3d): Ray3d;\n /** Evaluate the curve and two derivatives at the given parameter. */\n public abstract knotToPointAnd2Derivatives(knot: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors;\n /** Evaluate the curve point at the given fractional parameter. */\n public fractionToPoint(fraction: number, result?: Point3d): Point3d {\n return this.knotToPoint(this._bcurve.knots.fractionToKnot(fraction), result);\n }\n /** Evaluate the curve and derivative at the given fractional parameter. */\n public fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d {\n const knot = this._bcurve.knots.fractionToKnot(fraction);\n result = this.knotToPointAndDerivative(knot, result);\n result.direction.scaleInPlace(this._bcurve.knots.knotLength01);\n return result;\n }\n /** Evaluate the curve and two derivatives at the given fractional parameter. */\n public fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n const knot = this._bcurve.knots.fractionToKnot(fraction);\n result = this.knotToPointAnd2Derivatives(knot, result);\n const a = this._bcurve.knots.knotLength01;\n result.vectorU.scaleInPlace(a);\n result.vectorV.scaleInPlace(a * a);\n return result;\n }\n /** Return the start point of the curve. */\n public override startPoint(result?: Point3d): Point3d {\n return this.evaluatePointInSpan(0, 0.0, result);\n }\n /** Return the end point of the curve. */\n public override endPoint(result?: Point3d): Point3d {\n return this.evaluatePointInSpan(this.numSpan - 1, 1.0, result);\n }\n /**\n * Reverse the curve in place.\n * * Poles are reversed.\n * * Knot values are mirrored around the middle of the knot array.\n */\n public reverseInPlace(): void {\n this._bcurve.reverseInPlace();\n }\n /** Return an array with this curve's Bezier fragments. */\n public collectBezierSpans(prefer3dH: boolean): BezierCurveBase[] {\n const result: BezierCurveBase[] = [];\n const numSpans = this.numSpan;\n for (let i = 0; i < numSpans; i++) {\n if (this._bcurve.knots.isIndexOfRealSpan(i)) {\n const span = this.getSaturatedBezierSpan3dOr3dH(i, prefer3dH);\n if (span)\n result.push(span);\n }\n }\n return result;\n }\n /**\n * Return the Bezier fragment corresponding to the given span of this curve.\n * * The concrete return type may be [[BezierCurve3d]] or [[BezierCurve3dH]] according to the instance type and `prefer3dH`.\n * @param spanIndex index of span.\n * @param prefer3dH true to force promotion to homogeneous.\n * @param result optional reusable curve. This will only be reused if its type and order matches.\n */\n public abstract getSaturatedBezierSpan3dOr3dH(\n spanIndex: number, prefer3dH: boolean, result?: BezierCurveBase,\n ): BezierCurveBase | undefined;\n /**\n * Return a specified pole as a Point4d.\n * * BSplineCurve3d appends weight 1 to its xyz.\n * * BSplineCurve3dH with pole whose \"normalized\" point is (x,y,z) but has weight w returns the weighted form (wx,wy,wz,w).\n */\n public abstract getPolePoint4d(poleIndex: number, result?: Point4d): Point4d | undefined;\n /**\n * Return a specified pole as a Point3d.\n * * BSplineCurve3d returns its simple xyz.\n * * BSplineCurve3dH attempts to normalize its (wx,wy,wz,w) back to (x,y,z), and returns undefined if weight is zero.\n * @param poleIndex index of the pole.\n * @param result optional result.\n */\n public abstract getPolePoint3d(poleIndex: number, result?: Point3d): Point3d | undefined;\n /** Given a pole index, return the starting index for the contiguous array. */\n public poleIndexToDataIndex(poleIndex: number): number | undefined {\n if (poleIndex >= 0 && poleIndex < this.numPoles)\n return poleIndex * this._bcurve.poleLength;\n return undefined;\n }\n /**\n * Search for the curve point that is closest to the spacePoint.\n * * If the space point is exactly on the curve, this is the reverse of fractionToPoint.\n * * Since CurvePrimitive should always have start and end available as candidate points, this method should always\n * succeed.\n * @param spacePoint point in space.\n * @param _extend ignored (pass false). A BSplineCurve3dBase cannot be extended.\n * @param result optional pre-allocated detail to populate and return.\n * @returns details of the closest point.\n */\n public override closestPoint(\n spacePoint: Point3d, _extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\n ): CurveLocationDetail | undefined {\n // seed at start point; final point comes with final bezier perpendicular step\n const point = this.fractionToPoint(0);\n result = CurveLocationDetail.createCurveFractionPointDistance(this, 0.0, point, point.distance(spacePoint), result);\n let span: BezierCurve3dH | undefined;\n const numSpans = this.numSpan;\n for (let i = 0; i < numSpans; i++) {\n if (this._bcurve.knots.isIndexOfRealSpan(i)) {\n span = this.getSaturatedBezierSpan3dOr3dH(i, true, span) as BezierCurve3dH;\n if (span) {\n // if the B-spline is discontinuous, both ends should be tested; ignore that possibility\n if (span.updateClosestPointByTruePerpendicular(spacePoint, result, false, true)) {\n // the detail records the span bezier; promote it to the parent curve\n result.curve = this;\n result.fraction = span.fractionToParentFraction(result.fraction);\n }\n }\n }\n }\n return result;\n }\n /** Return a deep clone. */\n public abstract override clone(): BSplineCurve3dBase;\n /** Return a transformed deep clone. */\n public override cloneTransformed(transform: Transform): BSplineCurve3dBase {\n const curve = this.clone();\n curve.tryTransformInPlace(transform);\n return curve;\n }\n /**\n * Return a curve primitive which is a portion of this curve.\n * @param fractionA start fraction.\n * @param fractionB end fraction.\n */\n public override clonePartialCurve(fractionA: number, fractionB: number): BSplineCurve3dBase {\n let clone: BSplineCurve3dBase;\n if (fractionA > fractionB) {\n clone = this.clonePartialCurve(fractionB, fractionA);\n clone.reverseInPlace();\n return clone;\n }\n clone = this.clone();\n const origNumKnots = clone._bcurve.knots.knots.length;\n let knotA = clone._bcurve.knots.fractionToKnot(fractionA);\n let knotB = clone._bcurve.knots.fractionToKnot(fractionB);\n clone._bcurve.addKnot(knotA, clone.degree);\n clone._bcurve.addKnot(knotB, clone.degree);\n if (origNumKnots === clone._bcurve.knots.knots.length)\n return clone; // full curve\n if (knotA > knotB)\n [knotA, knotB] = [knotB, knotA];\n // choose first/last knot and pole such that knotA/knotB has degree multiplicity in the new knot sequence\n const iStartKnot = clone._bcurve.knots.knotToLeftKnotIndex(knotA) - clone.degree + 1;\n const iStartPole = iStartKnot * clone._bcurve.poleLength;\n const iLastKnot = clone._bcurve.knots.knotToLeftKnotIndex(knotB);\n let iLastKnotLeftMultiple = iLastKnot - clone._bcurve.knots.getKnotMultiplicityAtIndex(iLastKnot) + 1;\n if (clone._bcurve.knots.knots[iLastKnot] < knotB)\n iLastKnotLeftMultiple = iLastKnot + 1;\n const iEndPole = (iLastKnotLeftMultiple + 1) * clone._bcurve.poleLength; // one past last pole\n const iEndKnot = iLastKnotLeftMultiple + clone.degree; // one past last knot\n // trim the arrays (leave knots unnormalized)\n clone._bcurve.knots.setKnotsCapture(clone._bcurve.knots.knots.slice(iStartKnot, iEndKnot));\n clone._bcurve.packedData = clone._bcurve.packedData.slice(iStartPole, iEndPole);\n clone.setWrappable(BSplineWrapMode.None); // always open\n return clone;\n }\n /**\n * Implement `CurvePrimitive.appendPlaneIntersections` to compute intersections of the curve with a plane.\n * @param plane the plane with which to intersect the curve. Concrete types include [[Plane3dByOriginAndUnitNormal]],\n * [[Point4d]], etc.\n * @param result growing array of plane intersections.\n * @return number of intersections appended to the array.\n */\n public override appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number {\n const numPole = this.numPoles;\n const order = this.order;\n const allCoffs = new Float64Array(numPole);\n const numSpan = this.numSpan;\n const point4d = Point4d.create();\n // compute all pole altitudes from the plane\n const minMax = Range1d.createNull();\n // put the altitudes of all the B-spline poles in one array\n for (let i = 0; i < numPole; i++) {\n this.getPolePoint4d(i, point4d);\n allCoffs[i] = plane.weightedAltitude(point4d);\n minMax.extendX(allCoffs[i]);\n }\n // A univariate B-spline through the altitude poles gives altitude as function of the B-spline knot.\n // The (bspline) altitude function for each span is `order` consecutive altitudes.\n // If those altitudes bracket zero, the span may potentially have a crossing.\n let univariateBezier: UnivariateBezier | undefined;\n let numFound = 0;\n let previousFraction = -1000.0;\n if (minMax.containsX(0.0)) {\n for (let spanIndex = 0; spanIndex < numSpan; spanIndex++) {\n if (this._bcurve.knots.isIndexOfRealSpan(spanIndex)) { // ignore trivial knot intervals\n // outer range test ...\n minMax.setNull();\n minMax.extendArraySubset(allCoffs, spanIndex, order);\n if (minMax.containsX(0.0)) {\n // pack the B-spline support into a univariate bezier\n univariateBezier = UnivariateBezier.createArraySubset(allCoffs, spanIndex, order, univariateBezier);\n // saturate and solve the bezier\n Bezier1dNd.saturate1dInPlace(univariateBezier.coffs, this._bcurve.knots, spanIndex);\n const roots = univariateBezier.roots(0.0, true);\n if (roots) {\n for (const spanFraction of roots) {\n // promote each local bezier fraction to global fraction and save the curve evaluation at that fraction\n numFound++;\n const fraction = this._bcurve.knots.spanFractionToFraction(spanIndex, spanFraction);\n if (!Geometry.isAlmostEqualNumber(fraction, previousFraction)) {\n const detail = CurveLocationDetail.createCurveEvaluatedFraction(this, fraction);\n detail.intervalRole = CurveIntervalRole.isolated;\n result.push(detail);\n previousFraction = fraction;\n }\n }\n }\n }\n }\n }\n }\n return numFound;\n }\n /**\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object.\n */\n public override constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): BSplineCurve3d | undefined {\n const options = OffsetOptions.create(offsetDistanceOrOptions);\n const handler = new CurveOffsetXYHandler(this, options.leftOffsetDistance);\n this.emitStrokableParts(handler, options.strokeOptions);\n return handler.claimResult();\n }\n /**\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters\n * of projection.\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\n * @param lowHigh optional receiver for output.\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\n * end of the ray.\n */\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\n }\n}\n/**\n * A BSplineCurve3d is a B-spline curve whose poles are Point3d.\n * See BSplineCurve3dBase for description of knots, order, degree, and poles.\n * @public\n */\nexport class BSplineCurve3d extends BSplineCurve3dBase {\n private _workBezier?: BezierCurve3d;\n private initializeWorkBezier(): BezierCurve3d {\n if (this._workBezier === undefined)\n this._workBezier = BezierCurve3d.createOrder(this.order);\n return this._workBezier;\n }\n private constructor(numPoles: number, order: number, knots: KnotVector) {\n super(3, numPoles, order, knots);\n }\n /** Test if `other` is an instance of BSplineCurve3d. */\n public isSameGeometryClass(other: any): boolean {\n return other instanceof BSplineCurve3d;\n }\n /** Apply `transform` to the poles. */\n public tryTransformInPlace(transform: Transform): boolean {\n Point3dArray.multiplyInPlace(transform, this._bcurve.packedData);\n return true;\n }\n /** Get a pole as a simple Point3d. */\n public getPolePoint3d(poleIndex: number, result?: Point3d): Point3d | undefined {\n const k = this.poleIndexToDataIndex(poleIndex);\n if (k !== undefined) {\n const data = this._bcurve.packedData;\n return Point3d.create(data[k], data[k + 1], data[k + 2], result);\n }\n return undefined;\n }\n /** Get a pole as Point4d with weight 1. */\n public getPolePoint4d(poleIndex: number, result?: Point4d): Point4d | undefined {\n const k = this.poleIndexToDataIndex(poleIndex);\n if (k !== undefined) {\n const data = this._bcurve.packedData;\n return Point4d.create(data[k], data[k + 1], data[k + 2], 1.0, result);\n }\n return undefined;\n }\n /**\n * Convert the fractional position in the given span to a knot.\n * * The returned value is not necessarily a knot, but it is a valid parameter in the domain of the B-spline curve.\n */\n public spanFractionToKnot(spanIndex: number, spanFraction: number): number {\n return this._bcurve.spanFractionToKnot(spanIndex, spanFraction);\n }\n /** Return a simple array of arrays with the poles as `[[x,y,z],[x,y,z],..]`. */\n public copyPoints(): any[] {\n return Point3dArray.unpackNumbersToNestedArrays(this._bcurve.packedData, 3);\n }\n /** Return a simple array of poles' coordinates. */\n public copyPointsFloat64Array(): Float64Array {\n return this._bcurve.packedData.slice();\n }\n /** Return a simple array form of the knots. Optionally replicate the first and last in classic over-clamped manner. */\n public override copyKnots(includeExtraEndKnot: boolean): number[] {\n return this._bcurve.knots.copyKnots(includeExtraEndKnot);\n }\n /** Create a B-spline with uniform knots. */\n public static createUniformKnots(\n poles: Point3d[] | Float64Array | GrowableXYZArray, order: number,\n ): BSplineCurve3d | undefined {\n const numPoles = poles instanceof Float64Array ? poles.length / 3 : poles.length;\n if (order < 2 || numPoles < order)\n return undefined;\n const knots = KnotVector.createUniformClamped(numPoles, order - 1, 0.0, 1.0);\n const curve = new BSplineCurve3d(numPoles, order, knots);\n if (poles instanceof Float64Array) {\n for (let i = 0; i < 3 * numPoles; i++)\n curve._bcurve.packedData[i] = poles[i];\n } else if (poles instanceof GrowableXYZArray) {\n curve._bcurve.packedData = poles.float64Data().slice(0, 3 * numPoles);\n } else {\n let i = 0;\n for (const p of poles) {\n curve._bcurve.packedData[i++] = p.x;\n curve._bcurve.packedData[i++] = p.y;\n curve._bcurve.packedData[i++] = p.z;\n }\n }\n return curve;\n }\n /**\n * Create a smoothly closed B-spline curve with uniform knots.\n * * Note that the curve does not start at the first pole.\n */\n public static createPeriodicUniformKnots(\n poles: Point3d[] | Float64Array | GrowableXYZArray, order: number,\n ): BSplineCurve3d | undefined {\n if (order < 2)\n return undefined;\n let numPoles = poles instanceof Float64Array ? poles.length / 3 : poles.length;\n if (numPoles < 2)\n return undefined;\n const startPoint = Point3d.createZero();\n const endPoint = Point3d.createZero();\n let hasClosurePoint = false;\n do {\n if (poles instanceof Float64Array) {\n startPoint.set(poles[0], poles[1], poles[2]);\n endPoint.set(poles[3 * numPoles - 3], poles[3 * numPoles - 2], poles[3 * numPoles - 1]);\n } else if (poles instanceof GrowableXYZArray) {\n poles.getPoint3dAtUncheckedPointIndex(0, startPoint);\n poles.getPoint3dAtUncheckedPointIndex(numPoles - 1, endPoint);\n } else {\n startPoint.setFromPoint3d(poles[0]);\n endPoint.setFromPoint3d(poles[numPoles - 1]);\n }\n if (hasClosurePoint = startPoint.isAlmostEqual(endPoint))\n --numPoles; // remove wraparound pole if found\n } while (hasClosurePoint && numPoles > 1);\n if (numPoles < order)\n return undefined;\n const degree = order - 1;\n const numIntervals = numPoles;\n const knots = KnotVector.createUniformWrapped(numIntervals, degree, 0.0, 1.0);\n knots.wrappable = BSplineWrapMode.OpenByAddingControlPoints;\n // append degree wraparound poles\n const curve = new BSplineCurve3d(numPoles + degree, order, knots);\n if (poles instanceof Float64Array) {\n let i = 0;\n for (let j = 0; j < 3 * numPoles; j++)\n curve._bcurve.packedData[i++] = poles[j];\n for (let j = 0; j < 3 * degree; j++)\n curve._bcurve.packedData[i++] = poles[j];\n } else if (poles instanceof GrowableXYZArray) {\n let i = 0;\n for (let j = 0; j < 3 * numPoles; j++)\n curve._bcurve.packedData[i++] = poles.float64Data()[j];\n for (let j = 0; j < 3 * degree; j++)\n curve._bcurve.packedData[i++] = poles.float64Data()[j];\n } else {\n let i = 0;\n for (let j = 0; j < numPoles; j++) {\n curve._bcurve.packedData[i++] = poles[j].x;\n curve._bcurve.packedData[i++] = poles[j].y;\n curve._bcurve.packedData[i++] = poles[j].z;\n }\n for (let j = 0; j < degree; j++) {\n curve._bcurve.packedData[i++] = poles[j].x;\n curve._bcurve.packedData[i++] = poles[j].y;\n curve._bcurve.packedData[i++] = poles[j].z;\n }\n }\n return curve;\n }\n /**\n * Create a C2 cubic B-spline curve that interpolates the given points and optional end tangents.\n * @param options collection of points and end conditions.\n */\n public static createFromInterpolationCurve3dOptions(options: InterpolationCurve3dOptions): BSplineCurve3d | undefined {\n return BSplineCurveOps.createThroughPointsC2Cubic(options);\n }\n /**\n * Create a B-spline curve from an Akima curve.\n * @param options collection of points and end conditions.\n */\n public static createFromAkimaCurve3dOptions(options: AkimaCurve3dOptions): BSplineCurve3d | undefined {\n return BSplineCurveOps.createThroughPoints(options.fitPoints, 4); // temporary\n }\n /**\n * Create a B-spline curve with given knots.\n * * The poles have several variants:\n * * Float64Array(3 * numPoles) in blocks of [x,y,z].\n * * Point3d[].\n * * number[][], with inner dimension 3.\n * * Two count conditions are recognized:\n * * If poleArray.length + order === knotArray.length, the first and last are assumed to be the extraneous knots\n * of classic clamping.\n * * If poleArray.length + order === knotArray.length + 2, the knots are in modern form.\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/BSpline/\n */\n public static create(\n poleArray: Float64Array | Point3d[] | number[][], knotArray: Float64Array | number[], order: number,\n ): BSplineCurve3d | undefined {\n if (order < 2)\n return undefined;\n let numPoles = poleArray.length;\n if (poleArray instanceof Float64Array)\n numPoles = Math.floor(numPoles / 3); // blocked as xyz\n if (numPoles < order)\n return undefined;\n const numKnots = knotArray.length;\n const skipFirstAndLast = (numPoles + order === numKnots); // classic over-clamped input knots\n if (!skipFirstAndLast && numPoles + order !== numKnots + 2) // modern knots\n return undefined;\n const knots = KnotVector.create(knotArray, order - 1, skipFirstAndLast);\n const curve = new BSplineCurve3d(numPoles, order, knots);\n let i = 0;\n if (poleArray instanceof Float64Array) {\n for (const coordinate of poleArray)\n curve._bcurve.packedData[i++] = coordinate;\n } else if (poleArray[0] instanceof Point3d) {\n for (const p of poleArray as Point3d[]) {\n curve._bcurve.packedData[i++] = p.x;\n curve._bcurve.packedData[i++] = p.y;\n curve._bcurve.packedData[i++] = p.z;\n }\n } else if (Array.isArray(poleArray[0]) && poleArray[0].length === 3) {\n for (const point of poleArray as number[][])\n for (const coord of point)\n curve._bcurve.packedData[i++] = coord;\n } else {\n return undefined; // unexpected poleArray type\n }\n return curve;\n }\n /** Return a deep clone. */\n public override clone(): BSplineCurve3d {\n const knotVector = this._bcurve.knots.clone();\n const curve = new BSplineCurve3d(this.numPoles, this.order, knotVector);\n curve._bcurve.packedData = this._bcurve.packedData.slice();\n return curve;\n }\n /** Evaluate the curve at a fractional position within a given span. */\n public evaluatePointInSpan(spanIndex: number, spanFraction: number, result?: Point3d): Point3d {\n this._bcurve.evaluateBuffersInSpan(spanIndex, spanFraction);\n return Point3d.createFrom(this._bcurve.poleBuffer, result);\n }\n /**\n * Evaluate the curve and derivative at a fractional position within a given span.\n * * The derivative is with respect to the span fractional parameter, _not_ to the curve's parameter or fractional parameter.\n */\n public evaluatePointAndDerivativeInSpan(spanIndex: number, spanFraction: number): Ray3d {\n this._bcurve.evaluateBuffersInSpan1(spanIndex, spanFraction);\n return Ray3d.createCapture(\n Point3d.createFrom(this._bcurve.poleBuffer),\n Vector3d.createFrom(this._bcurve.poleBuffer1),\n );\n }\n /**\n * Evaluate the curve at the given parameter.\n * @param u parameter in curve domain.\n * @param result optional result.\n * @returns the point on the curve.\n */\n public knotToPoint(u: number, result?: Point3d): Point3d {\n this._bcurve.evaluateBuffersAtKnot(u);\n return Point3d.createFrom(this._bcurve.poleBuffer, result);\n }\n /**\n * Evaluate the curve and derivative at the given parameter.\n * @param u parameter in curve domain.\n * @param result optional result.\n * @returns the ray with origin at the curve point and direction as the derivative.\n */\n public knotToPointAndDerivative(u: number, result?: Ray3d): Ray3d {\n this._bcurve.evaluateBuffersAtKnot(u, 1);\n if (!result)\n return Ray3d.createCapture(\n Point3d.createFrom(this._bcurve.poleBuffer),\n Vector3d.createFrom(this._bcurve.poleBuffer1),\n );\n result.origin.setFrom(this._bcurve.poleBuffer);\n result.direction.setFrom(this._bcurve.poleBuffer1);\n return result;\n }\n /**\n * Evaluate the curve and two derivatives at the given parameter.\n * @param u parameter in the curve domain.\n * @param result optional result.\n * @returns the plane with origin at the curve point, vectorU as the 1st derivative, and vectorV as the 2nd derivative.\n */\n public knotToPointAnd2Derivatives(u: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n this._bcurve.evaluateBuffersAtKnot(u, 2);\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\n this._bcurve.poleBuffer[0], this._bcurve.poleBuffer[1], this._bcurve.poleBuffer[2],\n this._bcurve.poleBuffer1[0], this._bcurve.poleBuffer1[1], this._bcurve.poleBuffer1[2],\n this._bcurve.poleBuffer2[0], this._bcurve.poleBuffer2[1], this._bcurve.poleBuffer2[2],\n result,\n );\n }\n /** Test if `this` is almost the same curve as `other`. */\n public override isAlmostEqual(other: any): boolean {\n if (other instanceof BSplineCurve3d) {\n return this._bcurve.knots.isAlmostEqual(other._bcurve.knots)\n && Point3dArray.isAlmostEqual(this._bcurve.packedData, other._bcurve.packedData);\n }\n return false;\n }\n /** Test if this curve lies entirely in the given plane. */\n public isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean {\n return Point3dArray.isCloseToPlane(this._bcurve.packedData, plane);\n }\n /**\n * Return the control polygon length as an approximation to the curve length.\n * * The returned length is always an overestimate.\n */\n public quickLength(): number {\n return Point3dArray.sumEdgeLengths(this._bcurve.packedData);\n }\n /** Emit Beziers or strokes (selected by the stroke options) to the handler. */\n public emitStrokableParts(handler: IStrokeHandler, options?: StrokeOptions): void {\n const workBezier = this.initializeWorkBezier();\n const numSpan = this.numSpan;\n let numStrokes;\n for (let spanIndex = 0; spanIndex < numSpan; spanIndex++) {\n const bezier = this.getSaturatedBezierSpan3dOr3dH(spanIndex, false, workBezier);\n if (bezier) {\n numStrokes = bezier.computeStrokeCountForOptions(options);\n if (handler.announceBezierCurve) {\n handler.announceBezierCurve(\n bezier,\n numStrokes,\n this,\n spanIndex,\n this._bcurve.knots.spanFractionToFraction(spanIndex, 0.0),\n this._bcurve.knots.spanFractionToFraction(spanIndex, 1.0),\n );\n\n } else {\n handler.announceIntervalForUniformStepStrokes(\n this,\n numStrokes,\n this._bcurve.knots.spanFractionToFraction(spanIndex, 0.0),\n this._bcurve.knots.spanFractionToFraction(spanIndex, 1.0),\n );\n }\n }\n }\n }\n /**\n * Assess length and turn to determine a stroke count.\n * @param options stroke options structure.\n */\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\n const workBezier = this.initializeWorkBezier();\n const numSpan = this.numSpan;\n let numStroke = 0;\n for (let spanIndex = 0; spanIndex < numSpan; spanIndex++) {\n const bezier = this.getSaturatedBezierSpan3d(spanIndex, workBezier);\n if (bezier)\n numStroke += bezier.computeStrokeCountForOptions(options);\n }\n return numStroke;\n }\n /**\n * Compute individual segment stroke counts. Attach in a StrokeCountMap.\n * @param options StrokeOptions that determine count\n * @param parentStrokeMap evolving parent map.\n * @alpha\n */\n public override computeAndAttachRecursiveStrokeCounts(options?: StrokeOptions, parentStrokeMap?: StrokeCountMap) {\n const workBezier = this.initializeWorkBezier();\n const numSpan = this.numSpan;\n const myData = StrokeCountMap.createWithCurvePrimitiveAndOptionalParent(this, parentStrokeMap, []);\n for (let spanIndex = 0; spanIndex < numSpan; spanIndex++) {\n const bezier = this.getSaturatedBezierSpan3d(spanIndex, workBezier);\n if (bezier) {\n const segmentLength = workBezier.curveLength();\n const numStrokeOnSegment = workBezier.computeStrokeCountForOptions(options);\n myData.addToCountAndLength(numStrokeOnSegment, segmentLength);\n }\n }\n CurvePrimitive.installStrokeCountMap(this, myData, parentStrokeMap);\n }\n /** Append strokes to the given linestring. */\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\n const workBezier = this.initializeWorkBezier();\n const numSpan = this.numSpan;\n for (let spanIndex = 0; spanIndex < numSpan; spanIndex++) {\n const bezier = this.getSaturatedBezierSpan3d(spanIndex, workBezier);\n if (bezier)\n bezier.emitStrokes(dest, options);\n }\n }\n /**\n * Test knots and poles to determine if it is possible to close (aka \"wrap\") the curve.\n * @returns the manner in which it is possible to close the curve. See `BSplineWrapMode` for particulars of each mode.\n */\n public get isClosable(): BSplineWrapMode {\n return this.isClosableCurve;\n }\n /**\n * Return the Bezier fragment corresponding to the given span of this curve.\n * * The concrete return type may be [[BezierCurve3d]] or [[BezierCurve3dH]] according to the instance type and `prefer3dH`.\n * @param spanIndex index of span.\n * @param result optional reusable curve. This will only be reused if its type and order matches.\n */\n public getSaturatedBezierSpan3dOr3dH(\n spanIndex: number, prefer3dH: boolean, result?: BezierCurveBase,\n ): BezierCurveBase | undefined {\n if (prefer3dH)\n return this.getSaturatedBezierSpan3dH(spanIndex, result);\n return this.getSaturatedBezierSpan3d(spanIndex, result);\n }\n /**\n * Return the Bezier fragment corresponding to the given span of this curve.\n * @param spanIndex index of span.\n * @param result optional reusable curve. This will only be reused if its type and order matches.\n */\n public getSaturatedBezierSpan3d(spanIndex: number, result?: BezierCurveBase): BezierCurve3d | undefined {\n if (spanIndex < 0 || spanIndex >= this.numSpan)\n return undefined;\n const order = this.order;\n if (result === undefined || !(result instanceof BezierCurve3d) || result.order !== order)\n result = BezierCurve3d.createOrder(order);\n const bezier = result as BezierCurve3d;\n bezier.loadSpanPoles(this._bcurve.packedData, spanIndex);\n if (bezier.saturateInPlace(this._bcurve.knots, spanIndex))\n return bezier;\n return undefined;\n }\n /**\n * Return the Bezier fragment corresponding to the given span of this curve.\n * @param spanIndex index of span.\n * @param result optional reusable curve. This will only be reused if its type and order matches.\n */\n public getSaturatedBezierSpan3dH(spanIndex: number, result?: BezierCurveBase): BezierCurve3dH | undefined {\n if (spanIndex < 0 || spanIndex >= this.numSpan)\n return undefined;\n const order = this.order;\n if (result === undefined || !(result instanceof BezierCurve3dH) || result.order !== order)\n result = BezierCurve3dH.createOrder(order);\n const bezier = result as BezierCurve3dH;\n bezier.loadSpan3dPolesWithWeight(this._bcurve.packedData, spanIndex, 1.0);\n if (bezier.saturateInPlace(this._bcurve.knots, spanIndex))\n return bezier;\n return undefined;\n }\n /** Second step of double dispatch: call `handler.handleBSplineCurve3d(this)`. */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleBSplineCurve3d(this);\n }\n /**\n * Extend a range so it contains the range of this curve.\n * * This computation is based on the poles, not the curve itself, so the returned range is generally larger than the\n * tightest possible range.\n * @param rangeToExtend range to extend.\n * @param transform transform to apply to the poles as they are entered into the range.\n */\n public extendRange(rangeToExtend: Range3d, transform?: Transform): void {\n const buffer = this._bcurve.packedData;\n const n = buffer.length - 2;\n if (transform) {\n for (let i0 = 0; i0 < n; i0 += 3)\n rangeToExtend.extendTransformedXYZ(transform, buffer[i0], buffer[i0 + 1], buffer[i0 + 2]);\n } else {\n for (let i0 = 0; i0 < n; i0 += 3)\n rangeToExtend.extendXYZ(buffer[i0], buffer[i0 + 1], buffer[i0 + 2]);\n }\n }\n}\n"]}
|
|
@@ -70,7 +70,7 @@ export declare abstract class BooleanClipNode implements Clipper {
|
|
|
70
70
|
announceClippedCurveIntervals(curve: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
|
-
* Implement [BooleanClipNode] virtual methods for
|
|
73
|
+
* Implement [BooleanClipNode] virtual methods for union (boolean OR) among children.
|
|
74
74
|
* @internal
|
|
75
75
|
*/
|
|
76
76
|
export declare class BooleanClipNodeUnion extends BooleanClipNode {
|
|
@@ -82,7 +82,7 @@ export declare class BooleanClipNodeUnion extends BooleanClipNode {
|
|
|
82
82
|
appendPolygonClip(xyz: IndexedXYZCollection, insideFragments: GrowableXYZArray[], outsideFragments: GrowableXYZArray[], arrayCache: GrowableXYZArrayCache): void;
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
|
-
* Implement [BooleanClipNode] virtual methods for
|
|
85
|
+
* Implement [BooleanClipNode] virtual methods for parity (boolean XOR) among children.
|
|
86
86
|
* @internal
|
|
87
87
|
*/
|
|
88
88
|
export declare class BooleanClipNodeParity extends BooleanClipNode {
|
|
@@ -224,7 +224,7 @@ class BooleanClipNode {
|
|
|
224
224
|
}
|
|
225
225
|
exports.BooleanClipNode = BooleanClipNode;
|
|
226
226
|
/**
|
|
227
|
-
* Implement [BooleanClipNode] virtual methods for
|
|
227
|
+
* Implement [BooleanClipNode] virtual methods for union (boolean OR) among children.
|
|
228
228
|
* @internal
|
|
229
229
|
*/
|
|
230
230
|
class BooleanClipNodeUnion extends BooleanClipNode {
|
|
@@ -251,7 +251,7 @@ class BooleanClipNodeUnion extends BooleanClipNode {
|
|
|
251
251
|
}
|
|
252
252
|
exports.BooleanClipNodeUnion = BooleanClipNodeUnion;
|
|
253
253
|
/**
|
|
254
|
-
* Implement [BooleanClipNode] virtual methods for
|
|
254
|
+
* Implement [BooleanClipNode] virtual methods for parity (boolean XOR) among children.
|
|
255
255
|
* @internal
|
|
256
256
|
*/
|
|
257
257
|
class BooleanClipNodeParity extends BooleanClipNode {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanClipNode.js","sourceRoot":"","sources":["../../../src/clipping/BooleanClipN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IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,EACrD,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,eAAe,EACrD,SAAS,EACT,0BAAc,CAAC,cAAc,EAC7B,0BAAc,CAAC,SAAS,EACxB,0BAAc,CAAC,QAAQ,EACvB,UAAU,CACX,CAAC;IACJ,CAAC;CACF;AArCD,kEAqCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { Arc3d } from \"../curve/Arc3d\";\nimport { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range1d } from \"../geometry3d/Range\";\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\nimport { Range1dArray } from \"../numerics/Range1dArray\";\nimport { Clipper, ClipStepAction, ClipUtilities, PolygonClipper } from \"./ClipUtils\";\n\n/**\n * BooleanClipNode is an abstract base class for boolean actions by an array of clippers.\n * * Derived class must implement:\n * * The single point test `isPointOnOrInsideChildren`\n * * Boolean operation on 1d intervals `combineIntervals`\n * * The `keepInside` flag controls an additional optional flip of the boolean result:\n * * if `keepInside === true`, accept the \"inside\" of the child clippers.\n * * if `keepInside === false`, accept the \"outside\" of the child clippers.\n * * Hence the combinations of derived classes for (OR, AND, XOR) and keepInside are:\n * * (OR, true) = simple union (OR), i.e., \"in\" one or more clips.\n * * (OR, false) = complement of union (NOR), i.e., \"outside\" all clips.\n * * (AND, true) = simple intersection (AND), i.e., \"in\" all clips.\n * * (AND, false) = complement of intersection (NAND), i.e., \"outside\" one or more clips.\n * * (XOR, true) = simple parity, i.e., \"in\" an odd number of clips.\n * * (XOR, false) = complement of parity, i.e., \"in\" an even number of clips.\n * @internal\n */\nexport abstract class BooleanClipNode implements Clipper {\n protected _clippers: Clipper[];\n protected _intervalsA: Range1d[];\n protected _intervalsB: Range1d[];\n protected _keepInside: boolean;\n public constructor(keepInside: boolean) {\n this._keepInside = keepInside;\n this._clippers = [];\n this._intervalsA = [];\n this._intervalsB = [];\n }\n protected abstract isPointOnOrInsideChildren(point: Point3d): boolean;\n protected abstract combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[];\n public abstract get operationName(): string;\n public toJSON(): any {\n const data = [];\n for (const c of this._clippers) {\n const c1 = c as any;\n if (c1.toJSON)\n data.push(c1.toJSON());\n }\n // return this.formatJSON(data);\n const s = this.operationName;\n const json: { [opType: string]: any[] } = {};\n json[s] = data;\n return json;\n }\n /** Capture a (reference to a) child node or nodes */\n public captureChild(child: Clipper | Clipper[]) {\n if (Array.isArray(child)) {\n for (const c of child) this.captureChild(c);\n } else {\n this._clippers.push(child);\n }\n }\n /** Toggle the \"keepInside\" behavior. Return the prior value. */\n public toggleResult(): boolean {\n return this.selectResult(!this._keepInside);\n }\n /** Set the \"keepInside\" behavior. */\n public selectResult(keepInside: boolean): boolean {\n const s = this._keepInside;\n this._keepInside = keepInside;\n return s;\n }\n /**\n * Conditionally (if a1 > a0 strictly) call `announce(a0, a1)`.\n * * Return 0 if not called, 1 if called.\n */\n protected testedAnnounceNN(a0: number, a1: number, announce?: AnnounceNumberNumber): number {\n if (a0 < a1) {\n if (announce)\n announce(a0, a1);\n return 1;\n }\n return 0;\n }\n /**\n * Conditionally (if a1 > a0 strictly) call `announce(a0, a1, cp)`.\n * * Return 0 if not called, 1 if called.\n */\n protected testedAnnounceNNC(\n a0: number, a1: number, cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive,\n ): number {\n if (a0 < a1) {\n if (announce)\n announce(a0, a1, cp);\n return 1;\n }\n return 0;\n }\n /** Swap the `_intervalsA` and `_intervalsB`. */\n protected swapAB(): void {\n const q = this._intervalsA;\n this._intervalsA = this._intervalsB;\n this._intervalsB = q;\n }\n /**\n * Announce all \"outside intervals\" -- not masked by intervals.\n * * Return true if any intervals announced.\n */\n protected announcePartsNN(\n keepInside: boolean, intervals: Range1d[], f0: number, f1: number, announce?: AnnounceNumberNumber,\n ): boolean {\n let numAnnounce = 0;\n if (!keepInside) {\n let lowFraction = f0;\n for (const interval of intervals) {\n numAnnounce += this.testedAnnounceNN(lowFraction, interval.low, announce);\n lowFraction = interval.high;\n }\n numAnnounce += this.testedAnnounceNN(lowFraction, f1, announce);\n } else {\n for (const interval of intervals) {\n // use f0..f1 ?\n numAnnounce += this.testedAnnounceNN(interval.low, interval.high, announce);\n }\n }\n return numAnnounce > 0;\n }\n /**\n * Announce all \"outside intervals\" -- not masked by intervals.\n * * Return true if any intervals announced.\n */\n protected announcePartsNNC(\n keepInside: boolean, intervals: Range1d[], f0: number, f1: number, cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive,\n ): boolean {\n let numAnnounce = 0;\n if (!keepInside) {\n let lowFraction = f0;\n for (const interval of intervals) {\n numAnnounce += this.testedAnnounceNNC(lowFraction, interval.low, cp, announce);\n lowFraction = interval.high;\n }\n numAnnounce += this.testedAnnounceNNC(lowFraction, f1, cp, announce);\n } else {\n for (const interval of intervals) {\n // use f0..f1 ?\n numAnnounce += this.testedAnnounceNNC(interval.low, interval.high, cp, announce);\n }\n }\n return numAnnounce > 0;\n }\n /** Invoke callback to test if a point is \"in\" this clipper. */\n public isPointOnOrInside(point: Point3d): boolean {\n const q = this.isPointOnOrInsideChildren(point);\n return this._keepInside ? q : !q;\n }\n /** Method from [[Clipper]] interface. */\n public announceClippedSegmentIntervals(\n f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber,\n ): boolean {\n this._intervalsA.length = 0;\n const announceIntervalB = (a0: number, a1: number) => {\n this._intervalsB.push(Range1d.createXX(a0, a1));\n };\n // Strategy:\n // _intervalsA is the accumulated UNION of from clippers\n // _intervalsB is the current clipper.\n // announceIntervalB appends single new interval to _intervalB\n // at end, output gaps in _intervalsA\n //\n let i = 0;\n for (const c of this._clippers) {\n this._intervalsB.length = 0;\n c.announceClippedSegmentIntervals(f0, f1, pointA, pointB, announceIntervalB);\n Range1dArray.simplifySortUnion(this._intervalsB);\n if (i === 0) {\n this.swapAB();\n } else {\n this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);\n }\n i++;\n }\n return this.announcePartsNN(this._keepInside, this._intervalsA, f0, f1, announce);\n }\n /** Method from [[Clipper]] interface. */\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n this._intervalsA.length = 0;\n const announceIntervalB = (a0: number, a1: number) => {\n this._intervalsB.push(Range1d.createXX(a0, a1));\n };\n let i = 0;\n for (const c of this._clippers) {\n this._intervalsB.length = 0;\n c.announceClippedArcIntervals(arc, announceIntervalB);\n Range1dArray.simplifySortUnion(this._intervalsB);\n if (i === 0) {\n this.swapAB();\n } else {\n this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);\n }\n i++;\n }\n return this.announcePartsNNC(this._keepInside, this._intervalsA, 0, 1, arc, announce);\n }\n /* Method from [[Clipper]] interface. */\n public announceClippedCurveIntervals(curve: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n this._intervalsA.length = 0;\n const announceIntervalB = (a0: number, a1: number, _cp: CurvePrimitive) => {\n this._intervalsB.push(Range1d.createXX(a0, a1));\n };\n let i = 0;\n for (const c of this._clippers) {\n this._intervalsB.length = 0;\n c.announceClippedCurveIntervals?.(curve, announceIntervalB) ?? assert(false, () => `Expect ${c.constructor.name} to implement announceClippedCurveIntervals`);\n Range1dArray.simplifySortUnion(this._intervalsB);\n if (i === 0) {\n this.swapAB();\n } else {\n this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);\n }\n i++;\n }\n return this.announcePartsNNC(this._keepInside, this._intervalsA, 0, 1, curve, announce);\n }\n}\n\n/**\n * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.\n * @internal\n */\nexport class BooleanClipNodeUnion extends BooleanClipNode {\n public get operationName(): string {\n return this._keepInside ? \"OR\" : \"NOR\";\n }\n public constructor(keepInside: boolean) {\n super(keepInside);\n }\n /** Return true if inside any child clipper. */\n public isPointOnOrInsideChildren(point: Point3d): boolean {\n for (const clipper of this._clippers) {\n if (clipper.isPointOnOrInside(point))\n return true;\n }\n return false;\n }\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\n return Range1dArray.unionSorted(operandA, operandB);\n }\n public appendPolygonClip(\n xyz: IndexedXYZCollection,\n insideFragments: GrowableXYZArray[],\n outsideFragments: GrowableXYZArray[],\n arrayCache: GrowableXYZArrayCache,\n ) {\n ClipUtilities.doPolygonClipSequence(\n xyz,\n this._clippers,\n this._keepInside ? insideFragments : outsideFragments,\n this._keepInside ? outsideFragments : insideFragments,\n undefined,\n ClipStepAction.acceptIn,\n ClipStepAction.passToNextStep,\n ClipStepAction.acceptOut,\n arrayCache,\n );\n }\n}\n\n/**\n * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.\n * @internal\n */\nexport class BooleanClipNodeParity extends BooleanClipNode {\n public get operationName(): string {\n return this._keepInside ? \"XOR\" : \"NXOR\";\n }\n public constructor(keepInside: boolean) {\n super(keepInside);\n }\n /** Return true if inside an odd number of clippers child clipper. */\n public isPointOnOrInsideChildren(point: Point3d): boolean {\n let q = false;\n for (const clipper of this._clippers) {\n if (clipper.isPointOnOrInside(point))\n q = !q;\n }\n return q;\n }\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\n return Range1dArray.paritySorted(operandA, operandB);\n }\n public appendPolygonClip(\n xyz: IndexedXYZCollection,\n insideFragments: GrowableXYZArray[],\n outsideFragments: GrowableXYZArray[],\n arrayCache: GrowableXYZArrayCache,\n ) {\n ClipUtilities.doPolygonClipParitySequence(\n xyz,\n this._clippers,\n this._keepInside ? insideFragments : outsideFragments,\n this._keepInside ? outsideFragments : insideFragments,\n arrayCache,\n );\n }\n}\n\n/**\n * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.\n * @internal\n */\nexport class BooleanClipNodeIntersection extends BooleanClipNode implements PolygonClipper {\n public get operationName(): string {\n return this._keepInside ? \"AND\" : \"NAND\";\n }\n public constructor(keepInside: boolean) {\n super(keepInside);\n }\n /** Return false if outside of any child clipper */\n public isPointOnOrInsideChildren(point: Point3d): boolean {\n for (const clipper of this._clippers) {\n if (!clipper.isPointOnOrInside(point))\n return false;\n }\n return true;\n }\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\n return Range1dArray.intersectSorted(operandA, operandB);\n }\n public appendPolygonClip(\n xyz: IndexedXYZCollection,\n insideFragments: GrowableXYZArray[],\n outsideFragments: GrowableXYZArray[],\n arrayCache: GrowableXYZArrayCache,\n ) {\n\n ClipUtilities.doPolygonClipSequence(\n xyz,\n this._clippers,\n this._keepInside ? insideFragments : outsideFragments,\n this._keepInside ? outsideFragments : insideFragments,\n undefined,\n ClipStepAction.passToNextStep,\n ClipStepAction.acceptOut,\n ClipStepAction.acceptIn,\n arrayCache,\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BooleanClipNode.js","sourceRoot":"","sources":["../../../src/clipping/BooleanClipNode.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,sDAA6C;AAM7C,+CAA8C;AAE9C,2DAAwD;AACxD,2CAAqF;AAErF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAsB,eAAe;IACzB,SAAS,CAAY;IACrB,WAAW,CAAY;IACvB,WAAW,CAAY;IACvB,WAAW,CAAU;IAC/B,YAAmB,UAAmB;QACpC,IAAI,CAAC,WAA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EAqCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { Arc3d } from \"../curve/Arc3d\";\nimport { AnnounceNumberNumber, AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range1d } from \"../geometry3d/Range\";\nimport { GrowableXYZArrayCache } from \"../geometry3d/ReusableObjectCache\";\nimport { Range1dArray } from \"../numerics/Range1dArray\";\nimport { Clipper, ClipStepAction, ClipUtilities, PolygonClipper } from \"./ClipUtils\";\n\n/**\n * BooleanClipNode is an abstract base class for boolean actions by an array of clippers.\n * * Derived class must implement:\n * * The single point test `isPointOnOrInsideChildren`\n * * Boolean operation on 1d intervals `combineIntervals`\n * * The `keepInside` flag controls an additional optional flip of the boolean result:\n * * if `keepInside === true`, accept the \"inside\" of the child clippers.\n * * if `keepInside === false`, accept the \"outside\" of the child clippers.\n * * Hence the combinations of derived classes for (OR, AND, XOR) and keepInside are:\n * * (OR, true) = simple union (OR), i.e., \"in\" one or more clips.\n * * (OR, false) = complement of union (NOR), i.e., \"outside\" all clips.\n * * (AND, true) = simple intersection (AND), i.e., \"in\" all clips.\n * * (AND, false) = complement of intersection (NAND), i.e., \"outside\" one or more clips.\n * * (XOR, true) = simple parity, i.e., \"in\" an odd number of clips.\n * * (XOR, false) = complement of parity, i.e., \"in\" an even number of clips.\n * @internal\n */\nexport abstract class BooleanClipNode implements Clipper {\n protected _clippers: Clipper[];\n protected _intervalsA: Range1d[];\n protected _intervalsB: Range1d[];\n protected _keepInside: boolean;\n public constructor(keepInside: boolean) {\n this._keepInside = keepInside;\n this._clippers = [];\n this._intervalsA = [];\n this._intervalsB = [];\n }\n protected abstract isPointOnOrInsideChildren(point: Point3d): boolean;\n protected abstract combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[];\n public abstract get operationName(): string;\n public toJSON(): any {\n const data = [];\n for (const c of this._clippers) {\n const c1 = c as any;\n if (c1.toJSON)\n data.push(c1.toJSON());\n }\n // return this.formatJSON(data);\n const s = this.operationName;\n const json: { [opType: string]: any[] } = {};\n json[s] = data;\n return json;\n }\n /** Capture a (reference to a) child node or nodes */\n public captureChild(child: Clipper | Clipper[]) {\n if (Array.isArray(child)) {\n for (const c of child) this.captureChild(c);\n } else {\n this._clippers.push(child);\n }\n }\n /** Toggle the \"keepInside\" behavior. Return the prior value. */\n public toggleResult(): boolean {\n return this.selectResult(!this._keepInside);\n }\n /** Set the \"keepInside\" behavior. */\n public selectResult(keepInside: boolean): boolean {\n const s = this._keepInside;\n this._keepInside = keepInside;\n return s;\n }\n /**\n * Conditionally (if a1 > a0 strictly) call `announce(a0, a1)`.\n * * Return 0 if not called, 1 if called.\n */\n protected testedAnnounceNN(a0: number, a1: number, announce?: AnnounceNumberNumber): number {\n if (a0 < a1) {\n if (announce)\n announce(a0, a1);\n return 1;\n }\n return 0;\n }\n /**\n * Conditionally (if a1 > a0 strictly) call `announce(a0, a1, cp)`.\n * * Return 0 if not called, 1 if called.\n */\n protected testedAnnounceNNC(\n a0: number, a1: number, cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive,\n ): number {\n if (a0 < a1) {\n if (announce)\n announce(a0, a1, cp);\n return 1;\n }\n return 0;\n }\n /** Swap the `_intervalsA` and `_intervalsB`. */\n protected swapAB(): void {\n const q = this._intervalsA;\n this._intervalsA = this._intervalsB;\n this._intervalsB = q;\n }\n /**\n * Announce all \"outside intervals\" -- not masked by intervals.\n * * Return true if any intervals announced.\n */\n protected announcePartsNN(\n keepInside: boolean, intervals: Range1d[], f0: number, f1: number, announce?: AnnounceNumberNumber,\n ): boolean {\n let numAnnounce = 0;\n if (!keepInside) {\n let lowFraction = f0;\n for (const interval of intervals) {\n numAnnounce += this.testedAnnounceNN(lowFraction, interval.low, announce);\n lowFraction = interval.high;\n }\n numAnnounce += this.testedAnnounceNN(lowFraction, f1, announce);\n } else {\n for (const interval of intervals) {\n // use f0..f1 ?\n numAnnounce += this.testedAnnounceNN(interval.low, interval.high, announce);\n }\n }\n return numAnnounce > 0;\n }\n /**\n * Announce all \"outside intervals\" -- not masked by intervals.\n * * Return true if any intervals announced.\n */\n protected announcePartsNNC(\n keepInside: boolean, intervals: Range1d[], f0: number, f1: number, cp: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive,\n ): boolean {\n let numAnnounce = 0;\n if (!keepInside) {\n let lowFraction = f0;\n for (const interval of intervals) {\n numAnnounce += this.testedAnnounceNNC(lowFraction, interval.low, cp, announce);\n lowFraction = interval.high;\n }\n numAnnounce += this.testedAnnounceNNC(lowFraction, f1, cp, announce);\n } else {\n for (const interval of intervals) {\n // use f0..f1 ?\n numAnnounce += this.testedAnnounceNNC(interval.low, interval.high, cp, announce);\n }\n }\n return numAnnounce > 0;\n }\n /** Invoke callback to test if a point is \"in\" this clipper. */\n public isPointOnOrInside(point: Point3d): boolean {\n const q = this.isPointOnOrInsideChildren(point);\n return this._keepInside ? q : !q;\n }\n /** Method from [[Clipper]] interface. */\n public announceClippedSegmentIntervals(\n f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber,\n ): boolean {\n this._intervalsA.length = 0;\n const announceIntervalB = (a0: number, a1: number) => {\n this._intervalsB.push(Range1d.createXX(a0, a1));\n };\n // Strategy:\n // _intervalsA is the accumulated UNION of from clippers\n // _intervalsB is the current clipper.\n // announceIntervalB appends single new interval to _intervalB\n // at end, output gaps in _intervalsA\n //\n let i = 0;\n for (const c of this._clippers) {\n this._intervalsB.length = 0;\n c.announceClippedSegmentIntervals(f0, f1, pointA, pointB, announceIntervalB);\n Range1dArray.simplifySortUnion(this._intervalsB);\n if (i === 0) {\n this.swapAB();\n } else {\n this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);\n }\n i++;\n }\n return this.announcePartsNN(this._keepInside, this._intervalsA, f0, f1, announce);\n }\n /** Method from [[Clipper]] interface. */\n public announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n this._intervalsA.length = 0;\n const announceIntervalB = (a0: number, a1: number) => {\n this._intervalsB.push(Range1d.createXX(a0, a1));\n };\n let i = 0;\n for (const c of this._clippers) {\n this._intervalsB.length = 0;\n c.announceClippedArcIntervals(arc, announceIntervalB);\n Range1dArray.simplifySortUnion(this._intervalsB);\n if (i === 0) {\n this.swapAB();\n } else {\n this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);\n }\n i++;\n }\n return this.announcePartsNNC(this._keepInside, this._intervalsA, 0, 1, arc, announce);\n }\n /* Method from [[Clipper]] interface. */\n public announceClippedCurveIntervals(curve: CurvePrimitive, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n this._intervalsA.length = 0;\n const announceIntervalB = (a0: number, a1: number, _cp: CurvePrimitive) => {\n this._intervalsB.push(Range1d.createXX(a0, a1));\n };\n let i = 0;\n for (const c of this._clippers) {\n this._intervalsB.length = 0;\n c.announceClippedCurveIntervals?.(curve, announceIntervalB) ?? assert(false, () => `Expect ${c.constructor.name} to implement announceClippedCurveIntervals`);\n Range1dArray.simplifySortUnion(this._intervalsB);\n if (i === 0) {\n this.swapAB();\n } else {\n this._intervalsA = this.combineIntervals(this._intervalsA, this._intervalsB);\n }\n i++;\n }\n return this.announcePartsNNC(this._keepInside, this._intervalsA, 0, 1, curve, announce);\n }\n}\n\n/**\n * Implement [BooleanClipNode] virtual methods for union (boolean OR) among children.\n * @internal\n */\nexport class BooleanClipNodeUnion extends BooleanClipNode {\n public get operationName(): string {\n return this._keepInside ? \"OR\" : \"NOR\";\n }\n public constructor(keepInside: boolean) {\n super(keepInside);\n }\n /** Return true if inside any child clipper. */\n public isPointOnOrInsideChildren(point: Point3d): boolean {\n for (const clipper of this._clippers) {\n if (clipper.isPointOnOrInside(point))\n return true;\n }\n return false;\n }\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\n return Range1dArray.unionSorted(operandA, operandB);\n }\n public appendPolygonClip(\n xyz: IndexedXYZCollection,\n insideFragments: GrowableXYZArray[],\n outsideFragments: GrowableXYZArray[],\n arrayCache: GrowableXYZArrayCache,\n ) {\n ClipUtilities.doPolygonClipSequence(\n xyz,\n this._clippers,\n this._keepInside ? insideFragments : outsideFragments,\n this._keepInside ? outsideFragments : insideFragments,\n undefined,\n ClipStepAction.acceptIn,\n ClipStepAction.passToNextStep,\n ClipStepAction.acceptOut,\n arrayCache,\n );\n }\n}\n\n/**\n * Implement [BooleanClipNode] virtual methods for parity (boolean XOR) among children.\n * @internal\n */\nexport class BooleanClipNodeParity extends BooleanClipNode {\n public get operationName(): string {\n return this._keepInside ? \"XOR\" : \"NXOR\";\n }\n public constructor(keepInside: boolean) {\n super(keepInside);\n }\n /** Return true if inside an odd number of clippers child clipper. */\n public isPointOnOrInsideChildren(point: Point3d): boolean {\n let q = false;\n for (const clipper of this._clippers) {\n if (clipper.isPointOnOrInside(point))\n q = !q;\n }\n return q;\n }\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\n return Range1dArray.paritySorted(operandA, operandB);\n }\n public appendPolygonClip(\n xyz: IndexedXYZCollection,\n insideFragments: GrowableXYZArray[],\n outsideFragments: GrowableXYZArray[],\n arrayCache: GrowableXYZArrayCache,\n ) {\n ClipUtilities.doPolygonClipParitySequence(\n xyz,\n this._clippers,\n this._keepInside ? insideFragments : outsideFragments,\n this._keepInside ? outsideFragments : insideFragments,\n arrayCache,\n );\n }\n}\n\n/**\n * Implement [BooleanClipNode] virtual methods for intersection (boolean OR) among children.\n * @internal\n */\nexport class BooleanClipNodeIntersection extends BooleanClipNode implements PolygonClipper {\n public get operationName(): string {\n return this._keepInside ? \"AND\" : \"NAND\";\n }\n public constructor(keepInside: boolean) {\n super(keepInside);\n }\n /** Return false if outside of any child clipper */\n public isPointOnOrInsideChildren(point: Point3d): boolean {\n for (const clipper of this._clippers) {\n if (!clipper.isPointOnOrInside(point))\n return false;\n }\n return true;\n }\n public combineIntervals(operandA: Range1d[], operandB: Range1d[]): Range1d[] {\n return Range1dArray.intersectSorted(operandA, operandB);\n }\n public appendPolygonClip(\n xyz: IndexedXYZCollection,\n insideFragments: GrowableXYZArray[],\n outsideFragments: GrowableXYZArray[],\n arrayCache: GrowableXYZArrayCache,\n ) {\n\n ClipUtilities.doPolygonClipSequence(\n xyz,\n this._clippers,\n this._keepInside ? insideFragments : outsideFragments,\n this._keepInside ? outsideFragments : insideFragments,\n undefined,\n ClipStepAction.passToNextStep,\n ClipStepAction.acceptOut,\n ClipStepAction.acceptIn,\n arrayCache,\n );\n }\n}\n"]}
|
|
@@ -110,9 +110,15 @@ export declare class ClipPlane extends Plane3d implements Clipper, PolygonClippe
|
|
|
110
110
|
get distance(): number;
|
|
111
111
|
/** * Return the stored inward normal property. */
|
|
112
112
|
get inwardNormalRef(): Vector3d;
|
|
113
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* Return the "interior" property flag. Interpretation of this flag is algorithm-specific.
|
|
115
|
+
* * One way this flag is used is to indicate a plane that has been added to partition the exterior region of a masked ClipShape.
|
|
116
|
+
*/
|
|
114
117
|
get interior(): boolean;
|
|
115
|
-
/**
|
|
118
|
+
/**
|
|
119
|
+
* Return the "invisible" property flag. Interpretation of this flag is algorithm-specific.
|
|
120
|
+
* * One way this flag is used is to indicate a plane that should not be used to compute intersection edges.
|
|
121
|
+
*/
|
|
116
122
|
get invisible(): boolean;
|
|
117
123
|
/**
|
|
118
124
|
* Create a plane defined by two points, an up vector, and a tilt angle relative to the up vector.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipPlane.d.ts","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,gBAAgB,GAAG,SAAS;IAuBrG;;;;;;;;;OASG;IACI,iBAAiB,CACtB,GAAG,EAAE,oBAAoB,EACzB,eAAe,EAAE,gBAAgB,EAAE,EACnC,gBAAgB,EAAE,gBAAgB,EAAE,EACpC,UAAU,EAAE,qBAAqB,GAChC,IAAI;IAUP,6CAA6C;IACtC,mBAAmB,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAG1E,uDAAuD;IACvC,iBAAiB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;CAI9F"}
|
|
@@ -201,11 +201,17 @@ class ClipPlane extends Plane3d_1.Plane3d {
|
|
|
201
201
|
get inwardNormalRef() {
|
|
202
202
|
return this._inwardNormal;
|
|
203
203
|
}
|
|
204
|
-
/**
|
|
204
|
+
/**
|
|
205
|
+
* Return the "interior" property flag. Interpretation of this flag is algorithm-specific.
|
|
206
|
+
* * One way this flag is used is to indicate a plane that has been added to partition the exterior region of a masked ClipShape.
|
|
207
|
+
*/
|
|
205
208
|
get interior() {
|
|
206
209
|
return this._interior;
|
|
207
210
|
}
|
|
208
|
-
/**
|
|
211
|
+
/**
|
|
212
|
+
* Return the "invisible" property flag. Interpretation of this flag is algorithm-specific.
|
|
213
|
+
* * One way this flag is used is to indicate a plane that should not be used to compute intersection edges.
|
|
214
|
+
*/
|
|
209
215
|
get invisible() {
|
|
210
216
|
return this._invisible;
|
|
211
217
|
}
|