@itwin/core-geometry 5.0.0-dev.93 → 5.0.0-dev.95
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/lib/cjs/curve/StrokeOptions.d.ts +6 -1
- package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js +7 -2
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.d.ts +8 -7
- package/lib/cjs/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +17 -16
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts +11 -0
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +21 -0
- package/lib/cjs/geometry3d/PointHelpers.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 +5 -3
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts +27 -23
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +47 -37
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +8 -3
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +26 -4
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.d.ts +35 -9
- package/lib/cjs/serialization/BGFBAccessors.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.js +59 -15
- package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.d.ts +2 -2
- package/lib/cjs/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js +53 -40
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.d.ts +5 -1
- package/lib/cjs/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js +17 -3
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js +1 -0
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts +8 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js +20 -9
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.d.ts +36 -0
- package/lib/cjs/serialization/SerializationHelpers.d.ts.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.js +117 -0
- package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
- package/lib/cjs/solid/Sphere.d.ts +4 -2
- package/lib/cjs/solid/Sphere.d.ts.map +1 -1
- package/lib/cjs/solid/Sphere.js +4 -2
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts +6 -1
- package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/esm/curve/StrokeOptions.js +7 -2
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.d.ts +8 -7
- package/lib/esm/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +17 -16
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts +11 -0
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +21 -0
- package/lib/esm/geometry3d/PointHelpers.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 +5 -3
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts +27 -23
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +47 -37
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +8 -3
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js +26 -4
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.d.ts +35 -9
- package/lib/esm/serialization/BGFBAccessors.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.js +59 -15
- package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.d.ts +2 -2
- package/lib/esm/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBReader.js +53 -40
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.d.ts +5 -1
- package/lib/esm/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js +17 -3
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js +1 -0
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts +8 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js +20 -9
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.d.ts +36 -0
- package/lib/esm/serialization/SerializationHelpers.d.ts.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.js +117 -0
- package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
- package/lib/esm/solid/Sphere.d.ts +4 -2
- package/lib/esm/solid/Sphere.d.ts.map +1 -1
- package/lib/esm/solid/Sphere.js +4 -2
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/package.json +3 -3
|
@@ -78,6 +78,42 @@ export declare namespace SerializationHelpers {
|
|
|
78
78
|
* @param terminateBlock optional callback called after each index block has been announced
|
|
79
79
|
*/
|
|
80
80
|
function announceZeroBasedIndicesWithExternalBlocking(sourceIndices: Int32Array, blockingIndices: Int32Array, numPerBlock: number, announceZeroBasedIndex: (i0: number) => any, terminateBlock?: () => any): void;
|
|
81
|
+
/** Special values for persistent zero-based edge mate indices. */
|
|
82
|
+
enum EdgeMateIndex {
|
|
83
|
+
/** Separates face loops. */
|
|
84
|
+
BlockSeparator = -1,
|
|
85
|
+
/** Indicates no edge mate. */
|
|
86
|
+
NoEdgeMate = -2
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Compress a 0-based blocked index array by removing block separators/pads and remapping each index.
|
|
90
|
+
* * The entries of `sourceIndices` are reflexive indices, i.e., they index `sourceIndices`.
|
|
91
|
+
* * The remapped index `j` must refer to the same block location in the compressed array to which the
|
|
92
|
+
* original index `i >= 0` refers in `sourceIndices`; therefore `j` is obtained from `i` by subtracting the
|
|
93
|
+
* number of block separators/pads preceding `sourceIndices[i]`.
|
|
94
|
+
* @param sourceIndices array of blocked indices to process. Each entry is a 0-based reflexive index, `nullValue`, or `blockSeparator`.
|
|
95
|
+
* @param numPerBlock index blocking for sourceIndices: padded block size > 2 or variable-sized terminated blocks.
|
|
96
|
+
* @param blockSeparator negative value that terminates/pads blocks in sourceIndices, e.g. -1. This value is not announced.
|
|
97
|
+
* @param nullValue negative value that represents "no index" in sourceIndices, e.g., -2. This value is announced as "undefined".
|
|
98
|
+
* @param announceRemappedIndex callback to receive a remapped index.
|
|
99
|
+
* @returns true if and only if the mapping was successful.
|
|
100
|
+
*/
|
|
101
|
+
function announceCompressedZeroBasedReflexiveIndices(sourceIndices: Int32Array, numPerBlock: number, blockSeparator: number, nullValue: number, announceRemappedIndex: (i: number | undefined) => any): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Uncompress a 0-based index array by inserting block separators and remapping each index.
|
|
104
|
+
* * Defined entries of `sourceIndices` are reflexive indices, i.e., they index `sourceIndices`.
|
|
105
|
+
* * The remapped index `j` must refer to the same block location in the uncompressed array to which the
|
|
106
|
+
* original defined index `i` refers in `sourceIndices`; therefore `j` is obtained from `i` by adding the
|
|
107
|
+
* number of full blocks preceding `sourceIndices[i]`.
|
|
108
|
+
* @param sourceIndices array of compressed indices to process. Each entry is a 0-based reflexive index, or `undefined`.
|
|
109
|
+
* @param sourceStarts sourceStarts[k] is the first index of the k_th block in `sourceIndices`; its last entry is the
|
|
110
|
+
* length of `sourceIndices`.
|
|
111
|
+
* @param blockSeparator negative value that represents an announced block terminator, e.g. -1.
|
|
112
|
+
* @param nullValue negative value to announce for an undefined source index, e.g., -2.
|
|
113
|
+
* @param announceRemappedIndex callback to receive a remapped index.
|
|
114
|
+
* @returns true if and only if the mapping was successful.
|
|
115
|
+
*/
|
|
116
|
+
function announceUncompressedZeroBasedReflexiveIndices(sourceIndices: Array<number | undefined>, sourceStarts: ReadonlyArray<number>, blockSeparator: number, nullValue: number, announceRemappedIndex: (i: number) => any): boolean;
|
|
81
117
|
/** Helper class for preparing geometry data for import. */
|
|
82
118
|
class Import {
|
|
83
119
|
/** copy knots, with options to control destination type and extraneous knot removal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SerializationHelpers.d.ts","sourceRoot":"","sources":["../../../src/serialization/SerializationHelpers.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAE,eAAe,EAAc,MAAM,uBAAuB,CAAC;AAGpE;;;GAGG;AACH,yBAAiB,oBAAoB,CAAC;IACpC,iEAAiE;IACjE,UAAiB,aAAa;QAC5B,+CAA+C;QAC/C,QAAQ,EAAE,MAAM,CAAC;QACjB,gDAAgD;QAChD,KAAK,EAAE,MAAM,CAAC;QACd,uDAAuD;QACvD,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,wBAAwB;QACxB,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC;QAC/B,qCAAqC;QACrC,QAAQ,CAAC,EAAE,eAAe,CAAC;KAC5B;IACD,yCAAyC;IACzC,UAAiB,gBAAgB;QAC/B,iCAAiC;QACjC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,YAAY,CAAC;QACjC,8MAA8M;QAC9M,GAAG,EAAE,MAAM,CAAC;QACZ,iLAAiL;QACjL,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC;QAClC,qCAAqC;QACrC,MAAM,EAAE,aAAa,CAAC;KACvB;IACD,2CAA2C;IAC3C,UAAiB,kBAAkB;QACjC,oDAAoD;QACpD,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,YAAY,CAAC;QACnC,gNAAgN;QAChN,GAAG,EAAE,MAAM,CAAC;QACZ,mLAAmL;QACnL,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,YAAY,CAAC;QACpC,iJAAiJ;QACjJ,OAAO,EAAE,aAAa,CAAC;QACvB,6IAA6I;QAC7I,OAAO,EAAE,aAAa,CAAC;KACxB;IACD,8CAA8C;IAC9C,UAAiB,kBAAkB;QACjC,gHAAgH;QAChH,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,8FAA8F;QAC9F,SAAS,CAAC,EAAE,OAAO,CAAC;Q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;IAC3D,MAAa,MAAM;QACjB,uFAAuF;QACvF,OAAO,CAAC,MAAM,CAAC,SAAS;QAkBxB;;;;;;;;;;;;;WAaG;QACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;QAmBtC;;;;;;WAMG;eACW,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;QA+CpG;;;;;;WAMG;eACW,yBAAyB,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;KA0FzG;IAED,2DAA2D;IAC3D,MAAa,MAAM;QACjB;;;;;;;;WAQG;QACH,OAAO,CAAC,MAAM,CAAC,wBAAwB;QA0BvC;;;;;;;WAOG;eACW,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;QA6CpG;;;;;;;WAOG;eACW,yBAAyB,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;KAgFzG;CACF"}
|
|
1
|
+
{"version":3,"file":"SerializationHelpers.d.ts","sourceRoot":"","sources":["../../../src/serialization/SerializationHelpers.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAE,eAAe,EAAc,MAAM,uBAAuB,CAAC;AAGpE;;;GAGG;AACH,yBAAiB,oBAAoB,CAAC;IACpC,iEAAiE;IACjE,UAAiB,aAAa;QAC5B,+CAA+C;QAC/C,QAAQ,EAAE,MAAM,CAAC;QACjB,gDAAgD;QAChD,KAAK,EAAE,MAAM,CAAC;QACd,uDAAuD;QACvD,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,wBAAwB;QACxB,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC;QAC/B,qCAAqC;QACrC,QAAQ,CAAC,EAAE,eAAe,CAAC;KAC5B;IACD,yCAAyC;IACzC,UAAiB,gBAAgB;QAC/B,iCAAiC;QACjC,KA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MAAM,KAAK,GAAG,GACxC,OAAO,CAmBT;IAED,2DAA2D;IAC3D,MAAa,MAAM;QACjB,uFAAuF;QACvF,OAAO,CAAC,MAAM,CAAC,SAAS;QAkBxB;;;;;;;;;;;;;WAaG;QACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;QAmBtC;;;;;;WAMG;eACW,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;QA+CpG;;;;;;WAMG;eACW,yBAAyB,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;KA0FzG;IAED,2DAA2D;IAC3D,MAAa,MAAM;QACjB;;;;;;;;WAQG;QACH,OAAO,CAAC,MAAM,CAAC,wBAAwB;QA0BvC;;;;;;;WAOG;eACW,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;QA6CpG;;;;;;;WAOG;eACW,yBAAyB,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;KAgFzG;CACF"}
|
|
@@ -309,6 +309,123 @@ var SerializationHelpers;
|
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
311
|
SerializationHelpers.announceZeroBasedIndicesWithExternalBlocking = announceZeroBasedIndicesWithExternalBlocking;
|
|
312
|
+
/** Special values for persistent zero-based edge mate indices. */
|
|
313
|
+
let EdgeMateIndex;
|
|
314
|
+
(function (EdgeMateIndex) {
|
|
315
|
+
/** Separates face loops. */
|
|
316
|
+
EdgeMateIndex[EdgeMateIndex["BlockSeparator"] = -1] = "BlockSeparator";
|
|
317
|
+
/** Indicates no edge mate. */
|
|
318
|
+
EdgeMateIndex[EdgeMateIndex["NoEdgeMate"] = -2] = "NoEdgeMate";
|
|
319
|
+
})(EdgeMateIndex = SerializationHelpers.EdgeMateIndex || (SerializationHelpers.EdgeMateIndex = {}));
|
|
320
|
+
;
|
|
321
|
+
/**
|
|
322
|
+
* Build two index arrays into a source array:
|
|
323
|
+
* * `sourceStarts[k]` is the first index of the k_th block in `sourceIndices`.
|
|
324
|
+
* * `compressedStarts[k]` is the first index of the k_th block in a compressed clone `C` of `sourceIndices`
|
|
325
|
+
* with all pads/terminators removed.
|
|
326
|
+
* * The last entry of `sourceStarts`/`compressedStarts` is the length of `sourceIndices`/`C`.
|
|
327
|
+
* @returns `undefined` if invalid inputs, or the two computed arrays of block start indices.
|
|
328
|
+
*/
|
|
329
|
+
function buildBlockStartIndices(sourceIndices, numPerBlock, blockSeparator) {
|
|
330
|
+
if (sourceIndices.length === 0 || sourceIndices[0] === blockSeparator)
|
|
331
|
+
return undefined;
|
|
332
|
+
const sourceStarts = [];
|
|
333
|
+
const compressedStarts = [];
|
|
334
|
+
sourceStarts.push(0);
|
|
335
|
+
compressedStarts.push(0);
|
|
336
|
+
const getBlockLength = (iBlockStart) => {
|
|
337
|
+
if (sourceIndices[iBlockStart] === blockSeparator)
|
|
338
|
+
return 0;
|
|
339
|
+
for (let i = iBlockStart + 1; i < sourceIndices.length; i++) {
|
|
340
|
+
if ((sourceIndices[i - 1] !== blockSeparator && sourceIndices[i] === blockSeparator) || (numPerBlock > 2 && (i % numPerBlock === 0)))
|
|
341
|
+
return i - iBlockStart;
|
|
342
|
+
if (i === sourceIndices.length - 1) // last fixed block, or unterminated last variable block
|
|
343
|
+
return sourceIndices.length - iBlockStart;
|
|
344
|
+
}
|
|
345
|
+
return 0;
|
|
346
|
+
};
|
|
347
|
+
for (let i = 0; i < sourceIndices.length;) {
|
|
348
|
+
const blockLength = getBlockLength(i);
|
|
349
|
+
if (blockLength <= 0)
|
|
350
|
+
return undefined;
|
|
351
|
+
i += blockLength;
|
|
352
|
+
for (; i < sourceIndices.length && sourceIndices[i] === blockSeparator; i++)
|
|
353
|
+
;
|
|
354
|
+
sourceStarts.push(i);
|
|
355
|
+
compressedStarts.push(compressedStarts[compressedStarts.length - 1] + blockLength);
|
|
356
|
+
}
|
|
357
|
+
return { sourceStarts, compressedStarts };
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Compress a 0-based blocked index array by removing block separators/pads and remapping each index.
|
|
361
|
+
* * The entries of `sourceIndices` are reflexive indices, i.e., they index `sourceIndices`.
|
|
362
|
+
* * The remapped index `j` must refer to the same block location in the compressed array to which the
|
|
363
|
+
* original index `i >= 0` refers in `sourceIndices`; therefore `j` is obtained from `i` by subtracting the
|
|
364
|
+
* number of block separators/pads preceding `sourceIndices[i]`.
|
|
365
|
+
* @param sourceIndices array of blocked indices to process. Each entry is a 0-based reflexive index, `nullValue`, or `blockSeparator`.
|
|
366
|
+
* @param numPerBlock index blocking for sourceIndices: padded block size > 2 or variable-sized terminated blocks.
|
|
367
|
+
* @param blockSeparator negative value that terminates/pads blocks in sourceIndices, e.g. -1. This value is not announced.
|
|
368
|
+
* @param nullValue negative value that represents "no index" in sourceIndices, e.g., -2. This value is announced as "undefined".
|
|
369
|
+
* @param announceRemappedIndex callback to receive a remapped index.
|
|
370
|
+
* @returns true if and only if the mapping was successful.
|
|
371
|
+
*/
|
|
372
|
+
function announceCompressedZeroBasedReflexiveIndices(sourceIndices, numPerBlock, blockSeparator, nullValue, announceRemappedIndex) {
|
|
373
|
+
if (!sourceIndices.length || blockSeparator >= 0 || nullValue >= 0 || (blockSeparator === nullValue))
|
|
374
|
+
return false;
|
|
375
|
+
// remapped index = source index - # preceding terminators/pads in sourceIndices
|
|
376
|
+
// Instead of counting terminators/pads, we use a pair of block start index arrays
|
|
377
|
+
const blocking = buildBlockStartIndices(sourceIndices, numPerBlock, blockSeparator);
|
|
378
|
+
if (!blocking)
|
|
379
|
+
return false;
|
|
380
|
+
for (const index of sourceIndices) {
|
|
381
|
+
if (index === nullValue)
|
|
382
|
+
announceRemappedIndex(undefined);
|
|
383
|
+
else if (index >= 0) {
|
|
384
|
+
const iBlock = PointHelpers_1.NumberArray.searchStrictlyIncreasingNumbers(blocking.sourceStarts, index);
|
|
385
|
+
if (iBlock === undefined)
|
|
386
|
+
return false;
|
|
387
|
+
const blockOffset = index - blocking.sourceStarts[iBlock];
|
|
388
|
+
announceRemappedIndex(blocking.compressedStarts[iBlock] + blockOffset);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
return true;
|
|
392
|
+
}
|
|
393
|
+
SerializationHelpers.announceCompressedZeroBasedReflexiveIndices = announceCompressedZeroBasedReflexiveIndices;
|
|
394
|
+
/**
|
|
395
|
+
* Uncompress a 0-based index array by inserting block separators and remapping each index.
|
|
396
|
+
* * Defined entries of `sourceIndices` are reflexive indices, i.e., they index `sourceIndices`.
|
|
397
|
+
* * The remapped index `j` must refer to the same block location in the uncompressed array to which the
|
|
398
|
+
* original defined index `i` refers in `sourceIndices`; therefore `j` is obtained from `i` by adding the
|
|
399
|
+
* number of full blocks preceding `sourceIndices[i]`.
|
|
400
|
+
* @param sourceIndices array of compressed indices to process. Each entry is a 0-based reflexive index, or `undefined`.
|
|
401
|
+
* @param sourceStarts sourceStarts[k] is the first index of the k_th block in `sourceIndices`; its last entry is the
|
|
402
|
+
* length of `sourceIndices`.
|
|
403
|
+
* @param blockSeparator negative value that represents an announced block terminator, e.g. -1.
|
|
404
|
+
* @param nullValue negative value to announce for an undefined source index, e.g., -2.
|
|
405
|
+
* @param announceRemappedIndex callback to receive a remapped index.
|
|
406
|
+
* @returns true if and only if the mapping was successful.
|
|
407
|
+
*/
|
|
408
|
+
function announceUncompressedZeroBasedReflexiveIndices(sourceIndices, sourceStarts, blockSeparator, nullValue, announceRemappedIndex) {
|
|
409
|
+
if (!sourceIndices.length || sourceStarts.length < 2 || blockSeparator >= 0 || nullValue >= 0 || (blockSeparator === nullValue))
|
|
410
|
+
return false;
|
|
411
|
+
// remapped index = source index + # preceding blocks in sourceIndices
|
|
412
|
+
for (let i = 0; i < sourceStarts.length - 1; i++) {
|
|
413
|
+
for (let j = sourceStarts[i]; j < sourceStarts[i + 1]; j++) {
|
|
414
|
+
const index = sourceIndices[j];
|
|
415
|
+
if (index === undefined)
|
|
416
|
+
announceRemappedIndex(nullValue);
|
|
417
|
+
else if (index >= 0) {
|
|
418
|
+
const iBlock = PointHelpers_1.NumberArray.searchStrictlyIncreasingNumbers(sourceStarts, index);
|
|
419
|
+
if (iBlock === undefined)
|
|
420
|
+
return false;
|
|
421
|
+
announceRemappedIndex(index + iBlock);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
announceRemappedIndex(blockSeparator);
|
|
425
|
+
}
|
|
426
|
+
return true;
|
|
427
|
+
}
|
|
428
|
+
SerializationHelpers.announceUncompressedZeroBasedReflexiveIndices = announceUncompressedZeroBasedReflexiveIndices;
|
|
312
429
|
/** Helper class for preparing geometry data for import. */
|
|
313
430
|
class Import {
|
|
314
431
|
/** copy knots, with options to control destination type and extraneous knot removal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SerializationHelpers.js","sourceRoot":"","sources":["../../../src/serialization/SerializationHelpers.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,sDAAoE;AACpE,6DAAyD;AAEzD;;;GAGG;AACH,IAAiB,oBAAoB,CAquBpC;AAruBD,WAAiB,oBAAoB;IAgDnC,0GAA0G;IAC1G,SAAgB,sBAAsB,CAAC,KAAgC,EAAE,GAAW,EAAE,KAA8B,EAAE,QAAgB,EAAE,KAAa;QACnJ,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC;IAC5D,CAAC;IAFe,2CAAsB,yBAErC,CAAA;IAED,4GAA4G;IAC5G,SAAgB,wBAAwB,CAAC,KAAkC,EAAE,GAAW,EAAE,MAA+B,EAAE,SAAiB,EAAE,MAAc,EAAE,MAA+B,EAAE,SAAiB,EAAE,MAAc;QAC9N,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,QAAQ,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+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC/C,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IAjLY,2BAAM,SAiLlB,CAAA;AACH,CAAC,EAruBgB,oBAAoB,oCAApB,oBAAoB,QAquBpC","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 Serialization\n */\nimport { BSplineWrapMode, KnotVector } from \"../bspline/KnotVector\";\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\n\n/**\n * The `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry, such as B-spline curves and surfaces.\n * @public\n */\nexport namespace SerializationHelpers {\n /** Interface for data common to B-spline curves and surfaces. */\n export interface BSplineParams {\n /** The number of control points, aka poles. */\n numPoles: number;\n /** B-spline order, one more than the degree. */\n order: number;\n /** Whether the B-spline is to be considered closed. */\n closed?: boolean;\n /** Full knot vector. */\n knots: number[] | Float64Array;\n /** Wrap mode, for data roundtrip. */\n wrapMode?: BSplineWrapMode;\n }\n /** Interface for B-spline curve data. */\n export interface BSplineCurveData {\n /** Control points, aka poles. */\n poles: number[][] | Float64Array;\n /** The number of coordinates per pole. This is the inner dimension of the poles number array. Possible values: 3, 4. Dimension 4 means the curve is rational, with poles of homogeneous form [wx,wy,wz,w]. */\n dim: number;\n /** Weights for a rational curve that is specified by parallel arrays of poles and weights. If defined, dim is expected to be 3, and poles are of homogeneous form [wx,wy,wz]. */\n weights?: number[] | Float64Array;\n /** Knots and other B-spline data. */\n params: BSplineParams;\n }\n /** Interface for B-spline surface data. */\n export interface BSplineSurfaceData {\n /** Control points, aka poles in row-major order. */\n poles: number[][][] | Float64Array;\n /** The number of coordinates per pole. This is the inner dimension of the poles number array. Possible values: 3, 4. Dimension 4 means the surface is rational, with poles of homogeneous form [wx,wy,wz,w]. */\n dim: number;\n /** Weights for a rational surface that is specified by parallel arrays of poles and weights. If defined, dim is expected to be 3, and poles are of homogeneous form [wx,wy,wz]. */\n weights?: number[][] | Float64Array;\n /** Knots and other B-spline data with respect to the surface u parameter. uParams.numPoles = # columns (middle dimension) of the poles array. */\n uParams: BSplineParams;\n /** Knots and other B-spline data with respect to the surface v parameter. vParams.numPoles = # rows (outer dimension) of the poles array. */\n vParams: BSplineParams;\n }\n /** Interface of options for import/export. */\n export interface BSplineDataOptions {\n /** Type of output pole/weight arrays. true: structured number array; false: Float64Array; undefined: either. */\n jsonPoles?: boolean;\n /** Type of output knot arrays. true: number array; false: Float64Array; undefined: either. */\n jsonKnots?: boolean;\n /** Extraneous knot handling during Import: true: remove them; false | undefined: leave them. Has no effect during Export, which always outputs the extraneous knots. */\n removeExtraKnots?: boolean;\n }\n\n /** Constructor for BSplineCurveData that populates the required data. Inputs are captured, not copied. */\n export function createBSplineCurveData(poles: number[][] | Float64Array, dim: number, knots: number[] | Float64Array, numPoles: number, order: number): BSplineCurveData {\n return { poles, dim, params: { numPoles, order, knots } };\n }\n\n /** Constructor for BSplineSurfaceData that populates the required data. Inputs are captured, not copied. */\n export function createBSplineSurfaceData(poles: number[][][] | Float64Array, dim: number, uKnots: number[] | Float64Array, uNumPoles: number, uOrder: number, vKnots: number[] | Float64Array, vNumPoles: number, vOrder: number): BSplineSurfaceData {\n return { poles, dim, uParams: { numPoles: uNumPoles, order: uOrder, knots: uKnots }, vParams: { numPoles: vNumPoles, order: vOrder, knots: vKnots } };\n }\n\n /** Clone B-spline curve data */\n export function cloneBSplineCurveData(source: BSplineCurveData): BSplineCurveData {\n return {\n poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : NumberArray.copy2d(source.poles),\n dim: source.dim,\n weights: source.weights ? source.weights.slice() : undefined,\n params: {\n numPoles: source.params.numPoles,\n order: source.params.order,\n closed: source.params.closed,\n knots: source.params.knots.slice(),\n wrapMode: source.params.wrapMode,\n },\n };\n }\n\n /** Clone B-spline surface data */\n export function cloneBSplineSurfaceData(source: BSplineSurfaceData): BSplineSurfaceData {\n return {\n poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : NumberArray.copy3d(source.poles),\n dim: source.dim,\n weights: source.weights ? ((source.weights instanceof Float64Array) ? source.weights.slice() : NumberArray.copy2d(source.weights)) : undefined,\n uParams: {\n numPoles: source.uParams.numPoles,\n order: source.uParams.order,\n closed: source.uParams.closed,\n knots: source.uParams.knots.slice(),\n wrapMode: source.uParams.wrapMode,\n },\n vParams: {\n numPoles: source.vParams.numPoles,\n order: source.vParams.order,\n closed: source.vParams.closed,\n knots: source.vParams.knots.slice(),\n wrapMode: source.vParams.wrapMode,\n },\n };\n }\n\n /** Copy B-spline curve data from source to dest */\n function copyBSplineCurveDataPoles(source: BSplineCurveData): {poles?: number[][], weights?: number[]} {\n let nPole = 0;\n let nCoordPerPole = 0;\n let nPoleCoords = 0;\n let poleDimProduct = 0;\n if (source.poles instanceof Float64Array) {\n nPole = source.params.numPoles;\n nCoordPerPole = source.dim;\n nPoleCoords = source.poles.length;\n poleDimProduct = nPole * nCoordPerPole;\n } else {\n nPole = source.poles.length;\n if (nPole > 0)\n nCoordPerPole = source.poles[0].length;\n nPoleCoords = poleDimProduct = nPole * nCoordPerPole;\n }\n if (0 === poleDimProduct || poleDimProduct > nPoleCoords || nCoordPerPole !== source.dim)\n return {};\n\n let nWeight = 0;\n let nWeightCoords = 0;\n let weightDimProduct = 0;\n if (source.weights !== undefined) {\n if (source.weights instanceof Float64Array) {\n nWeight = source.params.numPoles;\n nWeightCoords = source.weights.length;\n weightDimProduct = nWeight;\n } else {\n nWeight = source.weights.length;\n nWeightCoords = weightDimProduct = nWeight;\n }\n if (0 === weightDimProduct || weightDimProduct > nWeightCoords || nWeight !== nPole)\n return {};\n }\n\n // convert variant source to structured number array\n let poles: number[][] | undefined;\n let weights: number[] | undefined;\n if (source.poles instanceof Float64Array)\n poles = NumberArray.unpack2d(source.poles, nCoordPerPole);\n else\n poles = NumberArray.copy2d(source.poles);\n if (poles && source.weights)\n weights = NumberArray.create(source.weights);\n return {poles, weights};\n }\n\n /** Copy B-spline surface data from source to dest */\n function copyBSplineSurfaceDataPoles(source: BSplineSurfaceData): {poles?: number[][][], weights?: number[][]} {\n let nPoleRow = 0;\n let nPolePerRow = 0;\n let nCoordPerPole = 0;\n let nCoords = 0;\n let poleDimProduct = 0;\n if (source.poles instanceof Float64Array) {\n nPoleRow = source.vParams.numPoles;\n nPolePerRow = source.uParams.numPoles;\n nCoordPerPole = source.dim;\n nCoords = source.poles.length;\n poleDimProduct = nPoleRow * nPolePerRow * nCoordPerPole;\n } else {\n nPoleRow = source.poles.length;\n if (nPoleRow > 0)\n nPolePerRow = source.poles[0].length;\n if (nPolePerRow > 0)\n nCoordPerPole = source.poles[0][0].length;\n nCoords = poleDimProduct = nPoleRow * nPolePerRow * nCoordPerPole;\n }\n if (0 === poleDimProduct || poleDimProduct > nCoords || nCoordPerPole !== source.dim)\n return {};\n\n let nWeightRow = 0;\n let nWeightPerRow = 0;\n let nWeightCoords = 0;\n let weightDimProduct = 0;\n if (source.weights !== undefined) {\n if (source.weights instanceof Float64Array) {\n nWeightRow = source.vParams.numPoles;\n nWeightPerRow = source.uParams.numPoles;\n nWeightCoords = source.weights.length;\n weightDimProduct = nWeightRow * nWeightPerRow;\n } else {\n nWeightRow = source.weights.length;\n if (nWeightRow > 0)\n nWeightPerRow = source.weights[0].length;\n nWeightCoords = weightDimProduct = nWeightRow * nWeightPerRow;\n }\n if (0 === weightDimProduct || weightDimProduct > nWeightCoords || nWeightRow !== nPoleRow || nWeightPerRow !== nPolePerRow)\n return {};\n }\n\n // convert variant source to structured number array\n let poles: number[][][] | undefined;\n let weights: number[][] | undefined;\n if (source.poles instanceof Float64Array)\n poles = NumberArray.unpack3d(source.poles, nPolePerRow, nCoordPerPole);\n else\n poles = NumberArray.copy3d(source.poles);\n if (poles && source.weights) {\n if (source.weights instanceof Float64Array)\n weights = NumberArray.unpack2d(source.weights, nWeightPerRow);\n else\n weights = NumberArray.copy2d(source.weights);\n }\n return {poles, weights};\n }\n\n /** Convert B-spline curve data arrays to the types specified by options. */\n function convertBSplineCurveDataArrays(data: BSplineCurveData, options?: BSplineDataOptions) {\n if (undefined !== options?.jsonPoles) {\n const packedPoles = data.poles instanceof Float64Array;\n if (options.jsonPoles && packedPoles)\n data.poles = NumberArray.unpack2d(data.poles as Float64Array, data.dim)!;\n else if (!options.jsonPoles && !packedPoles)\n data.poles = NumberArray.pack(data.poles as number[][]);\n\n if (data.weights) {\n const packedWeights = data.weights instanceof Float64Array;\n if (options.jsonPoles && packedWeights)\n data.weights = NumberArray.create(data.weights);\n else if (!options.jsonPoles && !packedWeights)\n data.weights = NumberArray.pack(data.weights as number[]);\n }\n }\n if (undefined !== options?.jsonKnots) {\n const packedKnots = data.params.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnots)\n data.params.knots = NumberArray.create(data.params.knots);\n else if (!options.jsonKnots && !packedKnots)\n data.params.knots = NumberArray.pack(data.params.knots as number[]);\n }\n }\n\n /** Convert B-spline surface data arrays to the types specified by options. */\n function convertBSplineSurfaceDataArrays(data: BSplineSurfaceData, options?: BSplineDataOptions) {\n if (undefined !== options?.jsonPoles) {\n const packedPoles = data.poles instanceof Float64Array;\n if (options.jsonPoles && packedPoles)\n data.poles = NumberArray.unpack3d(data.poles as Float64Array, data.uParams.numPoles, data.dim)!;\n else if (!options.jsonPoles && !packedPoles)\n data.poles = NumberArray.pack(data.poles as number[][][]);\n\n if (data.weights) {\n const packedWeights = data.weights instanceof Float64Array;\n if (options.jsonPoles && packedWeights)\n data.weights = NumberArray.unpack2d(data.weights as Float64Array, data.uParams.numPoles);\n else if (!options.jsonPoles && !packedWeights)\n data.weights = NumberArray.pack(data.weights as number[][]);\n }\n }\n if (undefined !== options?.jsonKnots) {\n const packedKnotsU = data.uParams.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnotsU)\n data.uParams.knots = NumberArray.create(data.uParams.knots);\n else if (!options.jsonKnots && !packedKnotsU)\n data.uParams.knots = NumberArray.pack(data.uParams.knots as number[]);\n\n const packedKnotsV = data.vParams.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnotsV)\n data.vParams.knots = NumberArray.create(data.vParams.knots);\n else if (!options.jsonKnots && !packedKnotsV)\n data.vParams.knots = NumberArray.pack(data.vParams.knots as number[]);\n }\n }\n\n /**\n * Process 1-based blocked indices into 0-based indices.\n * @param sourceIndices signed, 1-based, 0-terminated/padded source indices, blocking specified by `numPerBlock`\n * @param numPerBlock index blocking: fixed blocks of size numPerBlock > 1, possibly 0-padded; otherwise, variable-sized blocks terminated by 0\n * @param announceZeroBasedIndex callback to receive a 0-based index and optional flag indicating whether the sign of the source index is positive\n * @param terminateBlock optional callback called after each index block has been announced\n */\n export function announceZeroBasedIndicesFromSignedOneBasedIndices(\n sourceIndices: Int32Array,\n numPerBlock: number,\n announceZeroBasedIndex: (i0: number, flag?: boolean) => any,\n terminateBlock?: () => any,\n ): void {\n let numIndices = sourceIndices.length;\n if (!numIndices)\n return;\n if (numPerBlock > 1) {\n numIndices -= sourceIndices.length % numPerBlock;\n for (let i = 0; i < numIndices; i++) {\n const p = sourceIndices[i];\n if (p !== 0) // skip padding\n announceZeroBasedIndex(Math.abs(p) - 1, p > 0);\n if (terminateBlock && ((i + 1) % numPerBlock) === 0)\n terminateBlock();\n }\n } else {\n for (let i = 0; i < numIndices; i++) {\n const p = sourceIndices[i];\n if (p !== 0) // skip terminator\n announceZeroBasedIndex(Math.abs(p) - 1, p > 0);\n if (terminateBlock) {\n if (p === 0) {\n if (i + 1 === numIndices || sourceIndices[i + 1] !== 0) // skip extra terminators\n terminateBlock();\n } else {\n if (i + 1 === numIndices) // missing last terminator\n terminateBlock();\n }\n }\n }\n }\n }\n\n /**\n * Process 0-based indices with blocking specified by another index array.\n * @param sourceIndices 0-based source indices. This array is compressed (has no blocking).\n * @param blockingIndices 1-based source indices, blocking specified by `numPerBlock`. Assumed to have length equal to its zero count plus `sourceIndices.length`.\n * @param numPerBlock index blocking: fixed blocks of size numPerBlock > 1, possibly 0-padded; otherwise, variable-sized blocks terminated by 0\n * @param announceZeroBasedIndex callback to receive a 0-based index\n * @param terminateBlock optional callback called after each index block has been announced\n */\n export function announceZeroBasedIndicesWithExternalBlocking(\n sourceIndices: Int32Array,\n blockingIndices: Int32Array,\n numPerBlock: number,\n announceZeroBasedIndex: (i0: number) => any,\n terminateBlock?: () => any,\n ): void {\n if (!sourceIndices.length || !blockingIndices.length)\n return;\n const blockingZeroCount = blockingIndices.filter((i) => i === 0).length;\n if (sourceIndices.length + blockingZeroCount !== blockingIndices.length)\n return; // invalid input\n let iSource = 0;\n let numBlocking = blockingIndices.length;\n if (numPerBlock > 1) {\n numBlocking -= blockingIndices.length % numPerBlock;\n for (let iBlocking = 0; iBlocking < numBlocking && iSource < sourceIndices.length; iBlocking++) {\n const p = blockingIndices[iBlocking];\n if (p !== 0) // skip padding\n announceZeroBasedIndex(sourceIndices[iSource++]);\n if (terminateBlock && ((iBlocking + 1) % numPerBlock) === 0)\n terminateBlock();\n }\n } else {\n for (let iBlocking = 0; iBlocking < numBlocking && iSource < sourceIndices.length; iBlocking++) {\n const p = blockingIndices[iBlocking];\n if (p !== 0) // skip terminator\n announceZeroBasedIndex(sourceIndices[iSource++]);\n if (terminateBlock) {\n if (p === 0) {\n if (iBlocking + 1 === numBlocking || blockingIndices[iBlocking + 1] !== 0) // skip extra terminators\n terminateBlock();\n } else {\n if (iBlocking + 1 === numBlocking) // missing last terminator\n terminateBlock();\n }\n }\n }\n }\n }\n\n /** Helper class for preparing geometry data for import. */\n export class Import {\n /** copy knots, with options to control destination type and extraneous knot removal */\n private static copyKnots(knots: Float64Array | number[], options?: BSplineDataOptions, iStart?: number, iEnd?: number): Float64Array| number[] {\n if (undefined === iStart)\n iStart = 0;\n if (undefined === iEnd)\n iEnd = knots.length;\n if (options?.removeExtraKnots) {\n ++iStart; // ignore start knot\n --iEnd; // ignore end knot\n }\n let newNumKnots = iEnd - iStart;\n if (newNumKnots < 0)\n newNumKnots = 0;\n const newKnots = options?.jsonKnots ? new Array<number>(newNumKnots) : new Float64Array(newNumKnots);\n for (let i = iStart, k = 0; i < iEnd; i++, k++)\n newKnots[k] = knots[i];\n return newKnots;\n }\n\n /**\n * Recognize the special legacy periodic B-spline data of mode BSplineWrapMode.OpenByRemovingKnots, and return the corresponding modern open clamped knots.\n * * Note that the B-spline poles corresponding to the converted knots remain unchanged, but it is assumed that first and last poles are equal.\n * * Example: the legacy 7-point quadratic circle periodic knots {-1/3 0 0 0 1/3 1/3 2/3 2/3 1 1 1 4/3} are converted to open knots {0 0 1/3 1/3 2/3 2/3 1 1}.\n * * General form of knot vector (k = order, d = k-1 = degree, p = numPoles):\n * * * legacy input: {k/2 periodically extended knots} {start knot multiplicity k} {p-k interior knots} {end knot multiplicity k} {d/2 periodically extended knots}\n * * * converted output: {start knot multiplicity d} {p-k interior knots} {end knot multiplicity d}\n * @param knots classic knot vector to test\n * @param numPoles number of poles\n * @param order B-spline order\n * @param options for output type, extraneous knot removal\n * @returns open knots if legacy periodic B-spline input data is recognized; otherwise, undefined\n * @see Export.closeLegacyPeriodicKnots\n */\n private static openLegacyPeriodicKnots(knots: Float64Array | number[], numPoles: number, order: number, options?: BSplineDataOptions): Float64Array | number[] | undefined {\n const numKnots = knots.length;\n if (order < 2 || numPoles + 2 * order - 1 !== numKnots)\n return undefined; // not legacy periodic knots\n\n const startKnot = knots[order - 1];\n const endKnot = knots[numKnots - order];\n const iStart0 = Math.floor(order / 2); // index of first expected multiple of the start knot\n const iEnd0 = iStart0 + numPoles; // index of first expected multiple of the end knot\n const iEnd1 = iEnd0 + order; // one past index of last expected multiple of the end knot\n for (let i = 0; i < order; ++i) {\n if (Math.abs(knots[iStart0 + i] - startKnot) >= KnotVector.knotTolerance)\n return undefined; // start knot multiplicity too small\n if (Math.abs(knots[iEnd0 + i] - endKnot) >= KnotVector.knotTolerance)\n return undefined; // end knot multiplicity too small\n }\n return this.copyKnots(knots, options, iStart0, iEnd1);\n }\n\n /** Prepare imported B-spline curve data for eventual conversion to BSplineCurve3d | BSplineCurve3dH:\n * * Opens legacy \"fake\" periodic data by expanding knots\n * * Opens true periodic data by expanding poles and weights\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineCurveData(data: BSplineCurveData, options?: BSplineDataOptions): boolean {\n let polesExpanded: number[][] | undefined;\n let weightsExpanded: number[] | undefined;\n let knotsCorrected: number[] | Float64Array | undefined;\n data.params.wrapMode = undefined;\n\n if (true === data.params.closed) {\n knotsCorrected = this.openLegacyPeriodicKnots(data.params.knots, data.params.numPoles, data.params.order, options);\n if (undefined !== knotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.params.knots = knotsCorrected;\n data.params.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineCurveDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.params.order - 1; ++i) {\n const wraparoundPt = [];\n for (let j = 0; j < data.dim; ++j)\n wraparoundPt.push(polesExpanded[i][j]);\n polesExpanded.push(wraparoundPt); // append degree wraparound poles\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.params.order - 1; ++i)\n weightsExpanded.push(weightsExpanded[i]); // append degree wraparound weights\n }\n data.params.numPoles += data.params.order - 1;\n data.params.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (options?.removeExtraKnots) {\n if (!knotsCorrected)\n data.params.knots = this.copyKnots(data.params.knots, options);\n }\n\n data.params.closed = undefined; // we are open\n\n convertBSplineCurveDataArrays(data, options);\n return true;\n }\n\n /** Prepare imported B-spline surface data for eventual conversion to BSplineSurface3d | BSplineSurface3dH:\n * * Opens legacy \"fake\" periodic data by expanding knots\n * * Opens true periodic data by expanding poles and weights\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineSurfaceData(data: BSplineSurfaceData, options?: BSplineDataOptions): boolean {\n let polesExpanded: number[][][] | undefined;\n let weightsExpanded: number[][] | undefined;\n let uKnotsCorrected: number[] | Float64Array | undefined;\n let vKnotsCorrected: number[] | Float64Array | undefined;\n data.uParams.wrapMode = data.vParams.wrapMode = undefined;\n\n if (true === data.uParams.closed) {\n uKnotsCorrected = this.openLegacyPeriodicKnots(data.uParams.knots, data.uParams.numPoles, data.uParams.order, options);\n if (undefined !== uKnotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.uParams.knots = uKnotsCorrected;\n data.uParams.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.vParams.numPoles; ++i) { // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j) {\n const wraparoundPt = [];\n for (let k = 0; k < data.dim; ++k)\n wraparoundPt.push(polesExpanded[i][j][k]);\n polesExpanded[i].push(wraparoundPt); // append degreeU wraparound poles to each row\n }\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n weightsExpanded[i].push(weightsExpanded[i][j]); // append degreeU wraparound weights to each row\n }\n data.uParams.numPoles += data.uParams.order - 1;\n data.uParams.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (true === data.vParams.closed) {\n vKnotsCorrected = this.openLegacyPeriodicKnots(data.vParams.knots, data.vParams.numPoles, data.vParams.order, options);\n if (undefined !== vKnotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.vParams.knots = vKnotsCorrected;\n data.vParams.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.vParams.order - 1; ++i) {\n const wrapAroundRow = [];\n for (let j = 0; j < data.uParams.numPoles; ++j) { // #cols\n const wrapAroundPt = [];\n for (let k = 0; k < data.dim; ++k)\n wrapAroundPt.push(polesExpanded[i][j][k]);\n wrapAroundRow.push(wrapAroundPt);\n }\n polesExpanded.push(wrapAroundRow); // append degreeV wraparound rows of poles\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.vParams.order - 1; ++i) {\n const wrapAroundRow = [];\n for (let j = 0; j < data.uParams.numPoles; ++j) // #cols\n wrapAroundRow.push(weightsExpanded[i][j]);\n weightsExpanded.push(wrapAroundRow); // append degreeV wraparound rows of weights\n }\n }\n data.vParams.numPoles += data.vParams.order - 1;\n data.vParams.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (options?.removeExtraKnots) {\n if (!uKnotsCorrected)\n data.uParams.knots = this.copyKnots(data.uParams.knots, options);\n if (!vKnotsCorrected)\n data.vParams.knots = this.copyKnots(data.vParams.knots, options);\n }\n\n data.uParams.closed = data.vParams.closed = undefined; // we are open\n\n convertBSplineSurfaceDataArrays(data, options);\n return true;\n }\n }\n\n /** Helper class for preparing geometry data for export. */\n export class Export {\n /**\n * Restore special legacy periodic B-spline knots opened via BSplineWrapMode.OpenByRemovingKnots logic.\n * @param knots modern knot vector: {start knot multiplicity d} {p-k interior knots} {end knot multiplicity d}\n * @param order B-spline order\n * @param options for output type\n * @param wrapMode wrap mode of the knots\n * @returns legacy periodic knots (with classic extraneous start/end knot) if wrapMode recognized; otherwise, undefined\n * @see Import.openLegacyPeriodicKnots\n */\n private static closeLegacyPeriodicKnots(knots: Float64Array | number[], order: number, options?: BSplineDataOptions, wrapMode?: BSplineWrapMode): Float64Array | number[] | undefined {\n if (wrapMode === undefined || wrapMode !== BSplineWrapMode.OpenByRemovingKnots)\n return undefined;\n\n const degree = order - 1;\n const leftIndex = degree - 1;\n const rightIndex = knots.length - degree;\n const leftKnot = knots[leftIndex];\n const rightKnot = knots[rightIndex];\n const knotPeriod = rightKnot - leftKnot;\n const newNumKnots = knots.length + degree + 2;\n const newKnots = options?.jsonKnots ? new Array<number>(newNumKnots) : new Float64Array(newNumKnots);\n\n let k = 0;\n for (let i = Math.floor(order / 2); i > 0; --i)\n newKnots[k++] = knots[rightIndex - i] - knotPeriod;\n newKnots[k++] = leftKnot; // extraneous start knot\n for (const knot of knots)\n newKnots[k++] = knot;\n newKnots[k++] = rightKnot; // extraneous end knot\n for (let i = 1; i <= Math.floor(degree / 2); ++i)\n newKnots[k++] = knots[leftIndex + i] + knotPeriod;\n\n return newKnots;\n }\n\n /**\n * Prepare data from a B-spline curve for export.\n * * adds classic extraneous knot at start and end of knot vector\n * * re-closes periodic data based on BSplineWrapMode\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineCurveData(data: BSplineCurveData, options?: BSplineDataOptions): boolean {\n let polesTrimmed: number[][] | undefined;\n let weightsTrimmed: number[] | undefined;\n let knotsCorrected: number[] | Float64Array | undefined;\n data.params.closed = undefined;\n\n switch (data.params.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n knotsCorrected = this.closeLegacyPeriodicKnots(data.params.knots, data.params.order, options, data.params.wrapMode);\n if (undefined === knotsCorrected)\n return false; // invalid input\n data.params.knots = knotsCorrected;\n data.params.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineCurveDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.params.order - 1; ++i)\n polesTrimmed.pop(); // remove last degree poles\n if (weightsTrimmed) {\n for (let i = 0; i < data.params.order - 1; ++i)\n weightsTrimmed.pop(); // remove last degree weights\n }\n data.params.numPoles -= data.params.order - 1;\n data.params.closed = true;\n break;\n }\n }\n\n // always add extraneous knots\n if (!knotsCorrected)\n data.params.knots = KnotVector.copyKnots(data.params.knots, data.params.order - 1, true, data.params.wrapMode);\n\n convertBSplineCurveDataArrays(data, options);\n return true;\n }\n\n /**\n * Prepare data from a B-spline surface for export.\n * * adds classic extraneous knot at start and end of knot vectors\n * * re-closes periodic data based on BSplineWrapMode\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineSurfaceData(data: BSplineSurfaceData, options?: BSplineDataOptions): boolean {\n let polesTrimmed: number[][][] | undefined;\n let weightsTrimmed: number[][] | undefined;\n let uKnotsCorrected: number[] | Float64Array | undefined;\n let vKnotsCorrected: number[] | Float64Array | undefined;\n data.uParams.closed = data.vParams.closed = undefined;\n\n switch (data.uParams.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n uKnotsCorrected = this.closeLegacyPeriodicKnots(data.uParams.knots, data.uParams.order, options, data.uParams.wrapMode);\n if (undefined === uKnotsCorrected)\n return false; // invalid input\n data.uParams.knots = uKnotsCorrected;\n data.uParams.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n polesTrimmed[i].pop(); // remove last degreeU poles from each row\n if (weightsTrimmed) {\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n weightsTrimmed[i].pop(); // remove last degreeU weights from each row\n }\n data.uParams.numPoles -= data.uParams.order - 1;\n data.uParams.closed = true;\n break;\n }\n }\n\n switch (data.vParams.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n vKnotsCorrected = this.closeLegacyPeriodicKnots(data.vParams.knots, data.vParams.order, options, data.vParams.wrapMode);\n if (undefined === vKnotsCorrected)\n return false; // invalid input\n data.vParams.knots = vKnotsCorrected;\n data.vParams.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.vParams.order - 1; ++i)\n polesTrimmed.pop(); // remove last degreeV rows of poles\n if (weightsTrimmed) {\n for (let i = 0; i < data.vParams.order - 1; ++i)\n weightsTrimmed.pop(); // remove last degreeV rows of weights\n }\n data.vParams.numPoles -= data.vParams.order - 1;\n data.vParams.closed = true;\n break;\n }\n }\n\n // always add extraneous knots\n if (!uKnotsCorrected)\n data.uParams.knots = KnotVector.copyKnots(data.uParams.knots, data.uParams.order - 1, true, data.uParams.wrapMode);\n if (!vKnotsCorrected)\n data.vParams.knots = KnotVector.copyKnots(data.vParams.knots, data.vParams.order - 1, true, data.vParams.wrapMode);\n\n convertBSplineSurfaceDataArrays(data, options);\n return true;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SerializationHelpers.js","sourceRoot":"","sources":["../../../src/serialization/SerializationHelpers.ts"],"names":[],"mappings":";AAAA;;;+FAG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C,CAAC,sCAAsC;oBAChE,CAAC;oBACD,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;oBAChD,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;oBAC3B,MAAM;gBACR,CAAC;YACH,CAAC;YAED,8BAA8B;YAC9B,IAAI,CAAC,eAAe;gBAClB,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,uBAAU,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YACrH,IAAI,CAAC,eAAe;gBAClB,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,uBAAU,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAErH,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC/C,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IAjLY,2BAAM,SAiLlB,CAAA;AACH,CAAC,EAr2BgB,oBAAoB,oCAApB,oBAAoB,QAq2BpC","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 Serialization\n */\nimport { BSplineWrapMode, KnotVector } from \"../bspline/KnotVector\";\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\n\n/**\n * The `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry, such as B-spline curves and surfaces.\n * @public\n */\nexport namespace SerializationHelpers {\n /** Interface for data common to B-spline curves and surfaces. */\n export interface BSplineParams {\n /** The number of control points, aka poles. */\n numPoles: number;\n /** B-spline order, one more than the degree. */\n order: number;\n /** Whether the B-spline is to be considered closed. */\n closed?: boolean;\n /** Full knot vector. */\n knots: number[] | Float64Array;\n /** Wrap mode, for data roundtrip. */\n wrapMode?: BSplineWrapMode;\n }\n /** Interface for B-spline curve data. */\n export interface BSplineCurveData {\n /** Control points, aka poles. */\n poles: number[][] | Float64Array;\n /** The number of coordinates per pole. This is the inner dimension of the poles number array. Possible values: 3, 4. Dimension 4 means the curve is rational, with poles of homogeneous form [wx,wy,wz,w]. */\n dim: number;\n /** Weights for a rational curve that is specified by parallel arrays of poles and weights. If defined, dim is expected to be 3, and poles are of homogeneous form [wx,wy,wz]. */\n weights?: number[] | Float64Array;\n /** Knots and other B-spline data. */\n params: BSplineParams;\n }\n /** Interface for B-spline surface data. */\n export interface BSplineSurfaceData {\n /** Control points, aka poles in row-major order. */\n poles: number[][][] | Float64Array;\n /** The number of coordinates per pole. This is the inner dimension of the poles number array. Possible values: 3, 4. Dimension 4 means the surface is rational, with poles of homogeneous form [wx,wy,wz,w]. */\n dim: number;\n /** Weights for a rational surface that is specified by parallel arrays of poles and weights. If defined, dim is expected to be 3, and poles are of homogeneous form [wx,wy,wz]. */\n weights?: number[][] | Float64Array;\n /** Knots and other B-spline data with respect to the surface u parameter. uParams.numPoles = # columns (middle dimension) of the poles array. */\n uParams: BSplineParams;\n /** Knots and other B-spline data with respect to the surface v parameter. vParams.numPoles = # rows (outer dimension) of the poles array. */\n vParams: BSplineParams;\n }\n /** Interface of options for import/export. */\n export interface BSplineDataOptions {\n /** Type of output pole/weight arrays. true: structured number array; false: Float64Array; undefined: either. */\n jsonPoles?: boolean;\n /** Type of output knot arrays. true: number array; false: Float64Array; undefined: either. */\n jsonKnots?: boolean;\n /** Extraneous knot handling during Import: true: remove them; false | undefined: leave them. Has no effect during Export, which always outputs the extraneous knots. */\n removeExtraKnots?: boolean;\n }\n\n /** Constructor for BSplineCurveData that populates the required data. Inputs are captured, not copied. */\n export function createBSplineCurveData(poles: number[][] | Float64Array, dim: number, knots: number[] | Float64Array, numPoles: number, order: number): BSplineCurveData {\n return { poles, dim, params: { numPoles, order, knots } };\n }\n\n /** Constructor for BSplineSurfaceData that populates the required data. Inputs are captured, not copied. */\n export function createBSplineSurfaceData(poles: number[][][] | Float64Array, dim: number, uKnots: number[] | Float64Array, uNumPoles: number, uOrder: number, vKnots: number[] | Float64Array, vNumPoles: number, vOrder: number): BSplineSurfaceData {\n return { poles, dim, uParams: { numPoles: uNumPoles, order: uOrder, knots: uKnots }, vParams: { numPoles: vNumPoles, order: vOrder, knots: vKnots } };\n }\n\n /** Clone B-spline curve data */\n export function cloneBSplineCurveData(source: BSplineCurveData): BSplineCurveData {\n return {\n poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : NumberArray.copy2d(source.poles),\n dim: source.dim,\n weights: source.weights ? source.weights.slice() : undefined,\n params: {\n numPoles: source.params.numPoles,\n order: source.params.order,\n closed: source.params.closed,\n knots: source.params.knots.slice(),\n wrapMode: source.params.wrapMode,\n },\n };\n }\n\n /** Clone B-spline surface data */\n export function cloneBSplineSurfaceData(source: BSplineSurfaceData): BSplineSurfaceData {\n return {\n poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : NumberArray.copy3d(source.poles),\n dim: source.dim,\n weights: source.weights ? ((source.weights instanceof Float64Array) ? source.weights.slice() : NumberArray.copy2d(source.weights)) : undefined,\n uParams: {\n numPoles: source.uParams.numPoles,\n order: source.uParams.order,\n closed: source.uParams.closed,\n knots: source.uParams.knots.slice(),\n wrapMode: source.uParams.wrapMode,\n },\n vParams: {\n numPoles: source.vParams.numPoles,\n order: source.vParams.order,\n closed: source.vParams.closed,\n knots: source.vParams.knots.slice(),\n wrapMode: source.vParams.wrapMode,\n },\n };\n }\n\n /** Copy B-spline curve data from source to dest */\n function copyBSplineCurveDataPoles(source: BSplineCurveData): { poles?: number[][], weights?: number[] } {\n let nPole = 0;\n let nCoordPerPole = 0;\n let nPoleCoords = 0;\n let poleDimProduct = 0;\n if (source.poles instanceof Float64Array) {\n nPole = source.params.numPoles;\n nCoordPerPole = source.dim;\n nPoleCoords = source.poles.length;\n poleDimProduct = nPole * nCoordPerPole;\n } else {\n nPole = source.poles.length;\n if (nPole > 0)\n nCoordPerPole = source.poles[0].length;\n nPoleCoords = poleDimProduct = nPole * nCoordPerPole;\n }\n if (0 === poleDimProduct || poleDimProduct > nPoleCoords || nCoordPerPole !== source.dim)\n return {};\n\n let nWeight = 0;\n let nWeightCoords = 0;\n let weightDimProduct = 0;\n if (source.weights !== undefined) {\n if (source.weights instanceof Float64Array) {\n nWeight = source.params.numPoles;\n nWeightCoords = source.weights.length;\n weightDimProduct = nWeight;\n } else {\n nWeight = source.weights.length;\n nWeightCoords = weightDimProduct = nWeight;\n }\n if (0 === weightDimProduct || weightDimProduct > nWeightCoords || nWeight !== nPole)\n return {};\n }\n\n // convert variant source to structured number array\n let poles: number[][] | undefined;\n let weights: number[] | undefined;\n if (source.poles instanceof Float64Array)\n poles = NumberArray.unpack2d(source.poles, nCoordPerPole);\n else\n poles = NumberArray.copy2d(source.poles);\n if (poles && source.weights)\n weights = NumberArray.create(source.weights);\n return { poles, weights };\n }\n\n /** Copy B-spline surface data from source to dest */\n function copyBSplineSurfaceDataPoles(source: BSplineSurfaceData): { poles?: number[][][], weights?: number[][] } {\n let nPoleRow = 0;\n let nPolePerRow = 0;\n let nCoordPerPole = 0;\n let nCoords = 0;\n let poleDimProduct = 0;\n if (source.poles instanceof Float64Array) {\n nPoleRow = source.vParams.numPoles;\n nPolePerRow = source.uParams.numPoles;\n nCoordPerPole = source.dim;\n nCoords = source.poles.length;\n poleDimProduct = nPoleRow * nPolePerRow * nCoordPerPole;\n } else {\n nPoleRow = source.poles.length;\n if (nPoleRow > 0)\n nPolePerRow = source.poles[0].length;\n if (nPolePerRow > 0)\n nCoordPerPole = source.poles[0][0].length;\n nCoords = poleDimProduct = nPoleRow * nPolePerRow * nCoordPerPole;\n }\n if (0 === poleDimProduct || poleDimProduct > nCoords || nCoordPerPole !== source.dim)\n return {};\n\n let nWeightRow = 0;\n let nWeightPerRow = 0;\n let nWeightCoords = 0;\n let weightDimProduct = 0;\n if (source.weights !== undefined) {\n if (source.weights instanceof Float64Array) {\n nWeightRow = source.vParams.numPoles;\n nWeightPerRow = source.uParams.numPoles;\n nWeightCoords = source.weights.length;\n weightDimProduct = nWeightRow * nWeightPerRow;\n } else {\n nWeightRow = source.weights.length;\n if (nWeightRow > 0)\n nWeightPerRow = source.weights[0].length;\n nWeightCoords = weightDimProduct = nWeightRow * nWeightPerRow;\n }\n if (0 === weightDimProduct || weightDimProduct > nWeightCoords || nWeightRow !== nPoleRow || nWeightPerRow !== nPolePerRow)\n return {};\n }\n\n // convert variant source to structured number array\n let poles: number[][][] | undefined;\n let weights: number[][] | undefined;\n if (source.poles instanceof Float64Array)\n poles = NumberArray.unpack3d(source.poles, nPolePerRow, nCoordPerPole);\n else\n poles = NumberArray.copy3d(source.poles);\n if (poles && source.weights) {\n if (source.weights instanceof Float64Array)\n weights = NumberArray.unpack2d(source.weights, nWeightPerRow);\n else\n weights = NumberArray.copy2d(source.weights);\n }\n return { poles, weights };\n }\n\n /** Convert B-spline curve data arrays to the types specified by options. */\n function convertBSplineCurveDataArrays(data: BSplineCurveData, options?: BSplineDataOptions) {\n if (undefined !== options?.jsonPoles) {\n const packedPoles = data.poles instanceof Float64Array;\n if (options.jsonPoles && packedPoles)\n data.poles = NumberArray.unpack2d(data.poles as Float64Array, data.dim)!;\n else if (!options.jsonPoles && !packedPoles)\n data.poles = NumberArray.pack(data.poles as number[][]);\n\n if (data.weights) {\n const packedWeights = data.weights instanceof Float64Array;\n if (options.jsonPoles && packedWeights)\n data.weights = NumberArray.create(data.weights);\n else if (!options.jsonPoles && !packedWeights)\n data.weights = NumberArray.pack(data.weights as number[]);\n }\n }\n if (undefined !== options?.jsonKnots) {\n const packedKnots = data.params.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnots)\n data.params.knots = NumberArray.create(data.params.knots);\n else if (!options.jsonKnots && !packedKnots)\n data.params.knots = NumberArray.pack(data.params.knots as number[]);\n }\n }\n\n /** Convert B-spline surface data arrays to the types specified by options. */\n function convertBSplineSurfaceDataArrays(data: BSplineSurfaceData, options?: BSplineDataOptions) {\n if (undefined !== options?.jsonPoles) {\n const packedPoles = data.poles instanceof Float64Array;\n if (options.jsonPoles && packedPoles)\n data.poles = NumberArray.unpack3d(data.poles as Float64Array, data.uParams.numPoles, data.dim)!;\n else if (!options.jsonPoles && !packedPoles)\n data.poles = NumberArray.pack(data.poles as number[][][]);\n\n if (data.weights) {\n const packedWeights = data.weights instanceof Float64Array;\n if (options.jsonPoles && packedWeights)\n data.weights = NumberArray.unpack2d(data.weights as Float64Array, data.uParams.numPoles);\n else if (!options.jsonPoles && !packedWeights)\n data.weights = NumberArray.pack(data.weights as number[][]);\n }\n }\n if (undefined !== options?.jsonKnots) {\n const packedKnotsU = data.uParams.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnotsU)\n data.uParams.knots = NumberArray.create(data.uParams.knots);\n else if (!options.jsonKnots && !packedKnotsU)\n data.uParams.knots = NumberArray.pack(data.uParams.knots as number[]);\n\n const packedKnotsV = data.vParams.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnotsV)\n data.vParams.knots = NumberArray.create(data.vParams.knots);\n else if (!options.jsonKnots && !packedKnotsV)\n data.vParams.knots = NumberArray.pack(data.vParams.knots as number[]);\n }\n }\n\n /**\n * Process 1-based blocked indices into 0-based indices.\n * @param sourceIndices signed, 1-based, 0-terminated/padded source indices, blocking specified by `numPerBlock`\n * @param numPerBlock index blocking: fixed blocks of size numPerBlock > 1, possibly 0-padded; otherwise, variable-sized blocks terminated by 0\n * @param announceZeroBasedIndex callback to receive a 0-based index and optional flag indicating whether the sign of the source index is positive\n * @param terminateBlock optional callback called after each index block has been announced\n */\n export function announceZeroBasedIndicesFromSignedOneBasedIndices(\n sourceIndices: Int32Array,\n numPerBlock: number,\n announceZeroBasedIndex: (i0: number, flag?: boolean) => any,\n terminateBlock?: () => any,\n ): void {\n let numIndices = sourceIndices.length;\n if (!numIndices)\n return;\n if (numPerBlock > 1) {\n numIndices -= sourceIndices.length % numPerBlock;\n for (let i = 0; i < numIndices; i++) {\n const p = sourceIndices[i];\n if (p !== 0) // skip padding\n announceZeroBasedIndex(Math.abs(p) - 1, p > 0);\n if (terminateBlock && ((i + 1) % numPerBlock) === 0)\n terminateBlock();\n }\n } else {\n for (let i = 0; i < numIndices; i++) {\n const p = sourceIndices[i];\n if (p !== 0) // skip terminator\n announceZeroBasedIndex(Math.abs(p) - 1, p > 0);\n if (terminateBlock) {\n if (p === 0) {\n if (i + 1 === numIndices || sourceIndices[i + 1] !== 0) // skip extra terminators\n terminateBlock();\n } else {\n if (i + 1 === numIndices) // missing last terminator\n terminateBlock();\n }\n }\n }\n }\n }\n\n /**\n * Process 0-based indices with blocking specified by another index array.\n * @param sourceIndices 0-based source indices. This array is compressed (has no blocking).\n * @param blockingIndices 1-based source indices, blocking specified by `numPerBlock`. Assumed to have length equal to its zero count plus `sourceIndices.length`.\n * @param numPerBlock index blocking: fixed blocks of size numPerBlock > 1, possibly 0-padded; otherwise, variable-sized blocks terminated by 0\n * @param announceZeroBasedIndex callback to receive a 0-based index\n * @param terminateBlock optional callback called after each index block has been announced\n */\n export function announceZeroBasedIndicesWithExternalBlocking(\n sourceIndices: Int32Array,\n blockingIndices: Int32Array,\n numPerBlock: number,\n announceZeroBasedIndex: (i0: number) => any,\n terminateBlock?: () => any,\n ): void {\n if (!sourceIndices.length || !blockingIndices.length)\n return;\n const blockingZeroCount = blockingIndices.filter((i) => i === 0).length;\n if (sourceIndices.length + blockingZeroCount !== blockingIndices.length)\n return; // invalid input\n let iSource = 0;\n let numBlocking = blockingIndices.length;\n if (numPerBlock > 1) {\n numBlocking -= blockingIndices.length % numPerBlock;\n for (let iBlocking = 0; iBlocking < numBlocking && iSource < sourceIndices.length; iBlocking++) {\n const p = blockingIndices[iBlocking];\n if (p !== 0) // skip padding\n announceZeroBasedIndex(sourceIndices[iSource++]);\n if (terminateBlock && ((iBlocking + 1) % numPerBlock) === 0)\n terminateBlock();\n }\n } else {\n for (let iBlocking = 0; iBlocking < numBlocking && iSource < sourceIndices.length; iBlocking++) {\n const p = blockingIndices[iBlocking];\n if (p !== 0) // skip terminator\n announceZeroBasedIndex(sourceIndices[iSource++]);\n if (terminateBlock) {\n if (p === 0) {\n if (iBlocking + 1 === numBlocking || blockingIndices[iBlocking + 1] !== 0) // skip extra terminators\n terminateBlock();\n } else {\n if (iBlocking + 1 === numBlocking) // missing last terminator\n terminateBlock();\n }\n }\n }\n }\n }\n\n /** Special values for persistent zero-based edge mate indices. */\n export enum EdgeMateIndex {\n /** Separates face loops. */\n BlockSeparator = -1,\n /** Indicates no edge mate. */\n NoEdgeMate = -2\n };\n\n /**\n * Build two index arrays into a source array:\n * * `sourceStarts[k]` is the first index of the k_th block in `sourceIndices`.\n * * `compressedStarts[k]` is the first index of the k_th block in a compressed clone `C` of `sourceIndices`\n * with all pads/terminators removed.\n * * The last entry of `sourceStarts`/`compressedStarts` is the length of `sourceIndices`/`C`.\n * @returns `undefined` if invalid inputs, or the two computed arrays of block start indices.\n */\n function buildBlockStartIndices(sourceIndices: Int32Array, numPerBlock: number, blockSeparator: number): { sourceStarts: number[], compressedStarts: number[] } | undefined {\n if (sourceIndices.length === 0 || sourceIndices[0] === blockSeparator)\n return undefined;\n const sourceStarts: number[] = [];\n const compressedStarts: number[] = [];\n sourceStarts.push(0);\n compressedStarts.push(0);\n const getBlockLength = (iBlockStart: number): number => {\n if (sourceIndices[iBlockStart] === blockSeparator)\n return 0;\n for (let i = iBlockStart + 1; i < sourceIndices.length; i++) {\n if ((sourceIndices[i - 1] !== blockSeparator && sourceIndices[i] === blockSeparator) || (numPerBlock > 2 && (i % numPerBlock === 0)))\n return i - iBlockStart;\n if (i === sourceIndices.length - 1) // last fixed block, or unterminated last variable block\n return sourceIndices.length - iBlockStart;\n }\n return 0;\n }\n for (let i = 0; i < sourceIndices.length;) {\n const blockLength = getBlockLength(i);\n if (blockLength <= 0)\n return undefined;\n i += blockLength;\n for (; i < sourceIndices.length && sourceIndices[i] === blockSeparator; i++);\n sourceStarts.push(i);\n compressedStarts.push(compressedStarts[compressedStarts.length - 1] + blockLength);\n }\n return { sourceStarts, compressedStarts };\n }\n\n /**\n * Compress a 0-based blocked index array by removing block separators/pads and remapping each index.\n * * The entries of `sourceIndices` are reflexive indices, i.e., they index `sourceIndices`.\n * * The remapped index `j` must refer to the same block location in the compressed array to which the\n * original index `i >= 0` refers in `sourceIndices`; therefore `j` is obtained from `i` by subtracting the\n * number of block separators/pads preceding `sourceIndices[i]`.\n * @param sourceIndices array of blocked indices to process. Each entry is a 0-based reflexive index, `nullValue`, or `blockSeparator`.\n * @param numPerBlock index blocking for sourceIndices: padded block size > 2 or variable-sized terminated blocks.\n * @param blockSeparator negative value that terminates/pads blocks in sourceIndices, e.g. -1. This value is not announced.\n * @param nullValue negative value that represents \"no index\" in sourceIndices, e.g., -2. This value is announced as \"undefined\".\n * @param announceRemappedIndex callback to receive a remapped index.\n * @returns true if and only if the mapping was successful.\n */\n export function announceCompressedZeroBasedReflexiveIndices(\n sourceIndices: Int32Array,\n numPerBlock: number,\n blockSeparator: number,\n nullValue: number,\n announceRemappedIndex: (i: number | undefined) => any,\n ): boolean {\n if (!sourceIndices.length || blockSeparator >= 0 || nullValue >= 0 || (blockSeparator === nullValue))\n return false;\n // remapped index = source index - # preceding terminators/pads in sourceIndices\n // Instead of counting terminators/pads, we use a pair of block start index arrays\n const blocking = buildBlockStartIndices(sourceIndices, numPerBlock, blockSeparator);\n if (!blocking)\n return false;\n for (const index of sourceIndices) {\n if (index === nullValue)\n announceRemappedIndex(undefined);\n else if (index >= 0) {\n const iBlock = NumberArray.searchStrictlyIncreasingNumbers(blocking.sourceStarts, index);\n if (iBlock === undefined)\n return false;\n const blockOffset = index - blocking.sourceStarts[iBlock];\n announceRemappedIndex(blocking.compressedStarts[iBlock] + blockOffset);\n }\n }\n return true;\n }\n\n /**\n * Uncompress a 0-based index array by inserting block separators and remapping each index.\n * * Defined entries of `sourceIndices` are reflexive indices, i.e., they index `sourceIndices`.\n * * The remapped index `j` must refer to the same block location in the uncompressed array to which the\n * original defined index `i` refers in `sourceIndices`; therefore `j` is obtained from `i` by adding the\n * number of full blocks preceding `sourceIndices[i]`.\n * @param sourceIndices array of compressed indices to process. Each entry is a 0-based reflexive index, or `undefined`.\n * @param sourceStarts sourceStarts[k] is the first index of the k_th block in `sourceIndices`; its last entry is the\n * length of `sourceIndices`.\n * @param blockSeparator negative value that represents an announced block terminator, e.g. -1.\n * @param nullValue negative value to announce for an undefined source index, e.g., -2.\n * @param announceRemappedIndex callback to receive a remapped index.\n * @returns true if and only if the mapping was successful.\n */\n export function announceUncompressedZeroBasedReflexiveIndices(\n sourceIndices: Array<number | undefined>,\n sourceStarts: ReadonlyArray<number>,\n blockSeparator: number,\n nullValue: number,\n announceRemappedIndex: (i: number) => any,\n ): boolean {\n if (!sourceIndices.length || sourceStarts.length < 2 || blockSeparator >= 0 || nullValue >= 0 || (blockSeparator === nullValue))\n return false;\n // remapped index = source index + # preceding blocks in sourceIndices\n for (let i = 0; i < sourceStarts.length - 1; i++) {\n for (let j = sourceStarts[i]; j < sourceStarts[i + 1]; j++) {\n const index = sourceIndices[j];\n if (index === undefined)\n announceRemappedIndex(nullValue);\n else if (index >= 0) {\n const iBlock = NumberArray.searchStrictlyIncreasingNumbers(sourceStarts, index);\n if (iBlock === undefined)\n return false;\n announceRemappedIndex(index + iBlock);\n }\n }\n announceRemappedIndex(blockSeparator);\n }\n return true;\n }\n\n /** Helper class for preparing geometry data for import. */\n export class Import {\n /** copy knots, with options to control destination type and extraneous knot removal */\n private static copyKnots(knots: Float64Array | number[], options?: BSplineDataOptions, iStart?: number, iEnd?: number): Float64Array | number[] {\n if (undefined === iStart)\n iStart = 0;\n if (undefined === iEnd)\n iEnd = knots.length;\n if (options?.removeExtraKnots) {\n ++iStart; // ignore start knot\n --iEnd; // ignore end knot\n }\n let newNumKnots = iEnd - iStart;\n if (newNumKnots < 0)\n newNumKnots = 0;\n const newKnots = options?.jsonKnots ? new Array<number>(newNumKnots) : new Float64Array(newNumKnots);\n for (let i = iStart, k = 0; i < iEnd; i++, k++)\n newKnots[k] = knots[i];\n return newKnots;\n }\n\n /**\n * Recognize the special legacy periodic B-spline data of mode BSplineWrapMode.OpenByRemovingKnots, and return the corresponding modern open clamped knots.\n * * Note that the B-spline poles corresponding to the converted knots remain unchanged, but it is assumed that first and last poles are equal.\n * * Example: the legacy 7-point quadratic circle periodic knots {-1/3 0 0 0 1/3 1/3 2/3 2/3 1 1 1 4/3} are converted to open knots {0 0 1/3 1/3 2/3 2/3 1 1}.\n * * General form of knot vector (k = order, d = k-1 = degree, p = numPoles):\n * * * legacy input: {k/2 periodically extended knots} {start knot multiplicity k} {p-k interior knots} {end knot multiplicity k} {d/2 periodically extended knots}\n * * * converted output: {start knot multiplicity d} {p-k interior knots} {end knot multiplicity d}\n * @param knots classic knot vector to test\n * @param numPoles number of poles\n * @param order B-spline order\n * @param options for output type, extraneous knot removal\n * @returns open knots if legacy periodic B-spline input data is recognized; otherwise, undefined\n * @see Export.closeLegacyPeriodicKnots\n */\n private static openLegacyPeriodicKnots(knots: Float64Array | number[], numPoles: number, order: number, options?: BSplineDataOptions): Float64Array | number[] | undefined {\n const numKnots = knots.length;\n if (order < 2 || numPoles + 2 * order - 1 !== numKnots)\n return undefined; // not legacy periodic knots\n\n const startKnot = knots[order - 1];\n const endKnot = knots[numKnots - order];\n const iStart0 = Math.floor(order / 2); // index of first expected multiple of the start knot\n const iEnd0 = iStart0 + numPoles; // index of first expected multiple of the end knot\n const iEnd1 = iEnd0 + order; // one past index of last expected multiple of the end knot\n for (let i = 0; i < order; ++i) {\n if (Math.abs(knots[iStart0 + i] - startKnot) >= KnotVector.knotTolerance)\n return undefined; // start knot multiplicity too small\n if (Math.abs(knots[iEnd0 + i] - endKnot) >= KnotVector.knotTolerance)\n return undefined; // end knot multiplicity too small\n }\n return this.copyKnots(knots, options, iStart0, iEnd1);\n }\n\n /** Prepare imported B-spline curve data for eventual conversion to BSplineCurve3d | BSplineCurve3dH:\n * * Opens legacy \"fake\" periodic data by expanding knots\n * * Opens true periodic data by expanding poles and weights\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineCurveData(data: BSplineCurveData, options?: BSplineDataOptions): boolean {\n let polesExpanded: number[][] | undefined;\n let weightsExpanded: number[] | undefined;\n let knotsCorrected: number[] | Float64Array | undefined;\n data.params.wrapMode = undefined;\n\n if (true === data.params.closed) {\n knotsCorrected = this.openLegacyPeriodicKnots(data.params.knots, data.params.numPoles, data.params.order, options);\n if (undefined !== knotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.params.knots = knotsCorrected;\n data.params.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineCurveDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.params.order - 1; ++i) {\n const wraparoundPt = [];\n for (let j = 0; j < data.dim; ++j)\n wraparoundPt.push(polesExpanded[i][j]);\n polesExpanded.push(wraparoundPt); // append degree wraparound poles\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.params.order - 1; ++i)\n weightsExpanded.push(weightsExpanded[i]); // append degree wraparound weights\n }\n data.params.numPoles += data.params.order - 1;\n data.params.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (options?.removeExtraKnots) {\n if (!knotsCorrected)\n data.params.knots = this.copyKnots(data.params.knots, options);\n }\n\n data.params.closed = undefined; // we are open\n\n convertBSplineCurveDataArrays(data, options);\n return true;\n }\n\n /** Prepare imported B-spline surface data for eventual conversion to BSplineSurface3d | BSplineSurface3dH:\n * * Opens legacy \"fake\" periodic data by expanding knots\n * * Opens true periodic data by expanding poles and weights\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineSurfaceData(data: BSplineSurfaceData, options?: BSplineDataOptions): boolean {\n let polesExpanded: number[][][] | undefined;\n let weightsExpanded: number[][] | undefined;\n let uKnotsCorrected: number[] | Float64Array | undefined;\n let vKnotsCorrected: number[] | Float64Array | undefined;\n data.uParams.wrapMode = data.vParams.wrapMode = undefined;\n\n if (true === data.uParams.closed) {\n uKnotsCorrected = this.openLegacyPeriodicKnots(data.uParams.knots, data.uParams.numPoles, data.uParams.order, options);\n if (undefined !== uKnotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.uParams.knots = uKnotsCorrected;\n data.uParams.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.vParams.numPoles; ++i) { // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j) {\n const wraparoundPt = [];\n for (let k = 0; k < data.dim; ++k)\n wraparoundPt.push(polesExpanded[i][j][k]);\n polesExpanded[i].push(wraparoundPt); // append degreeU wraparound poles to each row\n }\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n weightsExpanded[i].push(weightsExpanded[i][j]); // append degreeU wraparound weights to each row\n }\n data.uParams.numPoles += data.uParams.order - 1;\n data.uParams.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (true === data.vParams.closed) {\n vKnotsCorrected = this.openLegacyPeriodicKnots(data.vParams.knots, data.vParams.numPoles, data.vParams.order, options);\n if (undefined !== vKnotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.vParams.knots = vKnotsCorrected;\n data.vParams.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.vParams.order - 1; ++i) {\n const wrapAroundRow = [];\n for (let j = 0; j < data.uParams.numPoles; ++j) { // #cols\n const wrapAroundPt = [];\n for (let k = 0; k < data.dim; ++k)\n wrapAroundPt.push(polesExpanded[i][j][k]);\n wrapAroundRow.push(wrapAroundPt);\n }\n polesExpanded.push(wrapAroundRow); // append degreeV wraparound rows of poles\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.vParams.order - 1; ++i) {\n const wrapAroundRow = [];\n for (let j = 0; j < data.uParams.numPoles; ++j) // #cols\n wrapAroundRow.push(weightsExpanded[i][j]);\n weightsExpanded.push(wrapAroundRow); // append degreeV wraparound rows of weights\n }\n }\n data.vParams.numPoles += data.vParams.order - 1;\n data.vParams.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (options?.removeExtraKnots) {\n if (!uKnotsCorrected)\n data.uParams.knots = this.copyKnots(data.uParams.knots, options);\n if (!vKnotsCorrected)\n data.vParams.knots = this.copyKnots(data.vParams.knots, options);\n }\n\n data.uParams.closed = data.vParams.closed = undefined; // we are open\n\n convertBSplineSurfaceDataArrays(data, options);\n return true;\n }\n }\n\n /** Helper class for preparing geometry data for export. */\n export class Export {\n /**\n * Restore special legacy periodic B-spline knots opened via BSplineWrapMode.OpenByRemovingKnots logic.\n * @param knots modern knot vector: {start knot multiplicity d} {p-k interior knots} {end knot multiplicity d}\n * @param order B-spline order\n * @param options for output type\n * @param wrapMode wrap mode of the knots\n * @returns legacy periodic knots (with classic extraneous start/end knot) if wrapMode recognized; otherwise, undefined\n * @see Import.openLegacyPeriodicKnots\n */\n private static closeLegacyPeriodicKnots(knots: Float64Array | number[], order: number, options?: BSplineDataOptions, wrapMode?: BSplineWrapMode): Float64Array | number[] | undefined {\n if (wrapMode === undefined || wrapMode !== BSplineWrapMode.OpenByRemovingKnots)\n return undefined;\n\n const degree = order - 1;\n const leftIndex = degree - 1;\n const rightIndex = knots.length - degree;\n const leftKnot = knots[leftIndex];\n const rightKnot = knots[rightIndex];\n const knotPeriod = rightKnot - leftKnot;\n const newNumKnots = knots.length + degree + 2;\n const newKnots = options?.jsonKnots ? new Array<number>(newNumKnots) : new Float64Array(newNumKnots);\n\n let k = 0;\n for (let i = Math.floor(order / 2); i > 0; --i)\n newKnots[k++] = knots[rightIndex - i] - knotPeriod;\n newKnots[k++] = leftKnot; // extraneous start knot\n for (const knot of knots)\n newKnots[k++] = knot;\n newKnots[k++] = rightKnot; // extraneous end knot\n for (let i = 1; i <= Math.floor(degree / 2); ++i)\n newKnots[k++] = knots[leftIndex + i] + knotPeriod;\n\n return newKnots;\n }\n\n /**\n * Prepare data from a B-spline curve for export.\n * * adds classic extraneous knot at start and end of knot vector\n * * re-closes periodic data based on BSplineWrapMode\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineCurveData(data: BSplineCurveData, options?: BSplineDataOptions): boolean {\n let polesTrimmed: number[][] | undefined;\n let weightsTrimmed: number[] | undefined;\n let knotsCorrected: number[] | Float64Array | undefined;\n data.params.closed = undefined;\n\n switch (data.params.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n knotsCorrected = this.closeLegacyPeriodicKnots(data.params.knots, data.params.order, options, data.params.wrapMode);\n if (undefined === knotsCorrected)\n return false; // invalid input\n data.params.knots = knotsCorrected;\n data.params.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineCurveDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.params.order - 1; ++i)\n polesTrimmed.pop(); // remove last degree poles\n if (weightsTrimmed) {\n for (let i = 0; i < data.params.order - 1; ++i)\n weightsTrimmed.pop(); // remove last degree weights\n }\n data.params.numPoles -= data.params.order - 1;\n data.params.closed = true;\n break;\n }\n }\n\n // always add extraneous knots\n if (!knotsCorrected)\n data.params.knots = KnotVector.copyKnots(data.params.knots, data.params.order - 1, true, data.params.wrapMode);\n\n convertBSplineCurveDataArrays(data, options);\n return true;\n }\n\n /**\n * Prepare data from a B-spline surface for export.\n * * adds classic extraneous knot at start and end of knot vectors\n * * re-closes periodic data based on BSplineWrapMode\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineSurfaceData(data: BSplineSurfaceData, options?: BSplineDataOptions): boolean {\n let polesTrimmed: number[][][] | undefined;\n let weightsTrimmed: number[][] | undefined;\n let uKnotsCorrected: number[] | Float64Array | undefined;\n let vKnotsCorrected: number[] | Float64Array | undefined;\n data.uParams.closed = data.vParams.closed = undefined;\n\n switch (data.uParams.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n uKnotsCorrected = this.closeLegacyPeriodicKnots(data.uParams.knots, data.uParams.order, options, data.uParams.wrapMode);\n if (undefined === uKnotsCorrected)\n return false; // invalid input\n data.uParams.knots = uKnotsCorrected;\n data.uParams.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n polesTrimmed[i].pop(); // remove last degreeU poles from each row\n if (weightsTrimmed) {\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n weightsTrimmed[i].pop(); // remove last degreeU weights from each row\n }\n data.uParams.numPoles -= data.uParams.order - 1;\n data.uParams.closed = true;\n break;\n }\n }\n\n switch (data.vParams.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n vKnotsCorrected = this.closeLegacyPeriodicKnots(data.vParams.knots, data.vParams.order, options, data.vParams.wrapMode);\n if (undefined === vKnotsCorrected)\n return false; // invalid input\n data.vParams.knots = vKnotsCorrected;\n data.vParams.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.vParams.order - 1; ++i)\n polesTrimmed.pop(); // remove last degreeV rows of poles\n if (weightsTrimmed) {\n for (let i = 0; i < data.vParams.order - 1; ++i)\n weightsTrimmed.pop(); // remove last degreeV rows of weights\n }\n data.vParams.numPoles -= data.vParams.order - 1;\n data.vParams.closed = true;\n break;\n }\n }\n\n // always add extraneous knots\n if (!uKnotsCorrected)\n data.uParams.knots = KnotVector.copyKnots(data.uParams.knots, data.uParams.order - 1, true, data.uParams.wrapMode);\n if (!vKnotsCorrected)\n data.vParams.knots = KnotVector.copyKnots(data.vParams.knots, data.vParams.order - 1, true, data.vParams.wrapMode);\n\n convertBSplineSurfaceDataArrays(data, options);\n return true;\n }\n }\n}\n"]}
|
|
@@ -16,11 +16,13 @@ import { Range3d } from "../geometry3d/Range";
|
|
|
16
16
|
import { Transform } from "../geometry3d/Transform";
|
|
17
17
|
import { SolidPrimitive } from "./SolidPrimitive";
|
|
18
18
|
/**
|
|
19
|
-
* A sphere mapped by an arbitrary
|
|
19
|
+
* A unit sphere mapped by an arbitrary [[Transform]].
|
|
20
20
|
* * Typically, the stored matrix has orthogonal columns. In this case, if two columns have equal length, the
|
|
21
21
|
* resulting geometry is ellipsoidal; if all three columns have equal length, the resulting geometry is a sphere.
|
|
22
|
-
* * Creating a Sphere without orthogonal columns is possible
|
|
22
|
+
* * Creating a Sphere without orthogonal columns is possible but not recommended, for the resulting geometry
|
|
23
23
|
* lacks portability; for example, such a Sphere cannot be represented as a DGN element (see [[createDgnSphere]]).
|
|
24
|
+
* * An optional latitude sweep allows for partial spheres with or without caps.
|
|
25
|
+
* * Compare to [[Ellipsoid]], which has the same parameterization, but acts as a closed [[Clipper]].
|
|
24
26
|
* @public
|
|
25
27
|
*/
|
|
26
28
|
export declare class Sphere extends SolidPrimitive implements UVSurface {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sphere.d.ts","sourceRoot":"","sources":["../../../src/solid/Sphere.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MA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IAAI,OAAO,CAEnC;IACD;;;;OAIG;IACI,wBAAwB,IAAI,QAAQ;CAa5C"}
|
package/lib/cjs/solid/Sphere.js
CHANGED
|
@@ -22,11 +22,13 @@ const Point3dVector3d_1 = require("../geometry3d/Point3dVector3d");
|
|
|
22
22
|
const Transform_1 = require("../geometry3d/Transform");
|
|
23
23
|
const SolidPrimitive_1 = require("./SolidPrimitive");
|
|
24
24
|
/**
|
|
25
|
-
* A sphere mapped by an arbitrary
|
|
25
|
+
* A unit sphere mapped by an arbitrary [[Transform]].
|
|
26
26
|
* * Typically, the stored matrix has orthogonal columns. In this case, if two columns have equal length, the
|
|
27
27
|
* resulting geometry is ellipsoidal; if all three columns have equal length, the resulting geometry is a sphere.
|
|
28
|
-
* * Creating a Sphere without orthogonal columns is possible
|
|
28
|
+
* * Creating a Sphere without orthogonal columns is possible but not recommended, for the resulting geometry
|
|
29
29
|
* lacks portability; for example, such a Sphere cannot be represented as a DGN element (see [[createDgnSphere]]).
|
|
30
|
+
* * An optional latitude sweep allows for partial spheres with or without caps.
|
|
31
|
+
* * Compare to [[Ellipsoid]], which has the same parameterization, but acts as a closed [[Clipper]].
|
|
30
32
|
* @public
|
|
31
33
|
*/
|
|
32
34
|
class Sphere extends SolidPrimitive_1.SolidPrimitive {
|