@itwin/core-geometry 5.0.0-dev.40 → 5.0.0-dev.49
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 +11 -1
- package/lib/cjs/bspline/KnotVector.d.ts +8 -6
- package/lib/cjs/bspline/KnotVector.d.ts.map +1 -1
- package/lib/cjs/bspline/KnotVector.js +12 -6
- package/lib/cjs/bspline/KnotVector.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +1 -0
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +1 -0
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.js +1 -1
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +0 -2
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +0 -4
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +7 -10
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +7 -10
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts +0 -5
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js +0 -7
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/polyface/FacetFaceData.d.ts +1 -1
- package/lib/cjs/polyface/FacetFaceData.js +1 -1
- package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +9 -6
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js +9 -6
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts +233 -0
- package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts.map +1 -0
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js +349 -0
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -0
- package/lib/cjs/polyface/Polyface.d.ts +35 -10
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +55 -10
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +0 -20
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +0 -28
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +28 -0
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +19 -0
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts +1 -2
- package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/esm/bspline/KnotVector.d.ts +8 -6
- package/lib/esm/bspline/KnotVector.d.ts.map +1 -1
- package/lib/esm/bspline/KnotVector.js +12 -6
- package/lib/esm/bspline/KnotVector.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +1 -0
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +1 -0
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.js +1 -1
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +0 -2
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +0 -4
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +7 -10
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +7 -10
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.d.ts +0 -5
- package/lib/esm/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js +0 -7
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/polyface/FacetFaceData.d.ts +1 -1
- package/lib/esm/polyface/FacetFaceData.js +1 -1
- package/lib/esm/polyface/FacetFaceData.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +9 -6
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js +9 -6
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts +233 -0
- package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts.map +1 -0
- package/lib/esm/polyface/IndexedPolyfaceWalker.js +345 -0
- package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -0
- package/lib/esm/polyface/Polyface.d.ts +35 -10
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +55 -10
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +0 -20
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +0 -28
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +28 -0
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js +19 -0
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts +1 -2
- package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
# Change Log - @itwin/core-geometry
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 24 Jan 2025 08:05:17 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 4.10.6
|
|
6
|
+
Fri, 24 Jan 2025 08:02:40 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 4.10.5
|
|
11
|
+
Tue, 21 Jan 2025 21:56:45 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
4
14
|
|
|
5
15
|
## 4.10.4
|
|
6
16
|
Mon, 13 Jan 2025 14:06:43 GMT
|
|
@@ -127,17 +127,19 @@ export declare class KnotVector {
|
|
|
127
127
|
/** Return fraction of active knot range to knot value. */
|
|
128
128
|
fractionToKnot(fraction: number): number;
|
|
129
129
|
/**
|
|
130
|
-
* Evaluate basis functions f[] at
|
|
131
|
-
*
|
|
132
|
-
* @param
|
|
130
|
+
* Evaluate the B-spline basis functions f[] at a parameter u in a knot span.
|
|
131
|
+
* * This method implements the Mansfield-Cox-de Boor recurrence relation.
|
|
132
|
+
* @param knotIndex0 index of the left knot of the span.
|
|
133
|
+
* @param u value in the knot span: knot[knotIndex0] <= u <= knot[knotIndex0 + 1].
|
|
133
134
|
* @param f preallocated output array of order basis function values
|
|
134
135
|
* @returns true if and only if output array is sufficiently sized
|
|
135
136
|
*/
|
|
136
137
|
evaluateBasisFunctions(knotIndex0: number, u: number, f: Float64Array): boolean;
|
|
137
138
|
/**
|
|
138
|
-
* Evaluate basis functions f[], derivatives df[], and optional second derivatives ddf[] at
|
|
139
|
-
*
|
|
140
|
-
* @param
|
|
139
|
+
* Evaluate basis functions f[], derivatives df[], and optional second derivatives ddf[] at a parameter u
|
|
140
|
+
* in a knot span.
|
|
141
|
+
* @param knotIndex0 index of the left knot of the span.
|
|
142
|
+
* @param u value in the knot span: knot[knotIndex0] <= u <= knot[knotIndex0 + 1].
|
|
141
143
|
* @param f preallocated output array of order basis function values
|
|
142
144
|
* @param df preallocated output array of order basis derivative values
|
|
143
145
|
* @param ddf optional preallocated output array of order basis second derivative values
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KnotVector.d.ts","sourceRoot":"","sources":["../../../src/bspline/KnotVector.ts"],"names":[],"mappings":"AAIA;;GAEG;AAKH;;;;GAIG;AACH,oBAAY,eAAe;IACzB,+BAA+B;IAC/B,IAAI,IAAI;IACR;;;OAGG;IACH,yBAAyB,IAAI;IAC7B;;;OAGG;IACH,mBAAmB,I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AmG;IAC5F,YAAY;IASnB,uHAAuH;WACzG,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,eAAe,GAAG,MAAM,EAAE;IA0B5I,uHAAuH;IAChH,SAAS,CAAC,mBAAmB,EAAE,OAAO,GAAG,MAAM,EAAE;CAIzD"}
|
|
@@ -298,9 +298,10 @@ class KnotVector {
|
|
|
298
298
|
return Geometry_1.Geometry.interpolate(this.knots[this.degree - 1], fraction, this.knots[this.knots.length - this.degree]);
|
|
299
299
|
}
|
|
300
300
|
/**
|
|
301
|
-
* Evaluate basis functions f[] at
|
|
302
|
-
*
|
|
303
|
-
* @param
|
|
301
|
+
* Evaluate the B-spline basis functions f[] at a parameter u in a knot span.
|
|
302
|
+
* * This method implements the Mansfield-Cox-de Boor recurrence relation.
|
|
303
|
+
* @param knotIndex0 index of the left knot of the span.
|
|
304
|
+
* @param u value in the knot span: knot[knotIndex0] <= u <= knot[knotIndex0 + 1].
|
|
304
305
|
* @param f preallocated output array of order basis function values
|
|
305
306
|
* @returns true if and only if output array is sufficiently sized
|
|
306
307
|
*/
|
|
@@ -317,6 +318,8 @@ class KnotVector {
|
|
|
317
318
|
f[0] = 1.0 - f[1];
|
|
318
319
|
if (this.degree < 2)
|
|
319
320
|
return true;
|
|
321
|
+
// Each iteration of the outer loop evaluates the basis functions of degree depth+1 using
|
|
322
|
+
// one or two values of the basis functions of one less degree from the preceding iteration.
|
|
320
323
|
for (let depth = 1; depth < this.degree; depth++) {
|
|
321
324
|
let kLeft = knotIndex0 - depth;
|
|
322
325
|
let kRight = kLeft + depth + 1;
|
|
@@ -331,13 +334,16 @@ class KnotVector {
|
|
|
331
334
|
gCarry = g1;
|
|
332
335
|
}
|
|
333
336
|
f[depth + 1] = gCarry;
|
|
337
|
+
// at this point, the head of f[] contains the depth+2 values at u
|
|
338
|
+
// of the basis functions of degree depth+1 with support over [u0,u1)
|
|
334
339
|
}
|
|
335
340
|
return true;
|
|
336
341
|
}
|
|
337
342
|
/**
|
|
338
|
-
* Evaluate basis functions f[], derivatives df[], and optional second derivatives ddf[] at
|
|
339
|
-
*
|
|
340
|
-
* @param
|
|
343
|
+
* Evaluate basis functions f[], derivatives df[], and optional second derivatives ddf[] at a parameter u
|
|
344
|
+
* in a knot span.
|
|
345
|
+
* @param knotIndex0 index of the left knot of the span.
|
|
346
|
+
* @param u value in the knot span: knot[knotIndex0] <= u <= knot[knotIndex0 + 1].
|
|
341
347
|
* @param f preallocated output array of order basis function values
|
|
342
348
|
* @param df preallocated output array of order basis derivative values
|
|
343
349
|
* @param ddf optional preallocated output array of order basis second derivative values
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KnotVector.js","sourceRoot":"","sources":["../../../src/bspline/KnotVector.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,0CAAuC;AACvC,6DAAyD;AAEzD;;;;GAIG;AACH,IAAY,eAaX;AAbD,WAAY,eAAe;IACzB,+BAA+B;IAC/B,qDAAQ,CAAA;IACR;;;OAGG;IACH,+FAA6B,CAAA;IAC7B;;;OAGG;IACH,mFAAuB,CAAA;AACzB,CAAC,EAbW,eAAe,+BAAf,eAAe,QAa1B;AACD;;;;;;;;;;;;GAYG;AACH,MAAa,UAAU;IASrB,0DAA0D;aACnC,kBAAa,GAAG,MAAM,CAAC;IAC9C,+FAA+F;IAC/F,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,gGAAgG;IAChG,IAAW,SAAS,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,mEAAmE;IACnE,IAAW,aAAa,KAAK,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACtD,oEAAoE;IACpE,IAAW,cAAc,KAAK,OAAO,IAAI,CAAC,KA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AAM,CAAC,IAAI,KAAK,EAAE,CAAC;YACtB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;QACD,IAAI,mBAAmB,EAAE,CAAC;YACxB,IAAI,sBAAsB;gBACxB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;;gBAE/C,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,uHAAuH;IAChH,SAAS,CAAC,mBAA4B;QAC3C,MAAM,QAAQ,GAAG,CAAC,mBAAmB,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3F,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,mBAAmB,EAAE,QAAQ,CAAC,CAAC;IACtF,CAAC;;AAxcH,gCAycC","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 { Geometry } from \"../Geometry\";\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\n\n/**\n * B-spline curve and surface types in this library are non-periodic. But they can be created from legacy periodic data.\n * This enumeration lists the possible ways a B-spline object can have been created from legacy periodic data.\n * @public\n */\nexport enum BSplineWrapMode {\n /** No conversion performed. */\n None = 0,\n /** The B-spline was opened up by adding degree wrap-around control points to the legacy periodic data.\n * * This is typical of B-splines constructed with maximum (degree - 1) continuity.\n * * Knots are unaffected by this conversion.\n */\n OpenByAddingControlPoints = 1,\n /** The B-spline was opened up by removing degree extreme knots from the legacy periodic data.\n * * This is typical of rational B-spline curves representing full circles and ellipses.\n * * Poles are unaffected by this conversion.\n */\n OpenByRemovingKnots = 2,\n}\n/**\n * Array of non-decreasing numbers acting as a knot array for B-splines.\n *\n * * Essential identity: numKnots = numPoles + order - 2 = numPoles + degree - 1\n * * Various B-spline libraries have confusion over how many \"end knots\" are needed. Many libraries (including MicroStation and Parasolid)\n * demand order knots at each end for clamping. But only order-1 are really needed. This class uses the order-1 convention.\n * * A span is a single interval of the knots.\n * * The left knot of span {k} is knot {k+degree-1}.\n * * This class provides queries to convert among spanIndex, knotIndex, spanFraction, fraction of knot range, and knot.\n * * Core computations (evaluateBasisFunctions) have leftKnotIndex and global knot value as inputs. Callers need to\n * know their primary values (global knot, spanFraction).\n * @public\n */\nexport class KnotVector {\n /** The simple array of knot values. */\n public knots: Float64Array;\n /** Return the degree of basis functions defined in these knots. */\n public degree: number;\n private _knot0: number;\n private _knot1: number;\n\n private _wrapMode?: BSplineWrapMode;\n /** tolerance for considering two knots to be the same. */\n public static readonly knotTolerance = 1.0e-9;\n /** Return the leftmost knot value (of the active interval, ignoring unclamped leading knots)*/\n public get leftKnot() { return this._knot0; }\n /** Return the rightmost knot value (of the active interval, ignoring unclamped leading knots)*/\n public get rightKnot() { return this._knot1; }\n /** Return the index of the leftmost knot of the active interval */\n public get leftKnotIndex() { return this.degree - 1; }\n /** Return the index of the rightmost knot of the active interval */\n public get rightKnotIndex() { return this.knots.length - this.degree; }\n /** Whether this KnotVector was created by converting legacy periodic data during deserialization. The conversion used is specified by BSplineWrapMode, and is reversed at serialization time. */\n public get wrappable() { return this._wrapMode === undefined ? BSplineWrapMode.None : this._wrapMode; }\n public set wrappable(value: BSplineWrapMode) { this._wrapMode = value; }\n /** Return the number of bezier spans. Note that this includes zero-length spans if there are repeated knots. */\n public get numSpans() { return this.rightKnotIndex - this.leftKnotIndex; }\n /**\n *\n * * If knots is a number array or Float64Array, the those values become the local knot array.\n * * If knots is a simple number, the local knot array is allocated to that size but left as zeros.\n * @param knots\n * @param degree\n */\n private constructor(knots: number[] | Float64Array | number, degree: number, wrapMode?: BSplineWrapMode) {\n this.degree = degree;\n this._wrapMode = wrapMode;\n // default values to satisfy compiler -- real values happen in setupFixedValues, or final else defers to user\n this._knot0 = 0.0;\n this._knot1 = 1.0;\n // satisfy the initialize checker ..\n if (Array.isArray(knots)) { // remark: This ctor is private. The callers (as of April 2019) do not use this path.\n this.knots = new Float64Array(knots.length);\n this.setKnots(knots);\n this.setupFixedValues();\n } else if (knots instanceof Float64Array) {\n this.knots = knots.slice();\n this.setupFixedValues();\n } else { // caller is responsible for filling array separately ...\n this.knots = new Float64Array(knots);\n }\n }\n /** copy degree and knots to a new KnotVector. */\n public clone(): KnotVector { return new KnotVector(this.knots, this.degree, this.wrappable); }\n private setupFixedValues() {\n if (this.degree > 0 && this.knots.length > this.degree) {\n this._knot0 = this.knots[this.degree - 1];\n this._knot1 = this.knots[this.knots.length - this.degree];\n }\n }\n /** Return the total knot distance from beginning to end. */\n public get knotLength01(): number { return this._knot1 - this._knot0; }\n /**\n * Returns true if all numeric values have wraparound conditions that allow the knots to be closed with specified wrap mode.\n * @param mode optional test mode. If undefined, use this.wrappable.\n */\n public testClosable(mode?: BSplineWrapMode): boolean {\n if (mode === undefined)\n mode = this.wrappable;\n const degree = this.degree;\n const leftKnotIndex = this.leftKnotIndex;\n const rightKnotIndex = this.rightKnotIndex;\n if (mode === BSplineWrapMode.OpenByAddingControlPoints) {\n // maximum continuity mode: we expect degree periodically extended knots at each end\n const period = this.rightKnot - this.leftKnot;\n const indexDelta = rightKnotIndex - leftKnotIndex;\n for (let k0 = 0; k0 < leftKnotIndex + degree; k0++) {\n const k1 = k0 + indexDelta;\n if (Math.abs(this.knots[k0] + period - this.knots[k1]) >= KnotVector.knotTolerance)\n return false;\n }\n return true;\n }\n if (mode === BSplineWrapMode.OpenByRemovingKnots) {\n // legacy periodic mode: we expect multiplicity degree knots at each end\n const numRepeated = degree - 1;\n const leftKnot = this.leftKnot;\n const rightKnot = this.rightKnot;\n for (let i = 0; i < numRepeated; i++) {\n if (Math.abs(leftKnot - this.knots[leftKnotIndex - i - 1]) >= KnotVector.knotTolerance)\n return false;\n if (Math.abs(rightKnot - this.knots[rightKnotIndex + i + 1]) >= KnotVector.knotTolerance)\n return false;\n }\n return true;\n }\n return false;\n }\n /** Test matching degree and knot values */\n public isAlmostEqual(other: KnotVector): boolean {\n if (this.degree !== other.degree) return false;\n return NumberArray.isAlmostEqual(this.knots, other.knots, KnotVector.knotTolerance);\n }\n\n /** Compute the multiplicity of the input knot, or zero if not a knot. */\n public getKnotMultiplicity(knot: number): number {\n let m = 0;\n for (const k of this.knots) {\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\n ++m;\n else if (knot < k)\n break;\n }\n return m;\n }\n\n /** Compute the multiplicity of the knot at the given index. */\n public getKnotMultiplicityAtIndex(knotIndex: number): number {\n let m = 0;\n if (knotIndex >= 0 && knotIndex < this.knots.length) {\n const knot = this.knots[knotIndex];\n ++m; // count this knot\n for (let i = knotIndex - 1; i >= 0; --i) {\n const k = this.knots[i];\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\n ++m; // found multiple to left of knot\n else if (knot > k)\n break;\n }\n for (let i = knotIndex + 1; i < this.knots.length; ++i) {\n const k = this.knots[i];\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\n ++m; // found multiple to right of knot\n else if (knot < k)\n break;\n }\n }\n return m;\n }\n\n /** Transform knots to span [0,1].\n * @returns false if and only if this.knotLength01 is trivial\n */\n public normalize(): boolean {\n if (this.knotLength01 < KnotVector.knotTolerance)\n return false;\n const divisor = 1.0 / this.knotLength01;\n const leftKnot = this.leftKnot;\n for (let i = 0; i < this.knots.length; ++i)\n this.knots[i] = (this.knots[i] - leftKnot) * divisor;\n // explicitly set rightKnot and its multiples to 1.0 to avoid round-off\n for (let i = this.rightKnotIndex - 1; i > this.leftKnotIndex && (this.knots[i] === this.knots[this.rightKnotIndex]); --i) this.knots[i] = 1.0;\n for (let i = this.rightKnotIndex + 1; i < this.knots.length && (this.knots[i] === this.knots[this.rightKnotIndex]); ++i) this.knots[i] = 1.0;\n this.knots[this.rightKnotIndex] = 1.0;\n this.setupFixedValues();\n return true;\n }\n\n /** install knot values from an array, optionally ignoring first and last.\n */\n public setKnots(knots: number[] | Float64Array, skipFirstAndLast?: boolean) {\n const numAllocate = skipFirstAndLast ? knots.length - 2 : knots.length;\n if (numAllocate !== this.knots.length)\n this.knots = new Float64Array(numAllocate);\n if (skipFirstAndLast) {\n for (let i = 1; i + 1 < knots.length; i++)\n this.knots[i - 1] = knots[i];\n\n } else {\n for (let i = 0; i < knots.length; i++)\n this.knots[i] = knots[i];\n }\n this.setupFixedValues();\n }\n\n /** Set knots to input array (CAPTURED) */\n public setKnotsCapture(knots: Float64Array) {\n this.knots = knots;\n this.setupFixedValues();\n }\n\n /**\n * Create knot vector with {degree-1} replicated knots at start and end, and uniform knots between.\n * @param numPoles Number of poles\n * @param degree degree of polynomial\n * @param a0 left knot value for active interval\n * @param a1 right knot value for active interval\n */\n public static createUniformClamped(numPoles: number, degree: number, a0: number, a1: number): KnotVector {\n const knots = new KnotVector(numPoles + degree - 1, degree);\n let k = 0;\n for (let m = 0; m < degree; m++)knots.knots[k++] = a0;\n const du = 1.0 / (numPoles - degree);\n for (let i = 1; i + degree < numPoles; i++)\n knots.knots[k++] = a0 + i * du * (a1 - a0);\n for (let m = 0; m < degree; m++)knots.knots[k++] = a1;\n knots.setupFixedValues();\n return knots;\n }\n /**\n * Create knot vector with wraparound knots at start and end, and uniform knots between.\n * @param numInterval number of intervals in knot space. (NOT POLE COUNT)\n * @param degree degree of polynomial\n * @param a0 left knot value for active interval\n * @param a1 right knot value for active interval\n */\n public static createUniformWrapped(numInterval: number, degree: number, a0: number, a1: number): KnotVector {\n const knots = new KnotVector(numInterval + 2 * degree - 1, degree);\n const du = 1.0 / numInterval;\n for (let i = 1 - degree, k = 0; i < numInterval + degree; i++, k++) {\n knots.knots[k] = Geometry.interpolate(a0, i * du, a1);\n }\n knots.setupFixedValues();\n return knots;\n }\n\n /**\n * Create knot vector with given knot values and degree.\n * @param knotArray knot values\n * @param degree degree of polynomial\n * @param skipFirstAndLast true to skip copying the first and last knot values.\n */\n public static create(knotArray: number[] | Float64Array, degree: number, skipFirstAndLast?: boolean): KnotVector {\n const numAllocate = skipFirstAndLast ? knotArray.length - 2 : knotArray.length;\n const knots = new KnotVector(numAllocate, degree);\n knots.setKnots(knotArray, skipFirstAndLast);\n return knots;\n }\n\n /**\n * Return the average of degree consecutive knots beginning at knotIndex.\n */\n public grevilleKnot(knotIndex: number): number {\n if (knotIndex < 0) return this.leftKnot;\n if (knotIndex > this.rightKnotIndex) return this.rightKnot;\n let sum = 0.0;\n for (let i = knotIndex; i < knotIndex + this.degree; i++)\n sum += this.knots[i];\n return sum / this.degree;\n }\n /** Return an array sized for a set of the basis function values. */\n public createBasisArray(): Float64Array { return new Float64Array(this.degree + 1); }\n /** Convert localFraction within the interval following an indexed knot to a knot value. */\n public baseKnotFractionToKnot(knotIndex0: number, localFraction: number): number {\n const knot0 = this.knots[knotIndex0];\n localFraction = Geometry.clamp(localFraction, 0, 1);\n return knot0 + localFraction * (this.knots[knotIndex0 + 1] - knot0);\n }\n /** Convert localFraction within an indexed bezier span to a knot value. */\n public spanFractionToKnot(spanIndex: number, localFraction: number): number {\n const k = this.spanIndexToLeftKnotIndex(spanIndex);\n localFraction = Geometry.clamp(localFraction, 0, 1);\n return this.knots[k] + localFraction * (this.knots[k + 1] - this.knots[k]);\n }\n /** Convert localFraction within an indexed bezier span to fraction of active knot range. */\n public spanFractionToFraction(spanIndex: number, localFraction: number): number {\n const knot = this.spanFractionToKnot(spanIndex, localFraction);\n return (knot - this.leftKnot) / (this.rightKnot - this.leftKnot);\n }\n /** Return fraction of active knot range to knot value. */\n public fractionToKnot(fraction: number): number {\n fraction = Geometry.clamp(fraction, 0, 1); // B-splines are not extendable\n return Geometry.interpolate(this.knots[this.degree - 1], fraction, this.knots[this.knots.length - this.degree]);\n }\n /**\n * Evaluate basis functions f[] at knot value u.\n *\n * @param u knot value for evaluation\n * @param f preallocated output array of order basis function values\n * @returns true if and only if output array is sufficiently sized\n */\n public evaluateBasisFunctions(knotIndex0: number, u: number, f: Float64Array): boolean {\n if (f.length < this.degree + 1)\n return false;\n f[0] = 1.0;\n if (this.degree < 1)\n return true;\n // direct compute for linear part ...\n const u0 = this.knots[knotIndex0];\n const u1 = this.knots[knotIndex0 + 1];\n f[1] = (u - u0) / (u1 - u0);\n f[0] = 1.0 - f[1];\n if (this.degree < 2)\n return true;\n for (let depth = 1; depth < this.degree; depth++) {\n let kLeft = knotIndex0 - depth;\n let kRight = kLeft + depth + 1;\n let gCarry = 0.0;\n for (let step = 0; step <= depth; step++) {\n const tLeft = this.knots[kLeft++];\n const tRight = this.knots[kRight++];\n const fraction = (u - tLeft) / (tRight - tLeft);\n const g1 = f[step] * fraction;\n const g0 = f[step] * (1.0 - fraction);\n f[step] = gCarry + g0;\n gCarry = g1;\n }\n f[depth + 1] = gCarry;\n }\n return true;\n }\n\n /**\n * Evaluate basis functions f[], derivatives df[], and optional second derivatives ddf[] at knot value u.\n *\n * @param u knot value for evaluation\n * @param f preallocated output array of order basis function values\n * @param df preallocated output array of order basis derivative values\n * @param ddf optional preallocated output array of order basis second derivative values\n * @returns true if and only if output arrays are sufficiently sized\n */\n public evaluateBasisFunctions1(knotIndex0: number, u: number, f: Float64Array, df: Float64Array, ddf?: Float64Array): boolean {\n if (f.length < this.degree + 1)\n return false;\n if (df.length < this.degree + 1)\n return false;\n if (ddf && ddf.length < this.degree + 1)\n return false;\n f[0] = 1.0; df[0] = 0.0;\n if (this.degree < 1)\n return true;\n // direct compute for linear part ...\n const u0 = this.knots[knotIndex0];\n const u1 = this.knots[knotIndex0 + 1];\n // ah = 1/(u1-u0) is the derivative of fraction0\n // (-ah) is the derivative of fraction1.\n let ah = 1.0 / (u1 - u0);\n f[1] = (u - u0) * ah;\n f[0] = 1.0 - f[1];\n df[0] = -ah; df[1] = ah;\n if (ddf) { // first derivative started constant, second derivative started zero.\n ddf[0] = 0.0; ddf[1] = 0.0;\n }\n if (this.degree < 2)\n return true;\n for (let depth = 1; depth < this.degree; depth++) {\n let kLeft = knotIndex0 - depth;\n let kRight = kLeft + depth + 1;\n let gCarry = 0.0;\n let dgCarry = 0.0;\n let ddgCarry = 0.0;\n // f, df, ddf, are each row vectors with product of `step` linear terms.\n // f is multiplied on the right by matrix V. Each row has 2 nonzero entries (which sum to 1) (0,0,1-fraction, fraction,0,0,0)\n // Each row of the derivative dV is two entries (0,0, -1/h, 1/h,0,0,0)\n // Hence fnew = f * V\n // dfnew = df * V + f * dV\n // ddfnew = ddf * V + df*dV + df * dV + f * ddV\n // but ddV is zero so\n // ddfnew = ddf * V + 2 * df * dV\n for (let step = 0; step <= depth; step++) {\n const tLeft = this.knots[kLeft++];\n const tRight = this.knots[kRight++];\n ah = 1.0 / (tRight - tLeft);\n const fraction = (u - tLeft) * ah;\n const fraction1 = 1.0 - fraction;\n const g1 = f[step] * fraction;\n const g0 = f[step] * fraction1;\n const dg1 = df[step] * fraction + f[step] * ah;\n const dg0 = df[step] * fraction1 - f[step] * ah;\n const dfSave = 2.0 * df[step] * ah;\n f[step] = gCarry + g0;\n df[step] = dgCarry + dg0;\n gCarry = g1;\n dgCarry = dg1;\n if (ddf) { // do the backward reference to df before rewriting df !!!\n const ddg1 = ddf[step] * fraction + dfSave;\n const ddg0 = ddf[step] * fraction1 - dfSave;\n ddf[step] = ddgCarry + ddg0;\n ddgCarry = ddg1;\n }\n }\n f[depth + 1] = gCarry;\n df[depth + 1] = dgCarry;\n if (ddf)\n ddf[depth + 1] = ddgCarry;\n }\n return true;\n }\n /** Find the knot span bracketing knots[i] <= u < knots[i+1] and return i.\n * * If u has no such bracket, return the smaller index of the closest nontrivial bracket.\n * @param u value to bracket\n */\n public knotToLeftKnotIndex(u: number): number {\n for (let i = this.leftKnotIndex; i < this.rightKnotIndex; ++i) {\n if (u < this.knots[i + 1])\n return i;\n }\n // for u >= rightKnot, return left index of last nontrivial span\n for (let i = this.rightKnotIndex; i > this.leftKnotIndex; --i) {\n if (this.knots[i] - this.knots[i - 1] >= KnotVector.knotTolerance)\n return i - 1;\n }\n return this.rightKnotIndex - 1; // shouldn't get here\n }\n /**\n * Given a span index, return the index of the knot at its left.\n * @param spanIndex index of span\n */\n public spanIndexToLeftKnotIndex(spanIndex: number): number {\n const d = this.degree;\n if (spanIndex <= 0.0) return d - 1;\n return Math.min(spanIndex + d - 1, this.knots.length - d - 1);\n }\n /** Return the knot interval length of indexed bezier span. */\n public spanIndexToSpanLength(spanIndex: number): number {\n const k = this.spanIndexToLeftKnotIndex(spanIndex);\n return this.knots[k + 1] - this.knots[k];\n }\n /**\n * Given a span index, test if it is within range and has nonzero length.\n * * note that a false return does not imply there are no more spans. This may be a double knot (zero length span) followed by more real spans\n * @param spanIndex index of span to test.\n */\n public isIndexOfRealSpan(spanIndex: number): boolean {\n if (spanIndex >= 0 && spanIndex < this.numSpans)\n return !Geometry.isSmallMetricDistance(this.spanIndexToSpanLength(spanIndex));\n return false;\n }\n /** Reflect all knots so `leftKnot` and `rightKnot` are maintained but interval lengths reverse. */\n public reflectKnots() {\n const a = this.leftKnot;\n const b = this.rightKnot;\n const numKnots = this.knots.length;\n for (let i = 0; i < numKnots; i++)\n this.knots[i] = a + (b - this.knots[i]);\n this.knots.reverse();\n }\n\n /** Return a simple array form of the knots. Optionally replicate the first and last in classic over-clamped manner. */\n public static copyKnots(knots: number[] | Float64Array, degree: number, includeExtraEndKnot?: boolean, wrapMode?: BSplineWrapMode): number[] {\n const isExtraEndKnotPeriodic = (includeExtraEndKnot && wrapMode === BSplineWrapMode.OpenByAddingControlPoints);\n const leftIndex = degree - 1;\n const rightIndex = knots.length - degree;\n const a0 = knots[leftIndex];\n const a1 = knots[rightIndex];\n const delta = a1 - a0;\n const values: number[] = [];\n if (includeExtraEndKnot) {\n if (isExtraEndKnotPeriodic)\n values.push(knots[rightIndex - degree] - delta);\n else\n values.push(knots[0]);\n }\n for (const u of knots) {\n values.push(u);\n }\n if (includeExtraEndKnot) {\n if (isExtraEndKnotPeriodic)\n values.push(knots[leftIndex + degree] + delta);\n else\n values.push(knots[knots.length - 1]);\n }\n return values;\n }\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 const wrapMode = (includeExtraEndKnot && this.testClosable()) ? this.wrappable : undefined;\n return KnotVector.copyKnots(this.knots, this.degree, includeExtraEndKnot, wrapMode);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"KnotVector.js","sourceRoot":"","sources":["../../../src/bspline/KnotVector.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,0CAAuC;AACvC,6DAAyD;AAEzD;;;;GAIG;AACH,IAAY,eAaX;AAbD,WAAY,eAAe;IACzB,+BAA+B;IAC/B,qDAAQ,CAAA;IACR;;;OAGG;IACH,+FAA6B,CAAA;IAC7B;;;OAGG;IACH,mFAAuB,CAAA;AACzB,CAAC,EAbW,eAAe,+BAAf,eAAe,QAa1B;AACD;;;;;;;;;;;;GAYG;AACH,MAAa,UAAU;IASrB,0DAA0D;aACnC,kBAAa,GAAG,MAAM,CAAC;IAC9C,+FAA+F;IAC/F,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,gGAAgG;IAChG,IAAW,SAAS,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,mEAAmE;IACnE,IAAW,aAAa,KAAK,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACtD,oEAAoE;IACpE,IAAW,cAAc,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACvE,iMAAiM;IACjM,IAAW,SAAS,KAAK,OAA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,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;QACD,IAAI,mBAAmB,EAAE,CAAC;YACxB,IAAI,sBAAsB;gBACxB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC;;gBAE/C,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,uHAAuH;IAChH,SAAS,CAAC,mBAA4B;QAC3C,MAAM,QAAQ,GAAG,CAAC,mBAAmB,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3F,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,mBAAmB,EAAE,QAAQ,CAAC,CAAC;IACtF,CAAC;;AA9cH,gCA+cC","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 { Geometry } from \"../Geometry\";\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\n\n/**\n * B-spline curve and surface types in this library are non-periodic. But they can be created from legacy periodic data.\n * This enumeration lists the possible ways a B-spline object can have been created from legacy periodic data.\n * @public\n */\nexport enum BSplineWrapMode {\n /** No conversion performed. */\n None = 0,\n /** The B-spline was opened up by adding degree wrap-around control points to the legacy periodic data.\n * * This is typical of B-splines constructed with maximum (degree - 1) continuity.\n * * Knots are unaffected by this conversion.\n */\n OpenByAddingControlPoints = 1,\n /** The B-spline was opened up by removing degree extreme knots from the legacy periodic data.\n * * This is typical of rational B-spline curves representing full circles and ellipses.\n * * Poles are unaffected by this conversion.\n */\n OpenByRemovingKnots = 2,\n}\n/**\n * Array of non-decreasing numbers acting as a knot array for B-splines.\n *\n * * Essential identity: numKnots = numPoles + order - 2 = numPoles + degree - 1\n * * Various B-spline libraries have confusion over how many \"end knots\" are needed. Many libraries (including MicroStation and Parasolid)\n * demand order knots at each end for clamping. But only order-1 are really needed. This class uses the order-1 convention.\n * * A span is a single interval of the knots.\n * * The left knot of span {k} is knot {k+degree-1}.\n * * This class provides queries to convert among spanIndex, knotIndex, spanFraction, fraction of knot range, and knot.\n * * Core computations (evaluateBasisFunctions) have leftKnotIndex and global knot value as inputs. Callers need to\n * know their primary values (global knot, spanFraction).\n * @public\n */\nexport class KnotVector {\n /** The simple array of knot values. */\n public knots: Float64Array;\n /** Return the degree of basis functions defined in these knots. */\n public degree: number;\n private _knot0: number;\n private _knot1: number;\n\n private _wrapMode?: BSplineWrapMode;\n /** tolerance for considering two knots to be the same. */\n public static readonly knotTolerance = 1.0e-9;\n /** Return the leftmost knot value (of the active interval, ignoring unclamped leading knots)*/\n public get leftKnot() { return this._knot0; }\n /** Return the rightmost knot value (of the active interval, ignoring unclamped leading knots)*/\n public get rightKnot() { return this._knot1; }\n /** Return the index of the leftmost knot of the active interval */\n public get leftKnotIndex() { return this.degree - 1; }\n /** Return the index of the rightmost knot of the active interval */\n public get rightKnotIndex() { return this.knots.length - this.degree; }\n /** Whether this KnotVector was created by converting legacy periodic data during deserialization. The conversion used is specified by BSplineWrapMode, and is reversed at serialization time. */\n public get wrappable() { return this._wrapMode === undefined ? BSplineWrapMode.None : this._wrapMode; }\n public set wrappable(value: BSplineWrapMode) { this._wrapMode = value; }\n /** Return the number of bezier spans. Note that this includes zero-length spans if there are repeated knots. */\n public get numSpans() { return this.rightKnotIndex - this.leftKnotIndex; }\n /**\n *\n * * If knots is a number array or Float64Array, the those values become the local knot array.\n * * If knots is a simple number, the local knot array is allocated to that size but left as zeros.\n * @param knots\n * @param degree\n */\n private constructor(knots: number[] | Float64Array | number, degree: number, wrapMode?: BSplineWrapMode) {\n this.degree = degree;\n this._wrapMode = wrapMode;\n // default values to satisfy compiler -- real values happen in setupFixedValues, or final else defers to user\n this._knot0 = 0.0;\n this._knot1 = 1.0;\n // satisfy the initialize checker ..\n if (Array.isArray(knots)) { // remark: This ctor is private. The callers (as of April 2019) do not use this path.\n this.knots = new Float64Array(knots.length);\n this.setKnots(knots);\n this.setupFixedValues();\n } else if (knots instanceof Float64Array) {\n this.knots = knots.slice();\n this.setupFixedValues();\n } else { // caller is responsible for filling array separately ...\n this.knots = new Float64Array(knots);\n }\n }\n /** copy degree and knots to a new KnotVector. */\n public clone(): KnotVector { return new KnotVector(this.knots, this.degree, this.wrappable); }\n private setupFixedValues() {\n if (this.degree > 0 && this.knots.length > this.degree) {\n this._knot0 = this.knots[this.degree - 1];\n this._knot1 = this.knots[this.knots.length - this.degree];\n }\n }\n /** Return the total knot distance from beginning to end. */\n public get knotLength01(): number { return this._knot1 - this._knot0; }\n /**\n * Returns true if all numeric values have wraparound conditions that allow the knots to be closed with specified wrap mode.\n * @param mode optional test mode. If undefined, use this.wrappable.\n */\n public testClosable(mode?: BSplineWrapMode): boolean {\n if (mode === undefined)\n mode = this.wrappable;\n const degree = this.degree;\n const leftKnotIndex = this.leftKnotIndex;\n const rightKnotIndex = this.rightKnotIndex;\n if (mode === BSplineWrapMode.OpenByAddingControlPoints) {\n // maximum continuity mode: we expect degree periodically extended knots at each end\n const period = this.rightKnot - this.leftKnot;\n const indexDelta = rightKnotIndex - leftKnotIndex;\n for (let k0 = 0; k0 < leftKnotIndex + degree; k0++) {\n const k1 = k0 + indexDelta;\n if (Math.abs(this.knots[k0] + period - this.knots[k1]) >= KnotVector.knotTolerance)\n return false;\n }\n return true;\n }\n if (mode === BSplineWrapMode.OpenByRemovingKnots) {\n // legacy periodic mode: we expect multiplicity degree knots at each end\n const numRepeated = degree - 1;\n const leftKnot = this.leftKnot;\n const rightKnot = this.rightKnot;\n for (let i = 0; i < numRepeated; i++) {\n if (Math.abs(leftKnot - this.knots[leftKnotIndex - i - 1]) >= KnotVector.knotTolerance)\n return false;\n if (Math.abs(rightKnot - this.knots[rightKnotIndex + i + 1]) >= KnotVector.knotTolerance)\n return false;\n }\n return true;\n }\n return false;\n }\n /** Test matching degree and knot values */\n public isAlmostEqual(other: KnotVector): boolean {\n if (this.degree !== other.degree) return false;\n return NumberArray.isAlmostEqual(this.knots, other.knots, KnotVector.knotTolerance);\n }\n\n /** Compute the multiplicity of the input knot, or zero if not a knot. */\n public getKnotMultiplicity(knot: number): number {\n let m = 0;\n for (const k of this.knots) {\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\n ++m;\n else if (knot < k)\n break;\n }\n return m;\n }\n\n /** Compute the multiplicity of the knot at the given index. */\n public getKnotMultiplicityAtIndex(knotIndex: number): number {\n let m = 0;\n if (knotIndex >= 0 && knotIndex < this.knots.length) {\n const knot = this.knots[knotIndex];\n ++m; // count this knot\n for (let i = knotIndex - 1; i >= 0; --i) {\n const k = this.knots[i];\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\n ++m; // found multiple to left of knot\n else if (knot > k)\n break;\n }\n for (let i = knotIndex + 1; i < this.knots.length; ++i) {\n const k = this.knots[i];\n if (Math.abs(k - knot) < KnotVector.knotTolerance)\n ++m; // found multiple to right of knot\n else if (knot < k)\n break;\n }\n }\n return m;\n }\n\n /** Transform knots to span [0,1].\n * @returns false if and only if this.knotLength01 is trivial\n */\n public normalize(): boolean {\n if (this.knotLength01 < KnotVector.knotTolerance)\n return false;\n const divisor = 1.0 / this.knotLength01;\n const leftKnot = this.leftKnot;\n for (let i = 0; i < this.knots.length; ++i)\n this.knots[i] = (this.knots[i] - leftKnot) * divisor;\n // explicitly set rightKnot and its multiples to 1.0 to avoid round-off\n for (let i = this.rightKnotIndex - 1; i > this.leftKnotIndex && (this.knots[i] === this.knots[this.rightKnotIndex]); --i) this.knots[i] = 1.0;\n for (let i = this.rightKnotIndex + 1; i < this.knots.length && (this.knots[i] === this.knots[this.rightKnotIndex]); ++i) this.knots[i] = 1.0;\n this.knots[this.rightKnotIndex] = 1.0;\n this.setupFixedValues();\n return true;\n }\n\n /** install knot values from an array, optionally ignoring first and last.\n */\n public setKnots(knots: number[] | Float64Array, skipFirstAndLast?: boolean) {\n const numAllocate = skipFirstAndLast ? knots.length - 2 : knots.length;\n if (numAllocate !== this.knots.length)\n this.knots = new Float64Array(numAllocate);\n if (skipFirstAndLast) {\n for (let i = 1; i + 1 < knots.length; i++)\n this.knots[i - 1] = knots[i];\n\n } else {\n for (let i = 0; i < knots.length; i++)\n this.knots[i] = knots[i];\n }\n this.setupFixedValues();\n }\n\n /** Set knots to input array (CAPTURED) */\n public setKnotsCapture(knots: Float64Array) {\n this.knots = knots;\n this.setupFixedValues();\n }\n\n /**\n * Create knot vector with {degree-1} replicated knots at start and end, and uniform knots between.\n * @param numPoles Number of poles\n * @param degree degree of polynomial\n * @param a0 left knot value for active interval\n * @param a1 right knot value for active interval\n */\n public static createUniformClamped(numPoles: number, degree: number, a0: number, a1: number): KnotVector {\n const knots = new KnotVector(numPoles + degree - 1, degree);\n let k = 0;\n for (let m = 0; m < degree; m++)knots.knots[k++] = a0;\n const du = 1.0 / (numPoles - degree);\n for (let i = 1; i + degree < numPoles; i++)\n knots.knots[k++] = a0 + i * du * (a1 - a0);\n for (let m = 0; m < degree; m++)knots.knots[k++] = a1;\n knots.setupFixedValues();\n return knots;\n }\n /**\n * Create knot vector with wraparound knots at start and end, and uniform knots between.\n * @param numInterval number of intervals in knot space. (NOT POLE COUNT)\n * @param degree degree of polynomial\n * @param a0 left knot value for active interval\n * @param a1 right knot value for active interval\n */\n public static createUniformWrapped(numInterval: number, degree: number, a0: number, a1: number): KnotVector {\n const knots = new KnotVector(numInterval + 2 * degree - 1, degree);\n const du = 1.0 / numInterval;\n for (let i = 1 - degree, k = 0; i < numInterval + degree; i++, k++) {\n knots.knots[k] = Geometry.interpolate(a0, i * du, a1);\n }\n knots.setupFixedValues();\n return knots;\n }\n\n /**\n * Create knot vector with given knot values and degree.\n * @param knotArray knot values\n * @param degree degree of polynomial\n * @param skipFirstAndLast true to skip copying the first and last knot values.\n */\n public static create(knotArray: number[] | Float64Array, degree: number, skipFirstAndLast?: boolean): KnotVector {\n const numAllocate = skipFirstAndLast ? knotArray.length - 2 : knotArray.length;\n const knots = new KnotVector(numAllocate, degree);\n knots.setKnots(knotArray, skipFirstAndLast);\n return knots;\n }\n\n /**\n * Return the average of degree consecutive knots beginning at knotIndex.\n */\n public grevilleKnot(knotIndex: number): number {\n if (knotIndex < 0) return this.leftKnot;\n if (knotIndex > this.rightKnotIndex) return this.rightKnot;\n let sum = 0.0;\n for (let i = knotIndex; i < knotIndex + this.degree; i++)\n sum += this.knots[i];\n return sum / this.degree;\n }\n /** Return an array sized for a set of the basis function values. */\n public createBasisArray(): Float64Array { return new Float64Array(this.degree + 1); }\n /** Convert localFraction within the interval following an indexed knot to a knot value. */\n public baseKnotFractionToKnot(knotIndex0: number, localFraction: number): number {\n const knot0 = this.knots[knotIndex0];\n localFraction = Geometry.clamp(localFraction, 0, 1);\n return knot0 + localFraction * (this.knots[knotIndex0 + 1] - knot0);\n }\n /** Convert localFraction within an indexed bezier span to a knot value. */\n public spanFractionToKnot(spanIndex: number, localFraction: number): number {\n const k = this.spanIndexToLeftKnotIndex(spanIndex);\n localFraction = Geometry.clamp(localFraction, 0, 1);\n return this.knots[k] + localFraction * (this.knots[k + 1] - this.knots[k]);\n }\n /** Convert localFraction within an indexed bezier span to fraction of active knot range. */\n public spanFractionToFraction(spanIndex: number, localFraction: number): number {\n const knot = this.spanFractionToKnot(spanIndex, localFraction);\n return (knot - this.leftKnot) / (this.rightKnot - this.leftKnot);\n }\n /** Return fraction of active knot range to knot value. */\n public fractionToKnot(fraction: number): number {\n fraction = Geometry.clamp(fraction, 0, 1); // B-splines are not extendable\n return Geometry.interpolate(this.knots[this.degree - 1], fraction, this.knots[this.knots.length - this.degree]);\n }\n /**\n * Evaluate the B-spline basis functions f[] at a parameter u in a knot span.\n * * This method implements the Mansfield-Cox-de Boor recurrence relation.\n * @param knotIndex0 index of the left knot of the span.\n * @param u value in the knot span: knot[knotIndex0] <= u <= knot[knotIndex0 + 1].\n * @param f preallocated output array of order basis function values\n * @returns true if and only if output array is sufficiently sized\n */\n public evaluateBasisFunctions(knotIndex0: number, u: number, f: Float64Array): boolean {\n if (f.length < this.degree + 1)\n return false;\n f[0] = 1.0;\n if (this.degree < 1)\n return true;\n // direct compute for linear part ...\n const u0 = this.knots[knotIndex0];\n const u1 = this.knots[knotIndex0 + 1];\n f[1] = (u - u0) / (u1 - u0);\n f[0] = 1.0 - f[1];\n if (this.degree < 2)\n return true;\n // Each iteration of the outer loop evaluates the basis functions of degree depth+1 using\n // one or two values of the basis functions of one less degree from the preceding iteration.\n for (let depth = 1; depth < this.degree; depth++) {\n let kLeft = knotIndex0 - depth;\n let kRight = kLeft + depth + 1;\n let gCarry = 0.0;\n for (let step = 0; step <= depth; step++) {\n const tLeft = this.knots[kLeft++];\n const tRight = this.knots[kRight++];\n const fraction = (u - tLeft) / (tRight - tLeft);\n const g1 = f[step] * fraction;\n const g0 = f[step] * (1.0 - fraction);\n f[step] = gCarry + g0;\n gCarry = g1;\n }\n f[depth + 1] = gCarry;\n // at this point, the head of f[] contains the depth+2 values at u\n // of the basis functions of degree depth+1 with support over [u0,u1)\n }\n return true;\n }\n\n /**\n * Evaluate basis functions f[], derivatives df[], and optional second derivatives ddf[] at a parameter u\n * in a knot span.\n * @param knotIndex0 index of the left knot of the span.\n * @param u value in the knot span: knot[knotIndex0] <= u <= knot[knotIndex0 + 1].\n * @param f preallocated output array of order basis function values\n * @param df preallocated output array of order basis derivative values\n * @param ddf optional preallocated output array of order basis second derivative values\n * @returns true if and only if output arrays are sufficiently sized\n */\n public evaluateBasisFunctions1(knotIndex0: number, u: number, f: Float64Array, df: Float64Array, ddf?: Float64Array): boolean {\n if (f.length < this.degree + 1)\n return false;\n if (df.length < this.degree + 1)\n return false;\n if (ddf && ddf.length < this.degree + 1)\n return false;\n f[0] = 1.0; df[0] = 0.0;\n if (this.degree < 1)\n return true;\n // direct compute for linear part ...\n const u0 = this.knots[knotIndex0];\n const u1 = this.knots[knotIndex0 + 1];\n // ah = 1/(u1-u0) is the derivative of fraction0\n // (-ah) is the derivative of fraction1.\n let ah = 1.0 / (u1 - u0);\n f[1] = (u - u0) * ah;\n f[0] = 1.0 - f[1];\n df[0] = -ah; df[1] = ah;\n if (ddf) { // first derivative started constant, second derivative started zero.\n ddf[0] = 0.0; ddf[1] = 0.0;\n }\n if (this.degree < 2)\n return true;\n for (let depth = 1; depth < this.degree; depth++) {\n let kLeft = knotIndex0 - depth;\n let kRight = kLeft + depth + 1;\n let gCarry = 0.0;\n let dgCarry = 0.0;\n let ddgCarry = 0.0;\n // f, df, ddf, are each row vectors with product of `step` linear terms.\n // f is multiplied on the right by matrix V. Each row has 2 nonzero entries (which sum to 1) (0,0,1-fraction, fraction,0,0,0)\n // Each row of the derivative dV is two entries (0,0, -1/h, 1/h,0,0,0)\n // Hence fnew = f * V\n // dfnew = df * V + f * dV\n // ddfnew = ddf * V + df*dV + df * dV + f * ddV\n // but ddV is zero so\n // ddfnew = ddf * V + 2 * df * dV\n for (let step = 0; step <= depth; step++) {\n const tLeft = this.knots[kLeft++];\n const tRight = this.knots[kRight++];\n ah = 1.0 / (tRight - tLeft);\n const fraction = (u - tLeft) * ah;\n const fraction1 = 1.0 - fraction;\n const g1 = f[step] * fraction;\n const g0 = f[step] * fraction1;\n const dg1 = df[step] * fraction + f[step] * ah;\n const dg0 = df[step] * fraction1 - f[step] * ah;\n const dfSave = 2.0 * df[step] * ah;\n f[step] = gCarry + g0;\n df[step] = dgCarry + dg0;\n gCarry = g1;\n dgCarry = dg1;\n if (ddf) { // do the backward reference to df before rewriting df !!!\n const ddg1 = ddf[step] * fraction + dfSave;\n const ddg0 = ddf[step] * fraction1 - dfSave;\n ddf[step] = ddgCarry + ddg0;\n ddgCarry = ddg1;\n }\n }\n f[depth + 1] = gCarry;\n df[depth + 1] = dgCarry;\n if (ddf)\n ddf[depth + 1] = ddgCarry;\n }\n return true;\n }\n /** Find the knot span bracketing knots[i] <= u < knots[i+1] and return i.\n * * If u has no such bracket, return the smaller index of the closest nontrivial bracket.\n * @param u value to bracket\n */\n public knotToLeftKnotIndex(u: number): number {\n for (let i = this.leftKnotIndex; i < this.rightKnotIndex; ++i) {\n if (u < this.knots[i + 1])\n return i;\n }\n // for u >= rightKnot, return left index of last nontrivial span\n for (let i = this.rightKnotIndex; i > this.leftKnotIndex; --i) {\n if (this.knots[i] - this.knots[i - 1] >= KnotVector.knotTolerance)\n return i - 1;\n }\n return this.rightKnotIndex - 1; // shouldn't get here\n }\n /**\n * Given a span index, return the index of the knot at its left.\n * @param spanIndex index of span\n */\n public spanIndexToLeftKnotIndex(spanIndex: number): number {\n const d = this.degree;\n if (spanIndex <= 0.0) return d - 1;\n return Math.min(spanIndex + d - 1, this.knots.length - d - 1);\n }\n /** Return the knot interval length of indexed bezier span. */\n public spanIndexToSpanLength(spanIndex: number): number {\n const k = this.spanIndexToLeftKnotIndex(spanIndex);\n return this.knots[k + 1] - this.knots[k];\n }\n /**\n * Given a span index, test if it is within range and has nonzero length.\n * * note that a false return does not imply there are no more spans. This may be a double knot (zero length span) followed by more real spans\n * @param spanIndex index of span to test.\n */\n public isIndexOfRealSpan(spanIndex: number): boolean {\n if (spanIndex >= 0 && spanIndex < this.numSpans)\n return !Geometry.isSmallMetricDistance(this.spanIndexToSpanLength(spanIndex));\n return false;\n }\n /** Reflect all knots so `leftKnot` and `rightKnot` are maintained but interval lengths reverse. */\n public reflectKnots() {\n const a = this.leftKnot;\n const b = this.rightKnot;\n const numKnots = this.knots.length;\n for (let i = 0; i < numKnots; i++)\n this.knots[i] = a + (b - this.knots[i]);\n this.knots.reverse();\n }\n\n /** Return a simple array form of the knots. Optionally replicate the first and last in classic over-clamped manner. */\n public static copyKnots(knots: number[] | Float64Array, degree: number, includeExtraEndKnot?: boolean, wrapMode?: BSplineWrapMode): number[] {\n const isExtraEndKnotPeriodic = (includeExtraEndKnot && wrapMode === BSplineWrapMode.OpenByAddingControlPoints);\n const leftIndex = degree - 1;\n const rightIndex = knots.length - degree;\n const a0 = knots[leftIndex];\n const a1 = knots[rightIndex];\n const delta = a1 - a0;\n const values: number[] = [];\n if (includeExtraEndKnot) {\n if (isExtraEndKnotPeriodic)\n values.push(knots[rightIndex - degree] - delta);\n else\n values.push(knots[0]);\n }\n for (const u of knots) {\n values.push(u);\n }\n if (includeExtraEndKnot) {\n if (isExtraEndKnotPeriodic)\n values.push(knots[leftIndex + degree] + delta);\n else\n values.push(knots[knots.length - 1]);\n }\n return values;\n }\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 const wrapMode = (includeExtraEndKnot && this.testClosable()) ? this.wrappable : undefined;\n return KnotVector.copyKnots(this.knots, this.degree, includeExtraEndKnot, wrapMode);\n }\n}\n"]}
|
|
@@ -215,6 +215,7 @@ export * from "./polyface/FacetFaceData";
|
|
|
215
215
|
export * from "./polyface/Polyface";
|
|
216
216
|
export * from "./polyface/FacetLocationDetail";
|
|
217
217
|
export * from "./polyface/IndexedPolyfaceVisitor";
|
|
218
|
+
export * from "./polyface/IndexedPolyfaceWalker";
|
|
218
219
|
export * from "./polyface/multiclip/GriddedRaggedRange2dSet";
|
|
219
220
|
export * from "./polyface/multiclip/GriddedRaggedRange2dSetWithOverflow";
|
|
220
221
|
export * from "./polyface/PolyfaceBuilder";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-geometry.d.ts","sourceRoot":"","sources":["../../src/core-geometry.ts"],"names":[],"mappings":"AAKA;;GAEG;AASH;;;GAGG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;;;;;;GASG;AAGH;;;;;;;;GAQG;AAGH;;;;;;;;;;;;GAYG;AAEH;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BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC"}
|
package/lib/cjs/core-geometry.js
CHANGED
|
@@ -251,6 +251,7 @@ __exportStar(require("./polyface/FacetFaceData"), exports);
|
|
|
251
251
|
__exportStar(require("./polyface/Polyface"), exports);
|
|
252
252
|
__exportStar(require("./polyface/FacetLocationDetail"), exports);
|
|
253
253
|
__exportStar(require("./polyface/IndexedPolyfaceVisitor"), exports);
|
|
254
|
+
__exportStar(require("./polyface/IndexedPolyfaceWalker"), exports);
|
|
254
255
|
__exportStar(require("./polyface/multiclip/GriddedRaggedRange2dSet"), exports);
|
|
255
256
|
__exportStar(require("./polyface/multiclip/GriddedRaggedRange2dSetWithOverflow"), exports);
|
|
256
257
|
__exportStar(require("./polyface/PolyfaceBuilder"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-geometry.js","sourceRoot":"","sources":["../../src/core-geometry.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;;AAE/F;;GAEG;AAEH,UAAU;AACV,+GAA+G;AAC/G,wDAAwD;AACxD,+FAA+F;AAC/F,6HAA6H;AAC7H,kEAAkE;AAElE;;;GAGG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,4CAA4C;AAC5C;;;;;;;;;GASG;AACH,8CAA8C;AAE9C;;;;;;;;GAQG;AACH,kCAAkC;AAElC;;;;;;;;;;;;GAYG;AACH,gCAAgC;AAChC;;;GAGG;AACH,mCAAmC;AACnC;;;GAGG;AACH,mCAAmC;AACnC;;;;GAIG;AACH,wCAAwC;AACxC;;;;;;;;;;GAUG;AACH,gCAAgC;AAChC;;;GAGG;AACH,mCAAmC;AACnC;;;GAGG;AACH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DAAmC;AACnC,wDAAsC;AACtC,oEAAkD;AAClD,oEAAkD;AAClD,gEAA8C;AAC9C,sDAAoC;AACpC,+DAA6C;AAC7C,8CAA4B;AAC5B,+CAA6B;AAC7B,sDAAoC;AACpC,0DAAwC;AACxC,qDAAmC;AACnC,yDAAuC;AACvC,iDAA+B;AAC/B,uDAAqC;AACrC,oDAAkC;AAClC,yDAAuC;AACvC,uDAAqC;AACrC,4DAA0C;AAC1C,0DAAwC;AACxC,2DAAyC;AACzC,yDAAuC;AACvC,4DAA0C;AAC1C,wDAAsC;AACtC,4DAA0C;AAC1C,2DAAyC;AACzC,iEAA+C;AAC/C,uDAAqC;AACrC,qDAAmC;AACnC,yDAAuC;AACvC,2DAAyC;AACzC,sDAAoC;AACpC,iEAA+C;AAC/C,oEAAkD;AAClD,+EAA6D;AAC7D,2FAAyE;AACzE,6DAA2C;AAC3C,0DAAwC;AACxC,2DAAyC;AACzC,0DAAwC;AACxC,oFAAkE;AAClE,oFAAkE;AAClE,gFAA8D;AAC9D,+DAA6C;AAC7C,gEAA8C;AAC9C,mEAAiD;AACjD,8DAA4C;AAC5C,kEAAgD;AAChD,uEAAqD;AACrD,uFAAsF;AAA7E,sIAAA,yBAAyB,OAAA","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 Utility\n */\n\n// REMARK:\n// The docs-group-description comments are followed by empty classes with names corresponding to the doc-group.\n// Normally (in committed code) these are commented out.\n// The comments have distinctive strings so that simple search and replace can make the \"real\".\n// This is useful when working on the documentation: When the empty classes are present, VSCode will format the doc comments\n// for and display them when the mouse hovers over the class name.\n\n/**\n * @docs-package-description\n * The core-geometry package contains classes for working with geometry: points, vectors, curves, surfaces, and analytic solids\n */\n/**\n * @docs-group-description CartesianGeometry\n * Points, Vectors, Planes, and Transformations for x,y,z geometry.\n * * Fundamental cartesian geometry objects:\n * * Point2d, Point3d -- points with x,y,z coordinates\n * * Vector2d, Vector3d -- vectors with x,y,z coordinates\n * * Matrix3d -- 3x3 matrix\n * * * commonly used for pure rotations\n * * * scale and skew entries are also allowed.\n * * Transform -- an origin and axes.\n * * Range1d, Range2d, Range3d -- subsets of 1d, 2d, and 3d space bounded by low and high values.\n * * Ray3d -- a ray defined by origin and direction vector\n * * Plane3d -- an abstract base class extended by Plane3dByOriginAndNormal, Plane3dByOriginAndUnitNormal, Point4d, and ClipPlane\n * * Plane3dByOriginAndUnitNormal -- a plane defined by an origin and a single vector which is perpendicular to the plane\n * * plane3dByOriginAndVectors -- a plane defined by an origin and two vectors in the plane.\n * * Angles\n * * Angle -- a strongly typed angle object whose method names make it clear whether input and outputs are degrees or radians.\n * * AngleSweep -- an angular interval\n * * LatitudeLongitudeNumber -- carrier for position and altitude on sphere or ellipsoid\n * * YawPitchAndRollAngles -- 3 angles that define a rotated coordinate system.\n * * Utility classes\n * * FrameBuilder -- construction of coordinate frames from mixed data sources.\n * * ClipPlane -- a single plane\n * * ConvexClipPlaneSet -- an array of planes bounding a convex volume\n * * ClipPlaneSet -- an array of ConvexClipPlaneSet, defining the union of their volumes\n * * BilinearPatch -- twisted quadrilateral defined by 4 points\n * * BarycentricTriangle -- triangle defined by 3 points.\n * * Constant -- various numeric values exported as readonly constants\n */\n// doc:export class CartesianGeometryDoc { }\n/**\n * @docs-group-description ArraysAndInterfaces\n * These classes support array operations and inheritance-based algorithms.\n * * Arrays\n * * GrowableArray -- A carrier for a Float64Array, with methods that hide reallocation of the underlying array as contents are added.\n * * Point2dArray, Point3dArray, Point4dArray, Vector3dArray -- miscellaneous operations on arrays of 2d and 3d points.\n * * Interfaces\n * * GeometryHandler -- a double-dispatch protocol used for efficient implementation of algorithms that work on many geometry types.\n *\n */\n// doc:export class ArraysAndInterfacesDoc { }\n\n/**\n * @docs-group-description Bspline\n * A bspline curve or surface is used for curved freeform geometry defined by controls points (sometimes called poles).\n * * BSplineCurve -- a curve defined by control points (which are not on the curve)\n * * InterpolationCurve -- a curve defined by passthrough points, with \"good\" visual properties\n * * BSplineSurfaceXYZ -- a surface with XYZ\n * * BsplineSurfaceXYZW -- a surface with weighted (rational) XYZ coordinates\n * * KnotVector -- vector of breakpoints in bspline definitions.\n */\n// doc:export class BsplineDoc { }\n\n/**\n * @docs-group-description Curve\n * Curves in the GeometryQuery hierarchy: LineSegment3d, LineString3d, Arc3d, TransitionSpiral3d\n * * CurvePrimitive -- base class for parametric curves\n * * LineSegment3d -- a (bounded) portion of an unbounded line\n * * Arc3d -- a circular or elliptic arc\n * * LineString3d -- a sequence of points joined by line segments\n * * TransitionSpiral -- controlled transition between curvatures\n * * Support classes\n * * PointString3d -- a sequence of isolated points\n * * StrokeOptions -- tolerances to describe stroking accuracy\n * * RecursiveCurveProcessor, RecursiveCurveProcessorWithStack -- algorithmic support for trees with CurvePrimitives at the leaf level.\n */\n// doc:export class CurveDoc { }\n/**\n * @docs-group-description Numerics\n * The Numerics classes have geometric and numeric methods used during large algorithms in other classes.\n */\n// doc:export class NumericsDoc { }\n/**\n * @docs-group-description Polyface\n * A Polyface is a mesh structure with arrays of points that are shared among multiple incident facets.\n */\n// doc:export class PolyfaceDoc { }\n/**\n * @docs-group-description Serialization\n * These classes are related to serialization of geometry classes.\n * * IModelJson.Reader, IModelJson.Writer -- Conversion of in-memory geometry objects to json objects for persistence and transmission.\n */\n// doc:export class SerializationDoc { }\n/**\n * @docs-group-description Solid\n * Analytic Solids in the GeometryQuery hierarchy: Box, Sphere, Cone, TorusPipe, LinearSweep, RotationalSweep, RuledSweep\n * * Box -- a box solid. This is usually rectangular on all faces, but can in one directly like a view frustum\n * * Sphere -- a sphere\n * * Cone -- a cone or cylinder\n * * TorusPipe -- a pipe elbow\n * * LinearSweep -- a linear sweep of a base contour\n * * RotationalSweep -- a rotational sweep of a base contour\n * * RuledSweep -- two or more similarly structured contours joined by linear rule lines.\n */\n// doc:export class SolidDOc { }\n/**\n * @docs-group-description Topology\n * The Topology classes provide adjacency structures used in triangulations.\n */\n// doc:export class TopologyDoc { }\n/**\n * @docs-group-description RangeSearch\n * Support classes for searching collections of ranges.\n */\nexport * from \"./geometry3d/Angle\";\nexport * from \"./geometry3d/AngleSweep\";\nexport * from \"./geometry3d/LongitudeLatitudeAltitude\";\nexport * from \"./geometry3d/BarycentricTriangle\";\nexport * from \"./geometry3d/BilinearPatch\";\nexport * from \"./geometry3d/Ellipsoid\";\nexport * from \"./geometry3d/FrameBuilder\";\nexport * from \"./geometry3d/FrustumAnimation\";\nexport * from \"./geometry3d/GeometryHandler\";\nexport * from \"./geometry3d/GrowableBlockedArray\";\nexport * from \"./geometry3d/GrowableFloat64Array\";\nexport * from \"./geometry3d/GrowableXYArray\";\nexport * from \"./geometry3d/GrowableXYZArray\";\nexport * from \"./geometry3d/IndexedCollectionInterval\";\nexport * from \"./geometry3d/IndexedXYCollection\";\nexport * from \"./geometry3d/IndexedXYZCollection\";\nexport * from \"./geometry3d/Matrix3d\";\nexport * from \"./geometry3d/OrderedRotationAngles\";\nexport * from \"./geometry3d/Plane3d\";\nexport * from \"./geometry3d/Plane3dByOriginAndUnitNormal\";\nexport * from \"./geometry3d/Plane3dByOriginAndVectors\";\nexport * from \"./geometry3d/Point2dArrayCarrier\";\nexport * from \"./geometry3d/Point2dVector2d\";\nexport * from \"./geometry3d/Point3dVector3d\";\nexport * from \"./geometry3d/PointHelpers\";\nexport * from \"./geometry3d/Point3dArrayCarrier\";\nexport * from \"./geometry3d/PolylineOps\";\nexport * from \"./geometry3d/PolygonOps\";\nexport * from \"./geometry3d/Range\";\nexport * from \"./geometry3d/Ray2d\";\nexport * from \"./geometry3d/Ray3d\";\nexport * from \"./geometry3d/Segment1d\";\nexport * from \"./geometry3d/Transform\";\nexport * from \"./geometry3d/UVSurfaceOps\";\nexport * from \"./geometry3d/XYZProps\";\nexport * from \"./geometry3d/YawPitchRollAngles\";\n\nexport * from \"./Geometry\";\nexport * from \"./Constant\";\nexport * from \"./clipping/BooleanClipFactory\";\nexport * from \"./clipping/ClipPlane\";\nexport * from \"./clipping/ConvexClipPlaneSet\";\nexport * from \"./clipping/UnionOfConvexClipPlaneSets\";\nexport * from \"./clipping/ClipPrimitive\";\nexport * from \"./clipping/ClipVector\";\nexport * from \"./clipping/ClipUtils\";\nexport * from \"./numerics/ConvexPolygon2d\";\nexport * from \"./geometry4d/PlaneByOriginAndVectors4d\";\nexport * from \"./geometry4d/Point4d\";\nexport * from \"./geometry4d/Matrix4d\";\nexport * from \"./geometry4d/Map4d\";\nexport * from \"./geometry4d/MomentData\";\nexport * from \"./numerics/BezierPolynomials\";\nexport * from \"./numerics/ClusterableArray\";\nexport * from \"./numerics/Complex\";\nexport * from \"./numerics/ConvexPolygon2d\";\nexport * from \"./numerics/PascalCoefficients\";\nexport * from \"./numerics/Quadrature\";\nexport * from \"./numerics/Range1dArray\";\nexport * from \"./numerics/SmallSystem\";\nexport * from \"./numerics/TriDiagonalSystem\";\n\nexport * from \"./curve/Arc3d\";\nexport * from \"./curve/ConstructCurveBetweenCurves\";\nexport * from \"./curve/CoordinateXYZ\";\nexport * from \"./curve/CurveTypes\";\nexport * from \"./curve/CurveChainWithDistanceIndex\";\nexport * from \"./curve/CurveExtendMode\";\nexport * from \"./curve/CurveCollection\";\nexport * from \"./curve/CurveCurve\";\nexport * from \"./curve/CurveLocationDetail\";\nexport * from \"./curve/CurveFactory\";\nexport * from \"./curve/CurveOps\";\nexport * from \"./curve/CurvePrimitive\";\nexport * from \"./curve/CurveProcessor\";\nexport * from \"./curve/GeometryQuery\";\nexport * from \"./curve/LineSegment3d\";\nexport * from \"./curve/LineString3d\";\nexport * from \"./curve/Loop\";\nexport * from \"./curve/OffsetOptions\";\nexport * from \"./curve/ParityRegion\";\nexport * from \"./curve/Path\";\nexport * from \"./curve/RegionMomentsXY\";\nexport * from \"./curve/RegionOps\";\nexport * from \"./curve/PointString3d\";\nexport * from \"./curve/ProxyCurve\";\nexport * from \"./curve/StrokeOptions\";\nexport * from \"./curve/spiral/TransitionSpiral3d\";\nexport * from \"./curve/spiral/IntegratedSpiral3d\";\nexport * from \"./curve/spiral/DirectSpiral3d\";\nexport * from \"./curve/UnionRegion\";\nexport * from \"./curve/Query/StrokeCountMap\";\nexport * from \"./solid/Box\";\nexport * from \"./solid/Cone\";\nexport * from \"./solid/LinearSweep\";\nexport * from \"./solid/RotationalSweep\";\nexport * from \"./solid/RuledSweep\";\nexport * from \"./solid/SolidPrimitive\";\nexport * from \"./solid/Sphere\";\nexport * from \"./solid/SweepContour\";\nexport * from \"./solid/TorusPipe\";\nexport * from \"./bspline/AkimaCurve3d\";\nexport * from \"./bspline/Bezier1dNd\";\nexport * from \"./bspline/BezierCurveBase\";\nexport * from \"./bspline/BezierCurve3d\";\nexport * from \"./bspline/BezierCurve3dH\";\nexport * from \"./bspline/BSplineCurve\";\nexport * from \"./bspline/BSplineCurveOps\";\nexport * from \"./bspline/BSpline1dNd\";\nexport * from \"./bspline/BSplineCurve3dH\";\nexport * from \"./bspline/BSplineSurface\";\nexport * from \"./bspline/InterpolationCurve3d\";\nexport * from \"./bspline/KnotVector\";\nexport * from \"./polyface/AuxData\";\nexport * from \"./polyface/BoxTopology\";\nexport * from \"./polyface/FacetFaceData\";\nexport * from \"./polyface/Polyface\";\nexport * from \"./polyface/FacetLocationDetail\";\nexport * from \"./polyface/IndexedPolyfaceVisitor\";\nexport * from \"./polyface/multiclip/GriddedRaggedRange2dSet\";\nexport * from \"./polyface/multiclip/GriddedRaggedRange2dSetWithOverflow\";\nexport * from \"./polyface/PolyfaceBuilder\";\nexport * from \"./polyface/PolyfaceData\";\nexport * from \"./polyface/PolyfaceQuery\";\nexport * from \"./polyface/PolyfaceClip\";\nexport * from \"./polyface/RangeTree/Point3dArrayRangeTreeContext\";\nexport * from \"./polyface/RangeTree/LineString3dRangeTreeContext\";\nexport * from \"./polyface/RangeTree/PolyfaceRangeTreeContext\";\nexport * from \"./polyface/TaggedNumericData\";\nexport * from \"./topology/SpaceTriangulation\";\nexport * from \"./serialization/IModelJsonSchema\";\nexport * from \"./serialization/DeepCompare\";\nexport * from \"./serialization/GeometrySamples\";\nexport * from \"./serialization/SerializationHelpers\";\nexport { BentleyGeometryFlatBuffer } from \"./serialization/BentleyGeometryFlatBuffer\";\n"]}
|
|
1
|
+
{"version":3,"file":"core-geometry.js","sourceRoot":"","sources":["../../src/core-geometry.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;;AAE/F;;GAEG;AAEH,UAAU;AACV,+GAA+G;AAC/G,wDAAwD;AACxD,+FAA+F;AAC/F,6HAA6H;AAC7H,kEAAkE;AAElE;;;GAGG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,4CAA4C;AAC5C;;;;;;;;;GASG;AACH,8CAA8C;AAE9C;;;;;;;;GAQG;AACH,kCAAkC;AAElC;;;;;;;;;;;;GAYG;AACH,gCAAgC;AAChC;;;GAGG;AACH,mCAAmC;AACnC;;;GAGG;AACH,mCAAmC;AACnC;;;;GAIG;AACH,wCAAwC;AACxC;;;;;;;;;;GAUG;AACH,gCAAgC;AAChC;;;GAGG;AACH,mCAAmC;AACnC;;;GAGG;AACH,qDAAmC;AACnC,0DAAwC;AACxC,yEAAuD;AACvD,mEAAiD;AACjD,6DAA2C;AAC3C,yDAAuC;AACvC,4DAA0C;AAC1C,gEAA8C;AAC9C,+DAA6C;AAC7C,oEAAkD;AAClD,oEAAkD;AAClD,+DAA6C;AAC7C,gEAA8C;AAC9C,yEAAuD;AACvD,mEAAiD;AACjD,oEAAkD;AAClD,wDAAsC;AACtC,qEAAmD;AACnD,uDAAqC;AACrC,4EAA0D;AAC1D,yEAAuD;AACvD,mEAAiD;AACjD,+DAA6C;AAC7C,+DAA6C;AAC7C,4DAA0C;AAC1C,mEAAiD;AACjD,2DAAyC;AACzC,0DAAwC;AACxC,qDAAmC;AACnC,qDAAmC;AACnC,qDAAmC;AACnC,yDAAu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ACpC,iEAA+C;AAC/C,oEAAkD;AAClD,mEAAiD;AACjD,+EAA6D;AAC7D,2FAAyE;AACzE,6DAA2C;AAC3C,0DAAwC;AACxC,2DAAyC;AACzC,0DAAwC;AACxC,oFAAkE;AAClE,oFAAkE;AAClE,gFAA8D;AAC9D,+DAA6C;AAC7C,gEAA8C;AAC9C,mEAAiD;AACjD,8DAA4C;AAC5C,kEAAgD;AAChD,uEAAqD;AACrD,uFAAsF;AAA7E,sIAAA,yBAAyB,OAAA","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 Utility\n */\n\n// REMARK:\n// The docs-group-description comments are followed by empty classes with names corresponding to the doc-group.\n// Normally (in committed code) these are commented out.\n// The comments have distinctive strings so that simple search and replace can make the \"real\".\n// This is useful when working on the documentation: When the empty classes are present, VSCode will format the doc comments\n// for and display them when the mouse hovers over the class name.\n\n/**\n * @docs-package-description\n * The core-geometry package contains classes for working with geometry: points, vectors, curves, surfaces, and analytic solids\n */\n/**\n * @docs-group-description CartesianGeometry\n * Points, Vectors, Planes, and Transformations for x,y,z geometry.\n * * Fundamental cartesian geometry objects:\n * * Point2d, Point3d -- points with x,y,z coordinates\n * * Vector2d, Vector3d -- vectors with x,y,z coordinates\n * * Matrix3d -- 3x3 matrix\n * * * commonly used for pure rotations\n * * * scale and skew entries are also allowed.\n * * Transform -- an origin and axes.\n * * Range1d, Range2d, Range3d -- subsets of 1d, 2d, and 3d space bounded by low and high values.\n * * Ray3d -- a ray defined by origin and direction vector\n * * Plane3d -- an abstract base class extended by Plane3dByOriginAndNormal, Plane3dByOriginAndUnitNormal, Point4d, and ClipPlane\n * * Plane3dByOriginAndUnitNormal -- a plane defined by an origin and a single vector which is perpendicular to the plane\n * * plane3dByOriginAndVectors -- a plane defined by an origin and two vectors in the plane.\n * * Angles\n * * Angle -- a strongly typed angle object whose method names make it clear whether input and outputs are degrees or radians.\n * * AngleSweep -- an angular interval\n * * LatitudeLongitudeNumber -- carrier for position and altitude on sphere or ellipsoid\n * * YawPitchAndRollAngles -- 3 angles that define a rotated coordinate system.\n * * Utility classes\n * * FrameBuilder -- construction of coordinate frames from mixed data sources.\n * * ClipPlane -- a single plane\n * * ConvexClipPlaneSet -- an array of planes bounding a convex volume\n * * ClipPlaneSet -- an array of ConvexClipPlaneSet, defining the union of their volumes\n * * BilinearPatch -- twisted quadrilateral defined by 4 points\n * * BarycentricTriangle -- triangle defined by 3 points.\n * * Constant -- various numeric values exported as readonly constants\n */\n// doc:export class CartesianGeometryDoc { }\n/**\n * @docs-group-description ArraysAndInterfaces\n * These classes support array operations and inheritance-based algorithms.\n * * Arrays\n * * GrowableArray -- A carrier for a Float64Array, with methods that hide reallocation of the underlying array as contents are added.\n * * Point2dArray, Point3dArray, Point4dArray, Vector3dArray -- miscellaneous operations on arrays of 2d and 3d points.\n * * Interfaces\n * * GeometryHandler -- a double-dispatch protocol used for efficient implementation of algorithms that work on many geometry types.\n *\n */\n// doc:export class ArraysAndInterfacesDoc { }\n\n/**\n * @docs-group-description Bspline\n * A bspline curve or surface is used for curved freeform geometry defined by controls points (sometimes called poles).\n * * BSplineCurve -- a curve defined by control points (which are not on the curve)\n * * InterpolationCurve -- a curve defined by passthrough points, with \"good\" visual properties\n * * BSplineSurfaceXYZ -- a surface with XYZ\n * * BsplineSurfaceXYZW -- a surface with weighted (rational) XYZ coordinates\n * * KnotVector -- vector of breakpoints in bspline definitions.\n */\n// doc:export class BsplineDoc { }\n\n/**\n * @docs-group-description Curve\n * Curves in the GeometryQuery hierarchy: LineSegment3d, LineString3d, Arc3d, TransitionSpiral3d\n * * CurvePrimitive -- base class for parametric curves\n * * LineSegment3d -- a (bounded) portion of an unbounded line\n * * Arc3d -- a circular or elliptic arc\n * * LineString3d -- a sequence of points joined by line segments\n * * TransitionSpiral -- controlled transition between curvatures\n * * Support classes\n * * PointString3d -- a sequence of isolated points\n * * StrokeOptions -- tolerances to describe stroking accuracy\n * * RecursiveCurveProcessor, RecursiveCurveProcessorWithStack -- algorithmic support for trees with CurvePrimitives at the leaf level.\n */\n// doc:export class CurveDoc { }\n/**\n * @docs-group-description Numerics\n * The Numerics classes have geometric and numeric methods used during large algorithms in other classes.\n */\n// doc:export class NumericsDoc { }\n/**\n * @docs-group-description Polyface\n * A Polyface is a mesh structure with arrays of points that are shared among multiple incident facets.\n */\n// doc:export class PolyfaceDoc { }\n/**\n * @docs-group-description Serialization\n * These classes are related to serialization of geometry classes.\n * * IModelJson.Reader, IModelJson.Writer -- Conversion of in-memory geometry objects to json objects for persistence and transmission.\n */\n// doc:export class SerializationDoc { }\n/**\n * @docs-group-description Solid\n * Analytic Solids in the GeometryQuery hierarchy: Box, Sphere, Cone, TorusPipe, LinearSweep, RotationalSweep, RuledSweep\n * * Box -- a box solid. This is usually rectangular on all faces, but can in one directly like a view frustum\n * * Sphere -- a sphere\n * * Cone -- a cone or cylinder\n * * TorusPipe -- a pipe elbow\n * * LinearSweep -- a linear sweep of a base contour\n * * RotationalSweep -- a rotational sweep of a base contour\n * * RuledSweep -- two or more similarly structured contours joined by linear rule lines.\n */\n// doc:export class SolidDOc { }\n/**\n * @docs-group-description Topology\n * The Topology classes provide adjacency structures used in triangulations.\n */\n// doc:export class TopologyDoc { }\n/**\n * @docs-group-description RangeSearch\n * Support classes for searching collections of ranges.\n */\nexport * from \"./geometry3d/Angle\";\nexport * from \"./geometry3d/AngleSweep\";\nexport * from \"./geometry3d/LongitudeLatitudeAltitude\";\nexport * from \"./geometry3d/BarycentricTriangle\";\nexport * from \"./geometry3d/BilinearPatch\";\nexport * from \"./geometry3d/Ellipsoid\";\nexport * from \"./geometry3d/FrameBuilder\";\nexport * from \"./geometry3d/FrustumAnimation\";\nexport * from \"./geometry3d/GeometryHandler\";\nexport * from \"./geometry3d/GrowableBlockedArray\";\nexport * from \"./geometry3d/GrowableFloat64Array\";\nexport * from \"./geometry3d/GrowableXYArray\";\nexport * from \"./geometry3d/GrowableXYZArray\";\nexport * from \"./geometry3d/IndexedCollectionInterval\";\nexport * from \"./geometry3d/IndexedXYCollection\";\nexport * from \"./geometry3d/IndexedXYZCollection\";\nexport * from \"./geometry3d/Matrix3d\";\nexport * from \"./geometry3d/OrderedRotationAngles\";\nexport * from \"./geometry3d/Plane3d\";\nexport * from \"./geometry3d/Plane3dByOriginAndUnitNormal\";\nexport * from \"./geometry3d/Plane3dByOriginAndVectors\";\nexport * from \"./geometry3d/Point2dArrayCarrier\";\nexport * from \"./geometry3d/Point2dVector2d\";\nexport * from \"./geometry3d/Point3dVector3d\";\nexport * from \"./geometry3d/PointHelpers\";\nexport * from \"./geometry3d/Point3dArrayCarrier\";\nexport * from \"./geometry3d/PolylineOps\";\nexport * from \"./geometry3d/PolygonOps\";\nexport * from \"./geometry3d/Range\";\nexport * from \"./geometry3d/Ray2d\";\nexport * from \"./geometry3d/Ray3d\";\nexport * from \"./geometry3d/Segment1d\";\nexport * from \"./geometry3d/Transform\";\nexport * from \"./geometry3d/UVSurfaceOps\";\nexport * from \"./geometry3d/XYZProps\";\nexport * from \"./geometry3d/YawPitchRollAngles\";\n\nexport * from \"./Geometry\";\nexport * from \"./Constant\";\nexport * from \"./clipping/BooleanClipFactory\";\nexport * from \"./clipping/ClipPlane\";\nexport * from \"./clipping/ConvexClipPlaneSet\";\nexport * from \"./clipping/UnionOfConvexClipPlaneSets\";\nexport * from \"./clipping/ClipPrimitive\";\nexport * from \"./clipping/ClipVector\";\nexport * from \"./clipping/ClipUtils\";\nexport * from \"./numerics/ConvexPolygon2d\";\nexport * from \"./geometry4d/PlaneByOriginAndVectors4d\";\nexport * from \"./geometry4d/Point4d\";\nexport * from \"./geometry4d/Matrix4d\";\nexport * from \"./geometry4d/Map4d\";\nexport * from \"./geometry4d/MomentData\";\nexport * from \"./numerics/BezierPolynomials\";\nexport * from \"./numerics/ClusterableArray\";\nexport * from \"./numerics/Complex\";\nexport * from \"./numerics/ConvexPolygon2d\";\nexport * from \"./numerics/PascalCoefficients\";\nexport * from \"./numerics/Quadrature\";\nexport * from \"./numerics/Range1dArray\";\nexport * from \"./numerics/SmallSystem\";\nexport * from \"./numerics/TriDiagonalSystem\";\n\nexport * from \"./curve/Arc3d\";\nexport * from \"./curve/ConstructCurveBetweenCurves\";\nexport * from \"./curve/CoordinateXYZ\";\nexport * from \"./curve/CurveTypes\";\nexport * from \"./curve/CurveChainWithDistanceIndex\";\nexport * from \"./curve/CurveExtendMode\";\nexport * from \"./curve/CurveCollection\";\nexport * from \"./curve/CurveCurve\";\nexport * from \"./curve/CurveLocationDetail\";\nexport * from \"./curve/CurveFactory\";\nexport * from \"./curve/CurveOps\";\nexport * from \"./curve/CurvePrimitive\";\nexport * from \"./curve/CurveProcessor\";\nexport * from \"./curve/GeometryQuery\";\nexport * from \"./curve/LineSegment3d\";\nexport * from \"./curve/LineString3d\";\nexport * from \"./curve/Loop\";\nexport * from \"./curve/OffsetOptions\";\nexport * from \"./curve/ParityRegion\";\nexport * from \"./curve/Path\";\nexport * from \"./curve/RegionMomentsXY\";\nexport * from \"./curve/RegionOps\";\nexport * from \"./curve/PointString3d\";\nexport * from \"./curve/ProxyCurve\";\nexport * from \"./curve/StrokeOptions\";\nexport * from \"./curve/spiral/TransitionSpiral3d\";\nexport * from \"./curve/spiral/IntegratedSpiral3d\";\nexport * from \"./curve/spiral/DirectSpiral3d\";\nexport * from \"./curve/UnionRegion\";\nexport * from \"./curve/Query/StrokeCountMap\";\nexport * from \"./solid/Box\";\nexport * from \"./solid/Cone\";\nexport * from \"./solid/LinearSweep\";\nexport * from \"./solid/RotationalSweep\";\nexport * from \"./solid/RuledSweep\";\nexport * from \"./solid/SolidPrimitive\";\nexport * from \"./solid/Sphere\";\nexport * from \"./solid/SweepContour\";\nexport * from \"./solid/TorusPipe\";\nexport * from \"./bspline/AkimaCurve3d\";\nexport * from \"./bspline/Bezier1dNd\";\nexport * from \"./bspline/BezierCurveBase\";\nexport * from \"./bspline/BezierCurve3d\";\nexport * from \"./bspline/BezierCurve3dH\";\nexport * from \"./bspline/BSplineCurve\";\nexport * from \"./bspline/BSplineCurveOps\";\nexport * from \"./bspline/BSpline1dNd\";\nexport * from \"./bspline/BSplineCurve3dH\";\nexport * from \"./bspline/BSplineSurface\";\nexport * from \"./bspline/InterpolationCurve3d\";\nexport * from \"./bspline/KnotVector\";\nexport * from \"./polyface/AuxData\";\nexport * from \"./polyface/BoxTopology\";\nexport * from \"./polyface/FacetFaceData\";\nexport * from \"./polyface/Polyface\";\nexport * from \"./polyface/FacetLocationDetail\";\nexport * from \"./polyface/IndexedPolyfaceVisitor\";\nexport * from \"./polyface/IndexedPolyfaceWalker\";\nexport * from \"./polyface/multiclip/GriddedRaggedRange2dSet\";\nexport * from \"./polyface/multiclip/GriddedRaggedRange2dSetWithOverflow\";\nexport * from \"./polyface/PolyfaceBuilder\";\nexport * from \"./polyface/PolyfaceData\";\nexport * from \"./polyface/PolyfaceQuery\";\nexport * from \"./polyface/PolyfaceClip\";\nexport * from \"./polyface/RangeTree/Point3dArrayRangeTreeContext\";\nexport * from \"./polyface/RangeTree/LineString3dRangeTreeContext\";\nexport * from \"./polyface/RangeTree/PolyfaceRangeTreeContext\";\nexport * from \"./polyface/TaggedNumericData\";\nexport * from \"./topology/SpaceTriangulation\";\nexport * from \"./serialization/IModelJsonSchema\";\nexport * from \"./serialization/DeepCompare\";\nexport * from \"./serialization/GeometrySamples\";\nexport * from \"./serialization/SerializationHelpers\";\nexport { BentleyGeometryFlatBuffer } from \"./serialization/BentleyGeometryFlatBuffer\";\n"]}
|
package/lib/cjs/curve/Arc3d.js
CHANGED
|
@@ -340,7 +340,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
|
|
|
340
340
|
const v1DotV90 = vector1.dotProduct(vector90);
|
|
341
341
|
// solve the standard ellipse equation for the unknown axis length, given local coords of middle (v0.v1/||v0||, v90.v1)
|
|
342
342
|
const v90Len = Geometry_1.Geometry.safeDivideFraction(v0Len2 * v1DotV90, Math.sqrt(v0Len2 * v0Len2 - v0DotV1 * v0DotV1), 0);
|
|
343
|
-
if (Geometry_1.Geometry.isSmallMetricDistanceSquared(v90Len))
|
|
343
|
+
if (Geometry_1.Geometry.isSmallMetricDistanceSquared(v90Len)) // tighter than smallMetricDistance to allow flatter long elliptical arcs
|
|
344
344
|
return undefined;
|
|
345
345
|
vector90.scaleInPlace(v90Len);
|
|
346
346
|
return Arc3d.create(center, vector0, vector90, sweep, result);
|