@itwin/rpcinterface-full-stack-tests 4.7.0-dev.0 → 4.7.0-dev.11
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/dist/_bea9.bundled-tests.js.map +1 -1
- package/lib/dist/bundled-tests.js +1182 -1003
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_3_1_6_node_modules_loaders_gl_draco_di-0642a6.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_meshoptimizer_0_20_0_node_modules_meshoptimizer_index_m-a5ae61.bundled-tests.js.map +1 -1
- package/package.json +17 -17
|
@@ -34486,6 +34486,8 @@ var ChangesetType;
|
|
|
34486
34486
|
ChangesetType[ChangesetType["Regular"] = 0] = "Regular";
|
|
34487
34487
|
/** changeset *does* contain schema changes. */
|
|
34488
34488
|
ChangesetType[ChangesetType["Schema"] = 1] = "Schema";
|
|
34489
|
+
/** Schema changeset pushed by iModel with SchemaSync enabled */
|
|
34490
|
+
ChangesetType[ChangesetType["SchemaSync"] = 65] = "SchemaSync";
|
|
34489
34491
|
})(ChangesetType || (ChangesetType = {}));
|
|
34490
34492
|
|
|
34491
34493
|
|
|
@@ -44633,7 +44635,8 @@ class QPoint2d {
|
|
|
44633
44635
|
return pt;
|
|
44634
44636
|
}
|
|
44635
44637
|
}
|
|
44636
|
-
/**
|
|
44638
|
+
/**
|
|
44639
|
+
* @public
|
|
44637
44640
|
* @extensions
|
|
44638
44641
|
*/
|
|
44639
44642
|
var QPoint2dBuffer;
|
|
@@ -50368,30 +50371,38 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
50368
50371
|
|
|
50369
50372
|
/**
|
|
50370
50373
|
* Represents a formatted block of text positioned in 2d or 3d space.
|
|
50371
|
-
* [TextAnnotation2d]($backend) and [TextAnnotation3d]($backend) elements store a TextAnnotation from which their geometric representation is generated.
|
|
50374
|
+
* [TextAnnotation2d]($backend) and [TextAnnotation3d]($backend) elements store a single TextAnnotation from which their geometric representation is generated.
|
|
50375
|
+
* Other types of elements may store multiple TextAnnotations, positioned relative to one another.
|
|
50376
|
+
* The annotation's position and orientation relative to the host element's [Placement]($common) is determined as follows:
|
|
50377
|
+
* - First, the width and height of a box enclosing the contents of the [[textBlock]] must be computed using [computeTextBlockExtents]($backend). This yields a box with the top-left
|
|
50378
|
+
* corner at (0, 0) and the bottom-right corner at (width, -height).
|
|
50379
|
+
* - Then, an "anchor point" is computed based on the text box and the [[anchor]] property. For example, if the annotation is anchored at the center-left, the anchor point will be (width/2, -height).
|
|
50380
|
+
* - The [[orientation]] is applied to rotate the box around the anchor point.
|
|
50381
|
+
* - Finally, the [[offset]] is added to the anchor point to apply translation.
|
|
50372
50382
|
* @see [produceTextAnnotationGeometry]($backend) to decompose the annotation into a set of geometric primitives suitable for use with [[GeometryStreamBuilder.appendTextBlock]].
|
|
50373
50383
|
* @beta
|
|
50374
|
-
* @preview
|
|
50375
|
-
* @extensions
|
|
50376
50384
|
*/
|
|
50377
50385
|
class TextAnnotation {
|
|
50378
|
-
constructor(angles, textBlock, anchor) {
|
|
50386
|
+
constructor(offset, angles, textBlock, anchor) {
|
|
50387
|
+
this.offset = offset;
|
|
50379
50388
|
this.orientation = angles;
|
|
50380
50389
|
this.textBlock = textBlock;
|
|
50381
50390
|
this.anchor = anchor;
|
|
50382
50391
|
}
|
|
50383
50392
|
/** Creates a new TextAnnotation. */
|
|
50384
50393
|
static create(args) {
|
|
50394
|
+
const offset = args?.offset ?? new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Point3d();
|
|
50385
50395
|
const angles = args?.orientation ?? new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.YawPitchRollAngles();
|
|
50386
50396
|
const textBlock = args?.textBlock ?? _TextBlock__WEBPACK_IMPORTED_MODULE_1__.TextBlock.createEmpty();
|
|
50387
50397
|
const anchor = args?.anchor ?? { vertical: "top", horizontal: "left" };
|
|
50388
|
-
return new TextAnnotation(angles, textBlock, anchor);
|
|
50398
|
+
return new TextAnnotation(offset, angles, textBlock, anchor);
|
|
50389
50399
|
}
|
|
50390
50400
|
/**
|
|
50391
50401
|
* Creates a new TextAnnotation instance from its JSON representation.
|
|
50392
50402
|
*/
|
|
50393
50403
|
static fromJSON(props) {
|
|
50394
50404
|
return TextAnnotation.create({
|
|
50405
|
+
offset: props?.offset ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Point3d.fromJSON(props.offset) : undefined,
|
|
50395
50406
|
orientation: props?.orientation ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.YawPitchRollAngles.fromJSON(props.orientation) : undefined,
|
|
50396
50407
|
textBlock: props?.textBlock ? _TextBlock__WEBPACK_IMPORTED_MODULE_1__.TextBlock.create(props.textBlock) : undefined,
|
|
50397
50408
|
anchor: props?.anchor ? { ...props.anchor } : undefined,
|
|
@@ -50405,6 +50416,9 @@ class TextAnnotation {
|
|
|
50405
50416
|
// Even if the text block is empty, we want to record its style name and overrides, e.g.,
|
|
50406
50417
|
// so the user can pick up where they left off editing it next time.
|
|
50407
50418
|
props.textBlock = this.textBlock.toJSON();
|
|
50419
|
+
if (!this.offset.isZero) {
|
|
50420
|
+
props.offset = this.offset.toJSON();
|
|
50421
|
+
}
|
|
50408
50422
|
if (!this.orientation.isIdentity()) {
|
|
50409
50423
|
props.orientation = this.orientation.toJSON();
|
|
50410
50424
|
}
|
|
@@ -50413,32 +50427,41 @@ class TextAnnotation {
|
|
|
50413
50427
|
}
|
|
50414
50428
|
return props;
|
|
50415
50429
|
}
|
|
50416
|
-
/**
|
|
50417
|
-
*
|
|
50430
|
+
/** Compute the transform that positions and orients this annotation relative to its anchor point, based on the [[textBlock]]'s computed bounding box.
|
|
50431
|
+
* The anchor point is computed as specified by this annotation's [[anchor]] setting. For example, if the text block is anchored
|
|
50432
|
+
* at the bottom left, then the transform will be relative to the bottom-left corner of `textBlockExtents`.
|
|
50433
|
+
* The text block will be rotated around the fixed anchor point according to [[orientation]], then the anchor point will be translated by [[offset]].
|
|
50434
|
+
* @param textBlockDimensions The width and height of the bounding box containing the text block. You can compute this using [computeTextBlockExtents]($backend).
|
|
50435
|
+
* @see [[computeAnchorPoint]] to compute the transform's anchor point.
|
|
50418
50436
|
*/
|
|
50419
|
-
|
|
50420
|
-
const
|
|
50437
|
+
computeTransform(textBlockDimensions) {
|
|
50438
|
+
const anchorPt = this.computeAnchorPoint(textBlockDimensions);
|
|
50421
50439
|
const matrix = this.orientation.toMatrix3d();
|
|
50422
|
-
|
|
50440
|
+
const rotation = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Transform.createFixedPointAndMatrix(anchorPt, matrix);
|
|
50441
|
+
const translation = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Transform.createTranslation(this.offset);
|
|
50442
|
+
return translation.multiplyTransformTransform(rotation, rotation);
|
|
50423
50443
|
}
|
|
50424
|
-
/**
|
|
50425
|
-
|
|
50444
|
+
/** Compute the anchor point of this annotation as specified by [[anchor]].
|
|
50445
|
+
* @param textBlockDimensions The width and height of the bounding box containing the [[textBlock]]. You can compute this using [computeTextBlockExtents]($backend).
|
|
50446
|
+
* @see [[computeTransform]] to compute the transform relative to the anchor point.
|
|
50447
|
+
*/
|
|
50448
|
+
computeAnchorPoint(textBlockDimensions) {
|
|
50426
50449
|
let x = 0;
|
|
50427
50450
|
let y = 0;
|
|
50428
50451
|
switch (this.anchor.horizontal) {
|
|
50429
50452
|
case "center":
|
|
50430
|
-
x +=
|
|
50453
|
+
x += textBlockDimensions.x / 2;
|
|
50431
50454
|
break;
|
|
50432
50455
|
case "right":
|
|
50433
|
-
x +=
|
|
50456
|
+
x += textBlockDimensions.x;
|
|
50434
50457
|
break;
|
|
50435
50458
|
}
|
|
50436
50459
|
switch (this.anchor.vertical) {
|
|
50437
50460
|
case "middle":
|
|
50438
|
-
y -=
|
|
50461
|
+
y -= textBlockDimensions.y / 2;
|
|
50439
50462
|
break;
|
|
50440
50463
|
case "bottom":
|
|
50441
|
-
y -=
|
|
50464
|
+
y -= textBlockDimensions.y;
|
|
50442
50465
|
break;
|
|
50443
50466
|
}
|
|
50444
50467
|
return new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Point3d(x, y, 0);
|
|
@@ -50446,7 +50469,8 @@ class TextAnnotation {
|
|
|
50446
50469
|
/** Returns true if this annotation is logically equivalent to `other`. */
|
|
50447
50470
|
equals(other) {
|
|
50448
50471
|
return this.anchor.horizontal === other.anchor.horizontal && this.anchor.vertical === other.anchor.vertical
|
|
50449
|
-
&& this.orientation.isAlmostEqual(other.orientation) && this.
|
|
50472
|
+
&& this.orientation.isAlmostEqual(other.orientation) && this.offset.isAlmostEqual(other.offset)
|
|
50473
|
+
&& this.textBlock.equals(other.textBlock);
|
|
50450
50474
|
}
|
|
50451
50475
|
}
|
|
50452
50476
|
|
|
@@ -50480,8 +50504,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
50480
50504
|
/** Abstract representation of any of the building blocks that make up a [[TextBlock]] document - namely [[Run]]s, [[Paragraph]]s, and [[TextBlock]] itself.
|
|
50481
50505
|
* Each component can specify a [[TextStyle]] that formats its contents and optional [[styleOverrides]] to customize that formatting.
|
|
50482
50506
|
* @beta
|
|
50483
|
-
* @preview
|
|
50484
|
-
* @extensions
|
|
50485
50507
|
*/
|
|
50486
50508
|
class TextBlockComponent {
|
|
50487
50509
|
/** @internal */
|
|
@@ -50551,8 +50573,6 @@ class TextBlockComponent {
|
|
|
50551
50573
|
* multiple lines, but it will never contain different styling.
|
|
50552
50574
|
* Use the `type` field to discriminate between the different kinds of runs.
|
|
50553
50575
|
* @beta
|
|
50554
|
-
* @preview
|
|
50555
|
-
* @extensions
|
|
50556
50576
|
*/
|
|
50557
50577
|
var Run;
|
|
50558
50578
|
(function (Run) {
|
|
@@ -50570,8 +50590,6 @@ var Run;
|
|
|
50570
50590
|
})(Run || (Run = {}));
|
|
50571
50591
|
/** The most common type of [[Run]], containing a sequence of characters to be displayed using a single style.
|
|
50572
50592
|
* @beta
|
|
50573
|
-
* @preview
|
|
50574
|
-
* @extensions
|
|
50575
50593
|
*/
|
|
50576
50594
|
class TextRun extends TextBlockComponent {
|
|
50577
50595
|
constructor(props) {
|
|
@@ -50606,8 +50624,6 @@ class TextRun extends TextBlockComponent {
|
|
|
50606
50624
|
/** A [[Run]] containing a numeric ratio to be displayed as a numerator and denominator separated by a horizontal or diagonal bar.
|
|
50607
50625
|
* @note The [[numerator]] and [[denominator]] are stored as strings. They are not technically required to contain a numeric representation.
|
|
50608
50626
|
* @beta
|
|
50609
|
-
* @preview
|
|
50610
|
-
* @extensions
|
|
50611
50627
|
*/
|
|
50612
50628
|
class FractionRun extends TextBlockComponent {
|
|
50613
50629
|
constructor(props) {
|
|
@@ -50642,8 +50658,6 @@ class FractionRun extends TextBlockComponent {
|
|
|
50642
50658
|
}
|
|
50643
50659
|
/** A [[Run]] that represents the end of a line of text within a [[Paragraph]]. It contains no content of its own - it simply causes subsequent content to display on a new line.
|
|
50644
50660
|
* @beta
|
|
50645
|
-
* @preview
|
|
50646
|
-
* @extensions
|
|
50647
50661
|
*/
|
|
50648
50662
|
class LineBreakRun extends TextBlockComponent {
|
|
50649
50663
|
constructor(props) {
|
|
@@ -50673,8 +50687,6 @@ class LineBreakRun extends TextBlockComponent {
|
|
|
50673
50687
|
}
|
|
50674
50688
|
/** A collection of [[Run]]s within a [[TextBlock]]. Each paragraph within a text block is laid out on a separate line.
|
|
50675
50689
|
* @beta
|
|
50676
|
-
* @preview
|
|
50677
|
-
* @extensions
|
|
50678
50690
|
*/
|
|
50679
50691
|
class Paragraph extends TextBlockComponent {
|
|
50680
50692
|
constructor(props) {
|
|
@@ -50722,8 +50734,6 @@ class Paragraph extends TextBlockComponent {
|
|
|
50722
50734
|
* No word-wrapping is applied to the document unless a [[width]] greater than zero is specified.
|
|
50723
50735
|
* @see [[TextAnnotation]] to position a text block as an annotation in 2d or 3d space.
|
|
50724
50736
|
* @beta
|
|
50725
|
-
* @preview
|
|
50726
|
-
* @extensions
|
|
50727
50737
|
*/
|
|
50728
50738
|
class TextBlock extends TextBlockComponent {
|
|
50729
50739
|
constructor(props) {
|
|
@@ -50846,8 +50856,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
50846
50856
|
* @note This is an immutable type. Use [[clone]] to create a modified copy.
|
|
50847
50857
|
* @see [[TextStyleSettingsProps]] for documentation of each of the settings.
|
|
50848
50858
|
* @beta
|
|
50849
|
-
* @preview
|
|
50850
|
-
* @extensions
|
|
50851
50859
|
*/
|
|
50852
50860
|
class TextStyleSettings {
|
|
50853
50861
|
constructor(props, defaults) {
|
|
@@ -50914,8 +50922,6 @@ Object.freeze(TextStyleSettings.defaults);
|
|
|
50914
50922
|
* @see [[TextBlockComponent.styleName]] to define the text style for a component of a [[TextBlock]].
|
|
50915
50923
|
* @note This is an immutable type. Use [[clone]] to create a modified copy.
|
|
50916
50924
|
* @beta
|
|
50917
|
-
* @preview
|
|
50918
|
-
* @extensions
|
|
50919
50925
|
*/
|
|
50920
50926
|
class TextStyle {
|
|
50921
50927
|
constructor(name, settings) {
|
|
@@ -53040,10 +53046,8 @@ var ElementGeometry;
|
|
|
53040
53046
|
return true;
|
|
53041
53047
|
}
|
|
53042
53048
|
/** Append a series of entries representing a [[TextBlock]] to the [[ElementGeometryDataEntry]] array.
|
|
53043
|
-
|
|
53044
|
-
|
|
53045
|
-
* @preview
|
|
53046
|
-
*/
|
|
53049
|
+
* @beta
|
|
53050
|
+
*/
|
|
53047
53051
|
appendTextBlock(block) {
|
|
53048
53052
|
for (const entry of block.entries) {
|
|
53049
53053
|
let result;
|
|
@@ -59382,8 +59386,6 @@ class GeometryStreamBuilder {
|
|
|
59382
59386
|
}
|
|
59383
59387
|
/** Append a series of entries representing a [[TextBlock]] to the [[GeometryStreamProps]] array.
|
|
59384
59388
|
* @beta
|
|
59385
|
-
* @extensions
|
|
59386
|
-
* @preview
|
|
59387
59389
|
*/
|
|
59388
59390
|
appendTextBlock(block) {
|
|
59389
59391
|
for (const entry of block.entries) {
|
|
@@ -61982,7 +61984,7 @@ class RpcInvocation {
|
|
|
61982
61984
|
status: this.protocol.getCode(this.status),
|
|
61983
61985
|
id: this.request.id,
|
|
61984
61986
|
interfaceName: (typeof (this.operation) === "undefined") ? "" : this.operation.interfaceDefinition.interfaceName,
|
|
61985
|
-
allowCompression: this.operation
|
|
61987
|
+
allowCompression: this.operation ? this.operation.policy.allowResponseCompression : true,
|
|
61986
61988
|
};
|
|
61987
61989
|
this.transformResponseStatus(fulfillment, rawResult);
|
|
61988
61990
|
try {
|
|
@@ -62083,9 +62085,8 @@ class RpcMarshaling {
|
|
|
62083
62085
|
/** Serializes a value. */
|
|
62084
62086
|
static serialize(protocol, value) {
|
|
62085
62087
|
const serialized = RpcSerializedValue.create();
|
|
62086
|
-
if (
|
|
62088
|
+
if (value === undefined)
|
|
62087
62089
|
return serialized;
|
|
62088
|
-
}
|
|
62089
62090
|
marshalingTarget = serialized;
|
|
62090
62091
|
chunkThreshold = protocol ? protocol.transferChunkThreshold : 0;
|
|
62091
62092
|
serialized.objects = JSON.stringify(value, (_key, _value) => WireFormat.marshal(_key, _value));
|
|
@@ -62253,7 +62254,7 @@ class RpcOperationPolicy {
|
|
|
62253
62254
|
/** Whether the IModelRpcProps in the operation parameter list is allowed to differ from the token in the request URL. */
|
|
62254
62255
|
this.allowTokenMismatch = false;
|
|
62255
62256
|
/** Whether to compress the operation response with one of the client's supported encodings. */
|
|
62256
|
-
this.allowResponseCompression =
|
|
62257
|
+
this.allowResponseCompression = true;
|
|
62257
62258
|
}
|
|
62258
62259
|
}
|
|
62259
62260
|
/** An RPC operation descriptor.
|
|
@@ -63311,6 +63312,8 @@ class RpcRequest {
|
|
|
63311
63312
|
return this.reject(new _IModelError__WEBPACK_IMPORTED_MODULE_1__.NoContentError());
|
|
63312
63313
|
}
|
|
63313
63314
|
handleNotFound(status, value) {
|
|
63315
|
+
if (RpcRequest.notFoundHandlers.numberOfListeners === 0)
|
|
63316
|
+
this.handleRejected(value);
|
|
63314
63317
|
const response = _RpcMarshaling__WEBPACK_IMPORTED_MODULE_4__.RpcMarshaling.deserialize(this.protocol, value);
|
|
63315
63318
|
this.setStatus(status);
|
|
63316
63319
|
let resubmitted = false;
|
|
@@ -63318,8 +63321,8 @@ class RpcRequest {
|
|
|
63318
63321
|
if (resubmitted)
|
|
63319
63322
|
throw new _IModelError__WEBPACK_IMPORTED_MODULE_1__.IModelError(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyStatus.ERROR, `Already resubmitted using this handler.`);
|
|
63320
63323
|
resubmitted = true;
|
|
63321
|
-
this.submit();
|
|
63322
|
-
}, (reason) => this.reject(reason));
|
|
63324
|
+
void this.submit();
|
|
63325
|
+
}, (reason) => reason ? this.reject(reason) : this.handleRejected(value));
|
|
63323
63326
|
return;
|
|
63324
63327
|
}
|
|
63325
63328
|
resolve(result) {
|
|
@@ -65277,13 +65280,13 @@ var CurrentImdlVersion;
|
|
|
65277
65280
|
* front-end is not capable of reading the tile content. Otherwise, this front-end can read the tile content even if the header specifies a
|
|
65278
65281
|
* greater minor version than CurrentVersion.Minor, although some data may be skipped.
|
|
65279
65282
|
*/
|
|
65280
|
-
CurrentImdlVersion[CurrentImdlVersion["Major"] =
|
|
65283
|
+
CurrentImdlVersion[CurrentImdlVersion["Major"] = 34] = "Major";
|
|
65281
65284
|
/** The unsigned 16-bit minor version number. If the major version in the tile header is equal to CurrentVersion.Major, then this package can
|
|
65282
65285
|
* read the tile content even if the minor version in the tile header is greater than this value, although some data may be skipped.
|
|
65283
65286
|
*/
|
|
65284
65287
|
CurrentImdlVersion[CurrentImdlVersion["Minor"] = 0] = "Minor";
|
|
65285
65288
|
/** The unsigned 32-bit version number derived from the 16-bit major and minor version numbers. */
|
|
65286
|
-
CurrentImdlVersion[CurrentImdlVersion["Combined"] =
|
|
65289
|
+
CurrentImdlVersion[CurrentImdlVersion["Combined"] = 2228224] = "Combined";
|
|
65287
65290
|
})(CurrentImdlVersion || (CurrentImdlVersion = {}));
|
|
65288
65291
|
/** Header embedded at the beginning of binary tile data in iMdl format describing its contents.
|
|
65289
65292
|
* @internal
|
|
@@ -65592,6 +65595,7 @@ var TileOptions;
|
|
|
65592
65595
|
ignoreAreaPatterns: 0 !== (contentFlags & ContentFlags.IgnoreAreaPatterns),
|
|
65593
65596
|
enableExternalTextures: 0 !== (contentFlags & ContentFlags.ExternalTextures),
|
|
65594
65597
|
useProjectExtents: 0 !== (tree.flags & TreeFlags.UseProjectExtents),
|
|
65598
|
+
expandProjectExtents: 0 !== (tree.flags & TreeFlags.ExpandProjectExtents),
|
|
65595
65599
|
optimizeBRepProcessing: 0 !== (tree.flags & TreeFlags.OptimizeBRepProcessing),
|
|
65596
65600
|
useLargerTiles: 0 !== (tree.flags & TreeFlags.UseLargerTiles),
|
|
65597
65601
|
disableMagnification: false,
|
|
@@ -65735,6 +65739,7 @@ const defaultTileOptions = Object.freeze({
|
|
|
65735
65739
|
ignoreAreaPatterns: false,
|
|
65736
65740
|
enableExternalTextures: true,
|
|
65737
65741
|
useProjectExtents: true,
|
|
65742
|
+
expandProjectExtents: true,
|
|
65738
65743
|
optimizeBRepProcessing: true,
|
|
65739
65744
|
useLargerTiles: true,
|
|
65740
65745
|
disableMagnification: false,
|
|
@@ -65834,6 +65839,7 @@ var TreeFlags;
|
|
|
65834
65839
|
TreeFlags[TreeFlags["EnforceDisplayPriority"] = 2] = "EnforceDisplayPriority";
|
|
65835
65840
|
TreeFlags[TreeFlags["OptimizeBRepProcessing"] = 4] = "OptimizeBRepProcessing";
|
|
65836
65841
|
TreeFlags[TreeFlags["UseLargerTiles"] = 8] = "UseLargerTiles";
|
|
65842
|
+
TreeFlags[TreeFlags["ExpandProjectExtents"] = 16] = "ExpandProjectExtents"; // If UseProjectExtents, round them up/down to nearest powers of ten.
|
|
65837
65843
|
})(TreeFlags || (TreeFlags = {}));
|
|
65838
65844
|
function animationIdToString(animationId) {
|
|
65839
65845
|
return `A:${animationId}_`;
|
|
@@ -65848,6 +65854,8 @@ function iModelTileTreeIdToString(modelId, treeId, options) {
|
|
|
65848
65854
|
flags |= TreeFlags.OptimizeBRepProcessing;
|
|
65849
65855
|
if (options.useLargerTiles)
|
|
65850
65856
|
flags |= TreeFlags.UseLargerTiles;
|
|
65857
|
+
if (options.expandProjectExtents)
|
|
65858
|
+
flags |= TreeFlags.ExpandProjectExtents;
|
|
65851
65859
|
if (_FeatureTable__WEBPACK_IMPORTED_MODULE_2__.BatchType.Primary === treeId.type) {
|
|
65852
65860
|
if (undefined !== treeId.animationId)
|
|
65853
65861
|
idStr = `${idStr}${animationIdToString(treeId.animationId)}`;
|
|
@@ -65860,8 +65868,11 @@ function iModelTileTreeIdToString(modelId, treeId, options) {
|
|
|
65860
65868
|
else {
|
|
65861
65869
|
const typeStr = _FeatureTable__WEBPACK_IMPORTED_MODULE_2__.BatchType.PlanarClassifier === treeId.type ? "CP" : "C";
|
|
65862
65870
|
idStr = `${idStr + typeStr}:${treeId.expansion.toFixed(6)}_`;
|
|
65863
|
-
if (_FeatureTable__WEBPACK_IMPORTED_MODULE_2__.BatchType.VolumeClassifier === treeId.type)
|
|
65871
|
+
if (_FeatureTable__WEBPACK_IMPORTED_MODULE_2__.BatchType.VolumeClassifier === treeId.type) {
|
|
65872
|
+
// Volume classifiers always use the exact project extents.
|
|
65864
65873
|
flags |= TreeFlags.UseProjectExtents;
|
|
65874
|
+
flags &= ~TreeFlags.ExpandProjectExtents;
|
|
65875
|
+
}
|
|
65865
65876
|
if (undefined !== treeId.animationId)
|
|
65866
65877
|
idStr = `${idStr}${animationIdToString(treeId.animationId)}`;
|
|
65867
65878
|
}
|
|
@@ -82156,10 +82167,10 @@ class CheckpointConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_4_
|
|
|
82156
82167
|
super(props);
|
|
82157
82168
|
this._reopenConnectionHandler = async (request, response, resubmit, reject) => {
|
|
82158
82169
|
if (!response.hasOwnProperty("isIModelNotFoundResponse"))
|
|
82159
|
-
|
|
82170
|
+
reject();
|
|
82160
82171
|
const iModelRpcProps = request.parameters[0];
|
|
82161
82172
|
if (this._fileKey !== iModelRpcProps.key)
|
|
82162
|
-
|
|
82173
|
+
reject(); // The handler is called for a different connection than this
|
|
82163
82174
|
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logTrace(loggerCategory, "Attempting to reopen connection", () => iModelRpcProps);
|
|
82164
82175
|
try {
|
|
82165
82176
|
const openResponse = await CheckpointConnection.callOpen(iModelRpcProps, this.routingContext);
|
|
@@ -107014,7 +107025,6 @@ const extensionExports = {
|
|
|
107014
107025
|
FlashMode: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.FlashMode,
|
|
107015
107026
|
FlashSettings: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.FlashSettings,
|
|
107016
107027
|
FontType: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.FontType,
|
|
107017
|
-
FractionRun: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.FractionRun,
|
|
107018
107028
|
FrontendLoggerCategory: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.FrontendLoggerCategory,
|
|
107019
107029
|
FrustumAnimator: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.FrustumAnimator,
|
|
107020
107030
|
FrustumPlanes: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.FrustumPlanes,
|
|
@@ -107049,7 +107059,6 @@ const extensionExports = {
|
|
|
107049
107059
|
InteractiveTool: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.InteractiveTool,
|
|
107050
107060
|
IntersectDetail: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.IntersectDetail,
|
|
107051
107061
|
KeyinParseError: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.KeyinParseError,
|
|
107052
|
-
LineBreakRun: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.LineBreakRun,
|
|
107053
107062
|
LinePixels: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.LinePixels,
|
|
107054
107063
|
LocateAction: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.LocateAction,
|
|
107055
107064
|
LocateFilterStatus: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.LocateFilterStatus,
|
|
@@ -107075,7 +107084,6 @@ const extensionExports = {
|
|
|
107075
107084
|
OutputMessageAlert: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.OutputMessageAlert,
|
|
107076
107085
|
OutputMessagePriority: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.OutputMessagePriority,
|
|
107077
107086
|
OutputMessageType: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.OutputMessageType,
|
|
107078
|
-
Paragraph: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.Paragraph,
|
|
107079
107087
|
ParseAndRunResult: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.ParseAndRunResult,
|
|
107080
107088
|
ParticleCollectionBuilder: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.ParticleCollectionBuilder,
|
|
107081
107089
|
PerModelCategoryVisibility: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.PerModelCategoryVisibility,
|
|
@@ -107103,7 +107111,6 @@ const extensionExports = {
|
|
|
107103
107111
|
RenderGraphicOwner: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.RenderGraphicOwner,
|
|
107104
107112
|
RenderMode: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.RenderMode,
|
|
107105
107113
|
RenderSystem: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.RenderSystem,
|
|
107106
|
-
Run: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.Run,
|
|
107107
107114
|
Scene: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.Scene,
|
|
107108
107115
|
ScreenViewport: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.ScreenViewport,
|
|
107109
107116
|
SectionDrawingModelState: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.SectionDrawingModelState,
|
|
@@ -107132,12 +107139,6 @@ const extensionExports = {
|
|
|
107132
107139
|
SyncMode: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.SyncMode,
|
|
107133
107140
|
TentativePoint: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.TentativePoint,
|
|
107134
107141
|
TerrainHeightOriginMode: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TerrainHeightOriginMode,
|
|
107135
|
-
TextAnnotation: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TextAnnotation,
|
|
107136
|
-
TextBlock: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TextBlock,
|
|
107137
|
-
TextBlockComponent: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TextBlockComponent,
|
|
107138
|
-
TextRun: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TextRun,
|
|
107139
|
-
TextStyle: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TextStyle,
|
|
107140
|
-
TextStyleSettings: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TextStyleSettings,
|
|
107141
107142
|
TextureMapUnits: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TextureMapUnits,
|
|
107142
107143
|
ThematicDisplayMode: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ThematicDisplayMode,
|
|
107143
107144
|
ThematicGradientColorScheme: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ThematicGradientColorScheme,
|
|
@@ -152988,6 +152989,7 @@ class TileAdmin {
|
|
|
152988
152989
|
this.alwaysSubdivideIncompleteTiles = options.alwaysSubdivideIncompleteTiles ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.alwaysSubdivideIncompleteTiles;
|
|
152989
152990
|
this.maximumMajorTileFormatVersion = options.maximumMajorTileFormatVersion ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.maximumMajorTileFormatVersion;
|
|
152990
152991
|
this.useProjectExtents = options.useProjectExtents ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.useProjectExtents;
|
|
152992
|
+
this.expandProjectExtents = options.expandProjectExtents ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.expandProjectExtents;
|
|
152991
152993
|
this.optimizeBRepProcessing = options.optimizeBRepProcessing ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.optimizeBRepProcessing;
|
|
152992
152994
|
this.useLargerTiles = options.useLargerTiles ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.useLargerTiles;
|
|
152993
152995
|
this.mobileRealityTileMinToleranceRatio = Math.max(options.mobileRealityTileMinToleranceRatio ?? 3.0, 1.0);
|
|
@@ -156894,7 +156896,13 @@ async function getCesiumTerrainProvider(opts) {
|
|
|
156894
156896
|
}
|
|
156895
156897
|
const tilingScheme = new _internal__WEBPACK_IMPORTED_MODULE_8__.GeographicTilingScheme();
|
|
156896
156898
|
let tileAvailability;
|
|
156897
|
-
|
|
156899
|
+
// When collecting tiles, only the highest resolution tiles are downloaded.
|
|
156900
|
+
// Because of that, the tile availability is often only populated by the
|
|
156901
|
+
// "layer" metadata. (i.e. not from higher resolution tiles metadata).
|
|
156902
|
+
// Unfortunately the "layer" metadata only cover the first 16 levels,
|
|
156903
|
+
// preventing the geometry collector from accessing to higher resolution tiles.
|
|
156904
|
+
// For now, the solution is to turn off tile availability check when collecting geometries.
|
|
156905
|
+
if (undefined !== layers.available && !opts.produceGeometry) {
|
|
156898
156906
|
const availableTiles = layers.available;
|
|
156899
156907
|
tileAvailability = new _internal__WEBPACK_IMPORTED_MODULE_8__.TileAvailability(tilingScheme, availableTiles.length);
|
|
156900
156908
|
for (let level = 0; level < layers.available.length; level++) {
|
|
@@ -162396,6 +162404,7 @@ class MapTreeSupplier {
|
|
|
162396
162404
|
exaggeration: id.terrainExaggeration,
|
|
162397
162405
|
wantNormals: id.wantNormals,
|
|
162398
162406
|
dataSource: id.terrainDataSource,
|
|
162407
|
+
produceGeometry: id.produceGeometry,
|
|
162399
162408
|
};
|
|
162400
162409
|
if (id.applyTerrain) {
|
|
162401
162410
|
await _ApproximateTerrainHeights__WEBPACK_IMPORTED_MODULE_3__.ApproximateTerrainHeights.instance.initialize();
|
|
@@ -173392,6 +173401,17 @@ class ToolAdmin {
|
|
|
173392
173401
|
if (!await _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.tools.run(this.defaultToolId, this.defaultToolArgs))
|
|
173393
173402
|
return this.startPrimitiveTool(undefined);
|
|
173394
173403
|
}
|
|
173404
|
+
/**
|
|
173405
|
+
* Call from external events or immediate tools that may have invalidated the current primitive tool's state.
|
|
173406
|
+
* Examples are undo, which may invalidate any references to elements, or an immediate tool that uses an edit command to write to the iModel,
|
|
173407
|
+
* since immediate tools do not replace the active tool.
|
|
173408
|
+
* The current primitive tool is expected to call installTool with a new instance, or exitTool to start the default tool.
|
|
173409
|
+
* @note Should be called even if the primitive tool is currently suspended by a view tool or input collector.
|
|
173410
|
+
*/
|
|
173411
|
+
async restartPrimitiveTool() {
|
|
173412
|
+
if (undefined !== this._primitiveTool)
|
|
173413
|
+
await this._primitiveTool.onRestartTool();
|
|
173414
|
+
}
|
|
173395
173415
|
setCursor(cursor) {
|
|
173396
173416
|
if (undefined === this._saveCursor)
|
|
173397
173417
|
_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.viewManager.setViewCursor(cursor);
|
|
@@ -202635,17 +202655,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
202635
202655
|
/* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
|
|
202636
202656
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
202637
202657
|
/* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
|
|
202638
|
-
/* harmony import */ var
|
|
202658
|
+
/* harmony import */ var _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../geometry3d/GrowableFloat64Array */ "../../core/geometry/lib/esm/geometry3d/GrowableFloat64Array.js");
|
|
202639
202659
|
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
202640
202660
|
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
202641
202661
|
/* harmony import */ var _numerics_Newton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../numerics/Newton */ "../../core/geometry/lib/esm/numerics/Newton.js");
|
|
202642
|
-
/* harmony import */ var
|
|
202662
|
+
/* harmony import */ var _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../numerics/Polynomials */ "../../core/geometry/lib/esm/numerics/Polynomials.js");
|
|
202643
202663
|
/* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
202644
202664
|
/* harmony import */ var _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../CurveChainWithDistanceIndex */ "../../core/geometry/lib/esm/curve/CurveChainWithDistanceIndex.js");
|
|
202645
202665
|
/* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
202646
202666
|
/* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
|
|
202647
202667
|
/* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
202648
|
-
/* harmony import */ var
|
|
202668
|
+
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
202649
202669
|
/*---------------------------------------------------------------------------------------------
|
|
202650
202670
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
202651
202671
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -202975,6 +202995,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
202975
202995
|
* Check different combination of fractions on curveA and curveB. If distance between points at 2 fractions
|
|
202976
202996
|
* is less than maxDistance, record CurveLocationDetailPair which is the approach between the 2 points.
|
|
202977
202997
|
* Optionally, record close approaches of one curve's points if they fall between the other curve's points.
|
|
202998
|
+
* * If an input curve is a LineString3d, then the corresponding fractions must define a segment of the line string.
|
|
202978
202999
|
* @param cpA curveA
|
|
202979
203000
|
* @param fA0 fraction0 on curveA
|
|
202980
203001
|
* @param fA1 fraction1 on curveA
|
|
@@ -203010,7 +203031,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203010
203031
|
*/
|
|
203011
203032
|
getPointCurveClosestApproachXYNewton(curveP, pointQ) {
|
|
203012
203033
|
if (!(curveP instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) && !(curveP instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d)) {
|
|
203013
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
203034
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"getPointCurveClosestApproachXYNewton only supports Arc3d and LineSegment");
|
|
203014
203035
|
return undefined;
|
|
203015
203036
|
}
|
|
203016
203037
|
const seeds = [0.2, 0.4, 0.6, 0.8]; // HEURISTIC: arcs have up to 4 perpendiculars; lines have only 1
|
|
@@ -203038,9 +203059,24 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203038
203059
|
return _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveFractionPoint(curveP, minCurvePFraction, minPointP);
|
|
203039
203060
|
return undefined;
|
|
203040
203061
|
}
|
|
203041
|
-
/**
|
|
203062
|
+
/**
|
|
203063
|
+
* Find the closest approach between `pointA` and `cpB`. Add the approach if it's within `fB0` and `fB1`.
|
|
203064
|
+
* * Does not test the endpoints of `cpB`.
|
|
203065
|
+
* * The only types supported for `cpB` are Arc3d, LineSegment3d, and LineString3d.
|
|
203066
|
+
* * If `cpB` is a LineString3d, then the interval `[fB0, fB1]` must correspond to a segment of the line string.
|
|
203067
|
+
*/
|
|
203042
203068
|
testAndRecordProjection(cpA, fA, pointA, cpB, fB0, fB1, reversed) {
|
|
203043
|
-
|
|
203069
|
+
let detail;
|
|
203070
|
+
if (cpB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
|
|
203071
|
+
const segParamsB = cpB.globalFractionToSegmentIndexAndLocalFraction(fB0 <= fB1 ? fB0 : fB1);
|
|
203072
|
+
const segIndexB = (segParamsB.fraction < 0.999999) ? segParamsB.index : segParamsB.index + 1;
|
|
203073
|
+
const segmentB = cpB.getIndexedSegment(segIndexB);
|
|
203074
|
+
if (segmentB && (detail = this.getPointCurveClosestApproachXYNewton(segmentB, pointA)))
|
|
203075
|
+
_LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.convertLocalToGlobalDetail(detail, segIndexB, cpB.numEdges(), cpB);
|
|
203076
|
+
}
|
|
203077
|
+
else {
|
|
203078
|
+
detail = this.getPointCurveClosestApproachXYNewton(cpB, pointA);
|
|
203079
|
+
}
|
|
203044
203080
|
if (detail) {
|
|
203045
203081
|
const fB = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.restrictToInterval(detail.fraction, fB0, fB1);
|
|
203046
203082
|
if (fB === detail.fraction) { // if fraction is within fB0 and fB1
|
|
@@ -203100,15 +203136,15 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203100
203136
|
const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.center, 1); // det(A0, A1, C)
|
|
203101
203137
|
const beta = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector0, 0); // det(A0, A1, U)
|
|
203102
203138
|
const gamma = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector90, 0); // det(A0, A1, V)
|
|
203103
|
-
const cosines = new
|
|
203104
|
-
const sines = new
|
|
203105
|
-
const radians = new
|
|
203106
|
-
const numRoots =
|
|
203139
|
+
const cosines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__.GrowableFloat64Array(2);
|
|
203140
|
+
const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__.GrowableFloat64Array(2);
|
|
203141
|
+
const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__.GrowableFloat64Array(2);
|
|
203142
|
+
const numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_9__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(// solve the equation
|
|
203107
203143
|
alpha, beta, gamma, cosines, sines, radians);
|
|
203108
203144
|
for (let i = 0; i < numRoots; i++) {
|
|
203109
203145
|
const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
|
|
203110
203146
|
const arcFraction = data.sweep.radiansToSignedPeriodicFraction(radians.atUncheckedIndex(i));
|
|
203111
|
-
const lineFraction =
|
|
203147
|
+
const lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_9__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
|
|
203112
203148
|
// only add if the point is within the start and end fractions of both line segment and arc
|
|
203113
203149
|
if (lineFraction !== undefined && this.acceptFraction(lineFraction) && this.acceptFraction(arcFraction)) {
|
|
203114
203150
|
this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
|
|
@@ -203128,7 +203164,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203128
203164
|
for (const radians1 of [parallelRadians, parallelRadians + Math.PI]) {
|
|
203129
203165
|
const arcPoint = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
|
|
203130
203166
|
const arcFraction = data.sweep.radiansToSignedPeriodicFraction(radians1);
|
|
203131
|
-
const lineFraction =
|
|
203167
|
+
const lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_9__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
|
|
203132
203168
|
// only add if the point is within the start and end fractions of both line segment and arc
|
|
203133
203169
|
if (lineFraction !== undefined && this.acceptFraction(lineFraction) && this.acceptFraction(arcFraction)) {
|
|
203134
203170
|
this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
|
|
@@ -203172,27 +203208,27 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203172
203208
|
}
|
|
203173
203209
|
/** Low level dispatch of arc with (beziers of) a bspline curve */
|
|
203174
203210
|
dispatchArcBsplineCurve3d(cpA, cpB, reversed) {
|
|
203175
|
-
const ls =
|
|
203211
|
+
const ls = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
|
|
203176
203212
|
cpB.emitStrokes(ls);
|
|
203177
203213
|
this.computeArcLineString(cpA, ls, reversed);
|
|
203178
203214
|
}
|
|
203179
203215
|
/** Low level dispatch of (beziers of) a bspline curve with (beziers of) a bspline curve */
|
|
203180
203216
|
dispatchBSplineCurve3dBSplineCurve3d(bcurveA, bcurveB, reversed) {
|
|
203181
|
-
const lsA =
|
|
203217
|
+
const lsA = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
|
|
203182
203218
|
bcurveA.emitStrokes(lsA);
|
|
203183
|
-
const lsB =
|
|
203219
|
+
const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
|
|
203184
203220
|
bcurveB.emitStrokes(lsB);
|
|
203185
203221
|
this.computeLineStringLineString(lsA, lsB, reversed);
|
|
203186
203222
|
}
|
|
203187
203223
|
/** Low level dispatch of linestring with (beziers of) a bspline curve */
|
|
203188
203224
|
dispatchLineStringBSplineCurve(lsA, curveB, reversed) {
|
|
203189
|
-
const lsB =
|
|
203225
|
+
const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
|
|
203190
203226
|
curveB.emitStrokes(lsB);
|
|
203191
203227
|
this.computeLineStringLineString(lsA, lsB, reversed);
|
|
203192
203228
|
}
|
|
203193
203229
|
/** Low level dispatch of segment with (beziers of) a bspline curve */
|
|
203194
203230
|
dispatchSegmentBsplineCurve(segA, curveB, reversed) {
|
|
203195
|
-
const lsB =
|
|
203231
|
+
const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
|
|
203196
203232
|
curveB.emitStrokes(lsB);
|
|
203197
203233
|
this.computeSegmentLineString(segA, lsB, reversed);
|
|
203198
203234
|
}
|
|
@@ -203252,7 +203288,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203252
203288
|
if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_11__.CurveChainWithDistanceIndex))
|
|
203253
203289
|
return;
|
|
203254
203290
|
if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_11__.CurveChainWithDistanceIndex) {
|
|
203255
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
203291
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"call handleCurveChainWithDistanceIndex(geomA) instead");
|
|
203256
203292
|
return;
|
|
203257
203293
|
}
|
|
203258
203294
|
const index0 = this._results.length;
|
|
@@ -203270,7 +203306,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203270
203306
|
const segmentB = this._geometryB;
|
|
203271
203307
|
this.dispatchSegmentSegment(segmentA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, segmentB, segmentB.point0Ref, 0.0, segmentB.point1Ref, 1.0, false);
|
|
203272
203308
|
}
|
|
203273
|
-
else if (this._geometryB instanceof
|
|
203309
|
+
else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
|
|
203274
203310
|
this.computeSegmentLineString(segmentA, this._geometryB, false);
|
|
203275
203311
|
}
|
|
203276
203312
|
else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
|
|
@@ -203365,7 +203401,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203365
203401
|
}
|
|
203366
203402
|
/** Double dispatch handler for strongly typed linestring. */
|
|
203367
203403
|
handleLineString3d(lsA) {
|
|
203368
|
-
if (this._geometryB instanceof
|
|
203404
|
+
if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
|
|
203369
203405
|
const lsB = this._geometryB;
|
|
203370
203406
|
this.computeLineStringLineString(lsA, lsB, false);
|
|
203371
203407
|
}
|
|
@@ -203391,7 +203427,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203391
203427
|
if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d) {
|
|
203392
203428
|
this.dispatchSegmentArc(this._geometryB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, arc0, true);
|
|
203393
203429
|
}
|
|
203394
|
-
else if (this._geometryB instanceof
|
|
203430
|
+
else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
|
|
203395
203431
|
this.computeArcLineString(arc0, this._geometryB, false);
|
|
203396
203432
|
}
|
|
203397
203433
|
else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
|
|
@@ -203413,7 +203449,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203413
203449
|
if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d) {
|
|
203414
203450
|
this.dispatchSegmentBsplineCurve(this._geometryB, curve, true);
|
|
203415
203451
|
}
|
|
203416
|
-
else if (this._geometryB instanceof
|
|
203452
|
+
else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
|
|
203417
203453
|
this.dispatchLineStringBSplineCurve(this._geometryB, curve, true);
|
|
203418
203454
|
}
|
|
203419
203455
|
else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
|
|
@@ -204202,7 +204238,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
204202
204238
|
if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_12__.CurveChainWithDistanceIndex))
|
|
204203
204239
|
return;
|
|
204204
204240
|
if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_12__.CurveChainWithDistanceIndex) {
|
|
204205
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
204241
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"call handleCurveChainWithDistanceIndex(geomA) instead");
|
|
204206
204242
|
return;
|
|
204207
204243
|
}
|
|
204208
204244
|
const index0 = this._results.length;
|
|
@@ -204990,7 +205026,7 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
204990
205026
|
if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_8__.CurveChainWithDistanceIndex))
|
|
204991
205027
|
return;
|
|
204992
205028
|
if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_8__.CurveChainWithDistanceIndex) {
|
|
204993
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
205029
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"call handleCurveChainWithDistanceIndex(geomA) instead");
|
|
204994
205030
|
return;
|
|
204995
205031
|
}
|
|
204996
205032
|
const index0 = this._results.length;
|
|
@@ -220214,6 +220250,10 @@ class XY {
|
|
|
220214
220250
|
get isAlmostZero() {
|
|
220215
220251
|
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(this.x) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(this.y);
|
|
220216
220252
|
}
|
|
220253
|
+
/** Return true if the x and y components are all exactly zero */
|
|
220254
|
+
get isZero() {
|
|
220255
|
+
return this.x === 0.0 && this.y === 0.0;
|
|
220256
|
+
}
|
|
220217
220257
|
/** Return the largest absolute value of any component */
|
|
220218
220258
|
maxAbs() {
|
|
220219
220259
|
return Math.max(Math.abs(this.x), Math.abs(this.y));
|
|
@@ -222367,10 +222407,10 @@ class Vector3d extends XYZ {
|
|
|
222367
222407
|
return _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createAtan2(this.crossProductXY(vectorB), this.dotProductXY(vectorB));
|
|
222368
222408
|
}
|
|
222369
222409
|
/**
|
|
222370
|
-
* Return the angle in radians (not as strongly-typed Angle) from this vector to vectorB
|
|
222371
|
-
* in their containing plane whose normal lies in the same half-space as vectorW
|
|
222410
|
+
* Return the angle in radians (not as strongly-typed Angle) from `this` vector to `vectorB`, measured
|
|
222411
|
+
* in their containing plane whose normal lies in the same half-space as `vectorW`.
|
|
222372
222412
|
* * The returned angle is between `-Math.PI` and `Math.PI`.
|
|
222373
|
-
* * If the cross product of this vector and vectorB lies on the same side of the plane as vectorW
|
|
222413
|
+
* * If the cross product of `this` vector and `vectorB` lies on the same side of the plane as `vectorW`,
|
|
222374
222414
|
* this function returns `radiansTo(vectorB)`; otherwise, it returns `-radiansTo(vectorB)`.
|
|
222375
222415
|
* * `vectorW` does not have to be perpendicular to the plane.
|
|
222376
222416
|
* * Use `planarRadiansTo` to measure the angle between vectors that are projected to another plane.
|
|
@@ -222378,6 +222418,7 @@ class Vector3d extends XYZ {
|
|
|
222378
222418
|
* @param vectorW determines the side of the plane in which the returned angle is measured
|
|
222379
222419
|
*/
|
|
222380
222420
|
signedRadiansTo(vectorB, vectorW) {
|
|
222421
|
+
// A.B = |A||B|cos(theta) and |AxB| = |A||B|sin(theta) so theta = arctan(|AxB|/A.B)
|
|
222381
222422
|
const p = this.crossProduct(vectorB);
|
|
222382
222423
|
const theta = Math.atan2(p.magnitude(), this.dotProduct(vectorB));
|
|
222383
222424
|
if (vectorW.dotProduct(p) < 0.0)
|
|
@@ -223071,6 +223112,25 @@ class Point3dArray {
|
|
|
223071
223112
|
}
|
|
223072
223113
|
return result;
|
|
223073
223114
|
}
|
|
223115
|
+
/**
|
|
223116
|
+
* Copy 3d points into a packed number array.
|
|
223117
|
+
* @param data array of xyz
|
|
223118
|
+
* @param result optional destination array.
|
|
223119
|
+
* @return packed number array
|
|
223120
|
+
*/
|
|
223121
|
+
static packToNumberArray(data, result) {
|
|
223122
|
+
const numValues = 3 * data.length;
|
|
223123
|
+
if (!result)
|
|
223124
|
+
result = Array(numValues);
|
|
223125
|
+
result.length = numValues;
|
|
223126
|
+
let i = 0;
|
|
223127
|
+
for (const p of data) {
|
|
223128
|
+
result[i++] = p.x;
|
|
223129
|
+
result[i++] = p.y;
|
|
223130
|
+
result[i++] = p.z;
|
|
223131
|
+
}
|
|
223132
|
+
return result;
|
|
223133
|
+
}
|
|
223074
223134
|
/**
|
|
223075
223135
|
* Compute the 8 weights of trilinear mapping
|
|
223076
223136
|
* By appropriate choice of weights, this can be used for both point and derivative mappings.
|
|
@@ -238229,7 +238289,7 @@ var AuxChannelDataType;
|
|
|
238229
238289
|
* @public
|
|
238230
238290
|
*/
|
|
238231
238291
|
class AuxChannelData {
|
|
238232
|
-
/**
|
|
238292
|
+
/** Constructor. If `values` is a number array, it is captured. */
|
|
238233
238293
|
constructor(input, values) {
|
|
238234
238294
|
this.input = input;
|
|
238235
238295
|
if (values instanceof Float64Array) {
|
|
@@ -238261,7 +238321,7 @@ class AuxChannelData {
|
|
|
238261
238321
|
* @public
|
|
238262
238322
|
*/
|
|
238263
238323
|
class AuxChannel {
|
|
238264
|
-
/**
|
|
238324
|
+
/** Constructor with CAPTURED inputs. */
|
|
238265
238325
|
constructor(data, dataType, name, inputName) {
|
|
238266
238326
|
this.data = data;
|
|
238267
238327
|
this.dataType = dataType;
|
|
@@ -238287,15 +238347,23 @@ class AuxChannel {
|
|
|
238287
238347
|
return false;
|
|
238288
238348
|
return true;
|
|
238289
238349
|
}
|
|
238290
|
-
/** True if
|
|
238350
|
+
/** True if the data type is 1-dimensional. */
|
|
238351
|
+
static isScalar(dataType) {
|
|
238352
|
+
return dataType === AuxChannelDataType.Distance || dataType === AuxChannelDataType.Scalar;
|
|
238353
|
+
}
|
|
238354
|
+
/** True if the data stored in this AuxChannel is 1-dimensional. */
|
|
238291
238355
|
get isScalar() {
|
|
238292
|
-
return
|
|
238356
|
+
return AuxChannel.isScalar(this.dataType);
|
|
238293
238357
|
}
|
|
238294
|
-
/** The
|
|
238358
|
+
/** The dimension (1D or 3D) of each datum of an AuxChannel of the given type. */
|
|
238359
|
+
static entriesPerValue(dataType) {
|
|
238360
|
+
return this.isScalar(dataType) ? 1 : 3;
|
|
238361
|
+
}
|
|
238362
|
+
/** The dimension (1D or 3D) of each datum in the data arrays of this AuxChannel. */
|
|
238295
238363
|
get entriesPerValue() {
|
|
238296
|
-
return this.
|
|
238364
|
+
return AuxChannel.entriesPerValue(this.dataType);
|
|
238297
238365
|
}
|
|
238298
|
-
/** The number of
|
|
238366
|
+
/** The number of data stored in each data array of this AuxChannel, equal to the length of the array divided by `entriesPerValue`. */
|
|
238299
238367
|
get valueCount() {
|
|
238300
238368
|
return 0 === this.data.length ? 0 : this.data[0].values.length / this.entriesPerValue;
|
|
238301
238369
|
}
|
|
@@ -238325,16 +238393,20 @@ class AuxChannel {
|
|
|
238325
238393
|
return result;
|
|
238326
238394
|
}
|
|
238327
238395
|
}
|
|
238328
|
-
/**
|
|
238396
|
+
/**
|
|
238397
|
+
* The `PolyfaceAuxData` structure contains one or more analytical data channels for each vertex of a [[Polyface]], allowing the polyface to be styled
|
|
238329
238398
|
* using an [AnalysisStyle]($common).
|
|
238330
|
-
* Typically a polyface will contain only vertex data required for its basic display:
|
|
238331
|
-
*
|
|
238332
|
-
*
|
|
238333
|
-
*
|
|
238399
|
+
* Typically a polyface will contain only vertex data required for its basic display: vertex position, normal, texture parameter, color.
|
|
238400
|
+
* `PolyfaceAuxData` provides supplemental per-vertex data that is generally computed in an analysis program or other external data source.
|
|
238401
|
+
* This supplemental data can be either 1D (e.g., height, override color) or 3D (e.g., displacement vector, override normal); see [[AuxChannel.entriesPerValue]], [[AuxChannel.dataType]].
|
|
238402
|
+
* All data channels are indexed by the same indices, which must have the same length and structure as the other Polyface indices.
|
|
238403
|
+
* This means that if a facet's face loop is found at index range [i0,i1] in the Polyface vertex index array, then the same index range [i0,i1]
|
|
238404
|
+
* locates the data for this facet in all the other Polyface index arrays, including the `PolyfaceAuxData` indices.
|
|
238334
238405
|
* @see [[PolyfaceData.auxData]] to associate auxiliary data with a polyface.
|
|
238335
238406
|
* @public
|
|
238336
238407
|
*/
|
|
238337
238408
|
class PolyfaceAuxData {
|
|
238409
|
+
/** Constructor with CAPTURED inputs. */
|
|
238338
238410
|
constructor(channels, indices) {
|
|
238339
238411
|
this.channels = channels;
|
|
238340
238412
|
this.indices = indices;
|
|
@@ -239856,7 +239928,8 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
239856
239928
|
* * Example: suppose `[6,7,8]` is the pointIndex array representing a triangle. First edge would be `6,7`. Second
|
|
239857
239929
|
* edge is `7,8`. Third edge is `8,6`. To access `6` for the third edge, we have to go back to the start of array.
|
|
239858
239930
|
* Therefore, it is useful to store `6` at the end of pointIndex array, i.e., `[6,7,8,6]` meaning `numWrap = 1`.
|
|
239859
|
-
*
|
|
239931
|
+
* Continuing this example, `numWrap = 2` (i.e., `[6,7,8,6,7]`) is useful when each vertex visit requires the next
|
|
239932
|
+
* two points, e.g., to form two adjacent vectors for a cross product.
|
|
239860
239933
|
*/
|
|
239861
239934
|
setNumWrap(numWrap) {
|
|
239862
239935
|
this._numWrap = numWrap;
|
|
@@ -240510,11 +240583,38 @@ class IndexedPolyface extends Polyface {
|
|
|
240510
240583
|
cleanupOpenFacet() {
|
|
240511
240584
|
this.data.trimAllIndexArrays(this.data.pointIndex.length);
|
|
240512
240585
|
}
|
|
240586
|
+
/**
|
|
240587
|
+
* Validate (the tail of) the active index arrays: point, normal, param, color.
|
|
240588
|
+
* @param index0 optional offset into the index arrays at which to start validating indices. Default 0.
|
|
240589
|
+
* @param errors optional array appended with error message(s) if invalid indices are encountered
|
|
240590
|
+
* @return whether the indices are valid
|
|
240591
|
+
*/
|
|
240592
|
+
validateAllIndices(index0 = 0, errors) {
|
|
240593
|
+
const numPointIndices = this.data.pointIndex.length;
|
|
240594
|
+
const messages = errors ?? [];
|
|
240595
|
+
if (this.data.normalIndex && this.data.normalIndex.length !== numPointIndices)
|
|
240596
|
+
messages.push("normalIndex count must match pointIndex count");
|
|
240597
|
+
if (this.data.paramIndex && this.data.paramIndex.length !== numPointIndices)
|
|
240598
|
+
messages.push("paramIndex count must equal pointIndex count");
|
|
240599
|
+
if (this.data.colorIndex && this.data.colorIndex.length !== numPointIndices)
|
|
240600
|
+
messages.push("colorIndex count must equal pointIndex count");
|
|
240601
|
+
if (this.data.edgeVisible.length !== numPointIndices)
|
|
240602
|
+
messages.push("visibleIndex count must equal pointIndex count");
|
|
240603
|
+
if (!Polyface.areIndicesValid(this.data.pointIndex, index0, numPointIndices, this.data.point, this.data.point ? this.data.point.length : 0))
|
|
240604
|
+
messages.push("invalid point indices in the last facet");
|
|
240605
|
+
if (!Polyface.areIndicesValid(this.data.normalIndex, index0, numPointIndices, this.data.normal, this.data.normal ? this.data.normal.length : 0))
|
|
240606
|
+
messages.push("invalid normal indices in the last facet");
|
|
240607
|
+
if (!Polyface.areIndicesValid(this.data.paramIndex, index0, numPointIndices, this.data.param, this.data.param ? this.data.param.length : 0))
|
|
240608
|
+
messages.push("invalid param indices in the last facet");
|
|
240609
|
+
if (!Polyface.areIndicesValid(this.data.colorIndex, index0, numPointIndices, this.data.color, this.data.color ? this.data.color.length : 0))
|
|
240610
|
+
messages.push("invalid color indices in the last facet");
|
|
240611
|
+
return 0 === messages.length;
|
|
240612
|
+
}
|
|
240513
240613
|
/**
|
|
240514
240614
|
* Announce the end of construction of a facet.
|
|
240515
240615
|
* * Optionally check for:
|
|
240516
240616
|
* * Same number of indices among all active index arrays -- point, normal, param, color
|
|
240517
|
-
* * All indices are within bounds of the respective data arrays.
|
|
240617
|
+
* * All indices for the latest facet are within bounds of the respective data arrays.
|
|
240518
240618
|
* * In error cases, all index arrays are trimmed back to the size when previous facet was terminated.
|
|
240519
240619
|
* * A return value of `undefined` is normal. Otherwise, a string array of error messages is returned.
|
|
240520
240620
|
*/
|
|
@@ -240528,22 +240628,7 @@ class IndexedPolyface extends Polyface {
|
|
|
240528
240628
|
const messages = [];
|
|
240529
240629
|
if (lengthB < lengthA + 2)
|
|
240530
240630
|
messages.push("Less than 3 indices in the last facet");
|
|
240531
|
-
|
|
240532
|
-
messages.push("normalIndex count must match pointIndex count");
|
|
240533
|
-
if (this.data.paramIndex && this.data.paramIndex.length !== lengthB)
|
|
240534
|
-
messages.push("paramIndex count must equal pointIndex count");
|
|
240535
|
-
if (this.data.colorIndex && this.data.colorIndex.length !== lengthB)
|
|
240536
|
-
messages.push("colorIndex count must equal pointIndex count");
|
|
240537
|
-
if (this.data.edgeVisible.length !== lengthB)
|
|
240538
|
-
messages.push("visibleIndex count must equal pointIndex count");
|
|
240539
|
-
if (!Polyface.areIndicesValid(this.data.pointIndex, lengthA, lengthB, this.data.point, this.data.point ? this.data.point.length : 0))
|
|
240540
|
-
messages.push("invalid point indices in the last facet");
|
|
240541
|
-
if (!Polyface.areIndicesValid(this.data.normalIndex, lengthA, lengthB, this.data.normal, this.data.normal ? this.data.normal.length : 0))
|
|
240542
|
-
messages.push("invalid normal indices in the last facet");
|
|
240543
|
-
if (!Polyface.areIndicesValid(this.data.paramIndex, lengthA, lengthB, this.data.param, this.data.param ? this.data.param.length : 0))
|
|
240544
|
-
messages.push("invalid param indices in the last facet");
|
|
240545
|
-
if (!Polyface.areIndicesValid(this.data.colorIndex, lengthA, lengthB, this.data.color, this.data.color ? this.data.color.length : 0))
|
|
240546
|
-
messages.push("invalid color indices in the last facet");
|
|
240631
|
+
this.validateAllIndices(lengthA, messages);
|
|
240547
240632
|
if (messages.length > 0) {
|
|
240548
240633
|
this.data.trimAllIndexArrays(lengthA);
|
|
240549
240634
|
return messages;
|
|
@@ -243775,10 +243860,11 @@ class PolyfaceData {
|
|
|
243775
243860
|
}
|
|
243776
243861
|
/**
|
|
243777
243862
|
* Compress the instance by equating duplicate data.
|
|
243778
|
-
* * Search for duplicates within
|
|
243863
|
+
* * Search for duplicates within vertices, normals, params, and colors.
|
|
243779
243864
|
* * Compress each data array.
|
|
243780
243865
|
* * Revise all indexing for the relocated data.
|
|
243781
|
-
*
|
|
243866
|
+
* * [[PolyfaceAuxData]] is compressed if and only if exactly one [[AuxChannelData]] is present.
|
|
243867
|
+
* @param tolerance (optional) tolerance for clustering mesh vertices only. Default value, and the tolerance used to cluster all other data, is [[Geometry.smallMetricDistance]].
|
|
243782
243868
|
*/
|
|
243783
243869
|
compress(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.smallMetricDistance) {
|
|
243784
243870
|
// more info can be found at geometry/internaldocs/Polyface.md
|
|
@@ -243801,6 +243887,20 @@ class PolyfaceData {
|
|
|
243801
243887
|
this.color = packedColors.packedNumbers;
|
|
243802
243888
|
packedColors.updateIndices(this.colorIndex);
|
|
243803
243889
|
}
|
|
243890
|
+
if (this.auxData && this.auxData.channels.length === 1 && this.auxData.channels[0].data.length === 1) {
|
|
243891
|
+
const dataSize = this.auxData.channels[0].entriesPerValue;
|
|
243892
|
+
if (1 === dataSize) {
|
|
243893
|
+
const packedData = _numerics_ClusterableArray__WEBPACK_IMPORTED_MODULE_9__.ClusterableArray.clusterNumberArray(this.auxData.channels[0].data[0].values);
|
|
243894
|
+
this.auxData.channels[0].data[0].values = packedData.packedNumbers;
|
|
243895
|
+
packedData.updateIndices(this.auxData.indices);
|
|
243896
|
+
}
|
|
243897
|
+
else if (3 === dataSize) {
|
|
243898
|
+
const blockedData = _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_0__.GrowableXYZArray.create(this.auxData.channels[0].data[0].values);
|
|
243899
|
+
const packedData = _numerics_ClusterableArray__WEBPACK_IMPORTED_MODULE_9__.ClusterableArray.clusterGrowablePoint3dArray(blockedData);
|
|
243900
|
+
this.auxData.channels[0].data[0].values = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.NumberArray.create(packedData.growablePackedPoints.float64Data());
|
|
243901
|
+
packedData.updateIndices(this.auxData.indices);
|
|
243902
|
+
}
|
|
243903
|
+
}
|
|
243804
243904
|
}
|
|
243805
243905
|
/**
|
|
243806
243906
|
* Test if `facetStartIndex` is (minimally) valid.
|
|
@@ -244013,6 +244113,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
244013
244113
|
* @module Polyface
|
|
244014
244114
|
*/
|
|
244015
244115
|
/* eslint-disable @typescript-eslint/naming-convention, no-empty */
|
|
244116
|
+
// cspell:word internaldocs
|
|
244016
244117
|
|
|
244017
244118
|
|
|
244018
244119
|
|
|
@@ -244055,8 +244156,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
244055
244156
|
* @public
|
|
244056
244157
|
*/
|
|
244057
244158
|
class SweepLineStringToFacetsOptions {
|
|
244058
|
-
/**
|
|
244059
|
-
*/
|
|
244159
|
+
/** Constructor. Captures fully-checked parameters from static create method. */
|
|
244060
244160
|
constructor(vectorToEye, sideAngle, assembleChains, collectOnForwardFacets, collectOnSideFacets, collectOnRearFacets) {
|
|
244061
244161
|
this.vectorToEye = vectorToEye;
|
|
244062
244162
|
this.sideAngle = sideAngle;
|
|
@@ -244065,20 +244165,27 @@ class SweepLineStringToFacetsOptions {
|
|
|
244065
244165
|
this.collectOnSideFacets = collectOnSideFacets;
|
|
244066
244166
|
this.collectOnRearFacets = collectOnRearFacets;
|
|
244067
244167
|
}
|
|
244068
|
-
/**
|
|
244069
|
-
*
|
|
244070
|
-
* * Default
|
|
244071
|
-
* * Default
|
|
244072
|
-
* * Default
|
|
244168
|
+
/**
|
|
244169
|
+
* Create an options structure.
|
|
244170
|
+
* * Default `vectorToEye` is (0,0,1).
|
|
244171
|
+
* * Default `sideAngle` is `Geometry.smallAngleRadians`.
|
|
244172
|
+
* * Default `assembleChains` is `true`.
|
|
244173
|
+
* * Default `collectOnForwardFacets`, `collectOnSideFacets`, `collectOnRearFacets` are all `true`.
|
|
244073
244174
|
*/
|
|
244074
244175
|
static create(vectorToEye, sideAngle, assembleChains, collectOnForwardFacets, collectOnSideFacets, collectOnRearFacets) {
|
|
244075
244176
|
return new SweepLineStringToFacetsOptions(vectorToEye === undefined ? _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.unitZ() : vectorToEye.clone(), sideAngle === undefined ? _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallAngleRadians) : sideAngle.clone(), _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.resolveValue(assembleChains, true), _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.resolveValue(collectOnForwardFacets, true), _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.resolveValue(collectOnSideFacets, true), _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.resolveValue(collectOnRearFacets, true));
|
|
244076
244177
|
}
|
|
244077
|
-
/** Return true if all outputs are requested */
|
|
244078
|
-
get collectAll() {
|
|
244079
|
-
|
|
244080
|
-
|
|
244081
|
-
|
|
244178
|
+
/** Return `true` if all outputs are requested. */
|
|
244179
|
+
get collectAll() {
|
|
244180
|
+
return this.collectOnForwardFacets === true &&
|
|
244181
|
+
this.collectOnSideFacets === true &&
|
|
244182
|
+
this.collectOnRearFacets === true;
|
|
244183
|
+
}
|
|
244184
|
+
/**
|
|
244185
|
+
* Decide if the instance collector flags accept a facet with the given normal.
|
|
244186
|
+
* * A facet whose facet normal has a positive, zero, or negative dot product with `vectorToEye` is classified
|
|
244187
|
+
* as forward, side, or rear, respectively.
|
|
244188
|
+
* * `undefined` facet normal returns `false`.
|
|
244082
244189
|
*/
|
|
244083
244190
|
collectFromThisFacetNormal(facetNormal) {
|
|
244084
244191
|
if (facetNormal === undefined)
|
|
@@ -244092,22 +244199,27 @@ class SweepLineStringToFacetsOptions {
|
|
|
244092
244199
|
/**
|
|
244093
244200
|
* Options carrier for [[PolyfaceQuery.cloneOffset]].
|
|
244094
244201
|
* * Default options are strongly recommended.
|
|
244095
|
-
* * The option most likely to be changed is
|
|
244202
|
+
* * The option most likely to be changed is `chamferAngleBetweenNormals`.
|
|
244096
244203
|
* @public
|
|
244097
244204
|
*/
|
|
244098
244205
|
class OffsetMeshOptions {
|
|
244099
|
-
/** Constructor -- CAPTURE parameters
|
|
244100
|
-
constructor(smoothSingleAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(25), smoothAccumulatedAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(60),
|
|
244206
|
+
/** Constructor -- CAPTURE parameters. */
|
|
244207
|
+
constructor(smoothSingleAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(25), smoothAccumulatedAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(60), chamferAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(90)) {
|
|
244101
244208
|
this.smoothSingleAngleBetweenNormals = smoothSingleAngleBetweenNormals.clone();
|
|
244102
244209
|
this.smoothAccumulatedAngleBetweenNormals = smoothAccumulatedAngleBetweenNormals.clone();
|
|
244103
|
-
this.chamferAngleBetweenNormals =
|
|
244210
|
+
this.chamferAngleBetweenNormals = chamferAngleBetweenNormals.clone();
|
|
244104
244211
|
}
|
|
244105
|
-
/**
|
|
244212
|
+
/**
|
|
244213
|
+
* Construct and return an `OffsetMeshOptions` with given parameters.
|
|
244106
244214
|
* * Angles are forced to minimum values.
|
|
244107
244215
|
* * Clones of the angles are given to the constructor.
|
|
244108
|
-
* @param smoothSingleRadiansBetweenNormals an angle larger than this (between facets) is considered a sharp edge
|
|
244109
|
-
*
|
|
244110
|
-
* @param
|
|
244216
|
+
* @param smoothSingleRadiansBetweenNormals an angle larger than this (between facets) is considered a sharp edge.
|
|
244217
|
+
* Default value is `25` degrees.
|
|
244218
|
+
* @param smoothAccumulatedAngleBetweenNormals angles that sum to this much may be consolidated for average normal.
|
|
244219
|
+
* Default value is `60` degrees.
|
|
244220
|
+
* @param chamferTurnAngleBetweenNormals when facets meet and the turn angle (i.e., angle between facet normals)
|
|
244221
|
+
* is larger than `chamferTurnAngleBetweenNormals`, a chamfer edge may be added to prevent offset mesh from having
|
|
244222
|
+
* facets that extend out too far away from the source mesh. Default value is `120` degrees.
|
|
244111
244223
|
*/
|
|
244112
244224
|
static create(smoothSingleAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(25), smoothAccumulatedAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(60), chamferTurnAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(120)) {
|
|
244113
244225
|
const mySmoothSingleRadiansBetweenNormals = smoothSingleAngleBetweenNormals.clone();
|
|
@@ -244123,25 +244235,27 @@ class OffsetMeshOptions {
|
|
|
244123
244235
|
}
|
|
244124
244236
|
}
|
|
244125
244237
|
/**
|
|
244126
|
-
* Enumeration of cases for retaining facets among duplicates
|
|
244238
|
+
* Enumeration of cases for retaining facets among duplicates.
|
|
244127
244239
|
* @public
|
|
244128
244240
|
*/
|
|
244129
244241
|
var DuplicateFacetClusterSelector;
|
|
244130
244242
|
(function (DuplicateFacetClusterSelector) {
|
|
244131
|
-
/**
|
|
244243
|
+
/** Retain none of the duplicates. */
|
|
244132
244244
|
DuplicateFacetClusterSelector[DuplicateFacetClusterSelector["SelectNone"] = 0] = "SelectNone";
|
|
244133
|
-
/**
|
|
244245
|
+
/** Retain any one member among duplicates. */
|
|
244134
244246
|
DuplicateFacetClusterSelector[DuplicateFacetClusterSelector["SelectAny"] = 1] = "SelectAny";
|
|
244135
|
-
/**
|
|
244247
|
+
/** Retain all members among duplicates. */
|
|
244136
244248
|
DuplicateFacetClusterSelector[DuplicateFacetClusterSelector["SelectAll"] = 2] = "SelectAll";
|
|
244137
|
-
/**
|
|
244249
|
+
/** Retain one from any cluster with an odd number of faces. */
|
|
244138
244250
|
DuplicateFacetClusterSelector[DuplicateFacetClusterSelector["SelectOneByParity"] = 3] = "SelectOneByParity";
|
|
244139
244251
|
})(DuplicateFacetClusterSelector || (DuplicateFacetClusterSelector = {}));
|
|
244140
|
-
/**
|
|
244252
|
+
/**
|
|
244253
|
+
* PolyfaceQuery is a static class whose methods implement queries on a `Polyface` or `PolyfaceVisitor` provided as a
|
|
244254
|
+
* parameter to each method.
|
|
244141
244255
|
* @public
|
|
244142
244256
|
*/
|
|
244143
244257
|
class PolyfaceQuery {
|
|
244144
|
-
/**
|
|
244258
|
+
/** Copy the points from a visitor into a linestring loop. */
|
|
244145
244259
|
static visitorToLoop(visitor) {
|
|
244146
244260
|
const ls = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d.createPoints(visitor.point.getPoint3dArray());
|
|
244147
244261
|
return _curve_Loop__WEBPACK_IMPORTED_MODULE_4__.Loop.create(ls);
|
|
@@ -244156,11 +244270,15 @@ class PolyfaceQuery {
|
|
|
244156
244270
|
}
|
|
244157
244271
|
return result;
|
|
244158
244272
|
}
|
|
244159
|
-
/**
|
|
244160
|
-
*
|
|
244161
|
-
|
|
244273
|
+
/**
|
|
244274
|
+
* Sum all facet areas.
|
|
244275
|
+
* @param source polyface or visitor.
|
|
244276
|
+
* @param vectorToEye compute sum of (signed) facet areas projected to a view plane perpendicular to `vectorToEye`.
|
|
244277
|
+
* If `vectorToEye` is not provided, actual facet areas are calculated (without any projection).
|
|
244278
|
+
* @returns the sum of all facet areas. Return 0 if `source` is `undefined`.
|
|
244279
|
+
*/
|
|
244162
244280
|
static sumFacetAreas(source, vectorToEye) {
|
|
244163
|
-
let
|
|
244281
|
+
let sum = 0;
|
|
244164
244282
|
if (source !== undefined) {
|
|
244165
244283
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
244166
244284
|
return PolyfaceQuery.sumFacetAreas(source.createVisitor(1), vectorToEye);
|
|
@@ -244169,20 +244287,21 @@ class PolyfaceQuery {
|
|
|
244169
244287
|
unitVectorToEye = vectorToEye.normalize();
|
|
244170
244288
|
source.reset();
|
|
244171
244289
|
while (source.moveToNextFacet()) {
|
|
244172
|
-
const
|
|
244173
|
-
|
|
244290
|
+
const areaNormal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.areaNormal(source.point.getPoint3dArray());
|
|
244291
|
+
sum += unitVectorToEye ? areaNormal.dotProduct(unitVectorToEye) : areaNormal.magnitude();
|
|
244174
244292
|
}
|
|
244175
244293
|
}
|
|
244176
|
-
return
|
|
244294
|
+
return sum;
|
|
244177
244295
|
}
|
|
244178
|
-
/**
|
|
244179
|
-
*
|
|
244296
|
+
/**
|
|
244297
|
+
* Sum volumes of tetrahedra from origin to all facets.
|
|
244298
|
+
* * If origin is `undefined`, the first point encountered (by the visitor) is used as origin.
|
|
244180
244299
|
* * If the mesh is closed, this sum is the volume.
|
|
244181
|
-
* * If the mesh is not closed, this sum is the volume of a mesh with various additional facets
|
|
244182
|
-
*
|
|
244183
|
-
|
|
244300
|
+
* * If the mesh is not closed, this sum is the volume of a mesh with various additional facets from the origin
|
|
244301
|
+
* to facets.
|
|
244302
|
+
*/
|
|
244184
244303
|
static sumTetrahedralVolumes(source, origin) {
|
|
244185
|
-
let
|
|
244304
|
+
let sum = 0;
|
|
244186
244305
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
244187
244306
|
return PolyfaceQuery.sumTetrahedralVolumes(source.createVisitor(0), origin);
|
|
244188
244307
|
let myOrigin = origin;
|
|
@@ -244197,17 +244316,18 @@ class PolyfaceQuery {
|
|
|
244197
244316
|
for (let i = 1; i + 1 < source.point.length; i++) {
|
|
244198
244317
|
source.point.getPoint3dAtUncheckedPointIndex(i, targetA);
|
|
244199
244318
|
source.point.getPoint3dAtUncheckedPointIndex(i + 1, targetB);
|
|
244200
|
-
|
|
244319
|
+
sum += myOrigin.tripleProductToPoints(facetOrigin, targetA, targetB);
|
|
244201
244320
|
}
|
|
244202
244321
|
}
|
|
244203
|
-
return
|
|
244322
|
+
return sum / 6.0;
|
|
244204
244323
|
}
|
|
244205
|
-
/**
|
|
244324
|
+
/**
|
|
244325
|
+
* Sum (signed) volumes between facets and a plane.
|
|
244206
244326
|
* Return a structure with multiple sums:
|
|
244207
244327
|
* * volume = the sum of (signed) volumes between facets and the plane.
|
|
244208
|
-
* *
|
|
244209
|
-
*
|
|
244210
|
-
|
|
244328
|
+
* * positiveProjectedFacetAreaMoments, negativeProjectedFacetAreaMoments = moment data with centroid, area, and second
|
|
244329
|
+
* moments with respect to the centroid.
|
|
244330
|
+
*/
|
|
244211
244331
|
static sumVolumeBetweenFacetsAndPlane(source, plane) {
|
|
244212
244332
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
244213
244333
|
return PolyfaceQuery.sumVolumeBetweenFacetsAndPlane(source.createVisitor(0), plane);
|
|
@@ -244225,18 +244345,18 @@ class PolyfaceQuery {
|
|
|
244225
244345
|
const singleFacetProducts = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_9__.Matrix4d.createZero();
|
|
244226
244346
|
const projectToPlane = plane.getProjectionToPlane();
|
|
244227
244347
|
source.reset();
|
|
244228
|
-
// For each facet
|
|
244229
|
-
//
|
|
244230
|
-
//
|
|
244231
|
-
// each
|
|
244232
|
-
// each volume contribution is
|
|
244348
|
+
// For each facet:
|
|
244349
|
+
// - form triangles from facet origin to each far edge.
|
|
244350
|
+
// - sum signed area and volume contributions.
|
|
244351
|
+
// each projected area contribution is twice the area of a triangle.
|
|
244352
|
+
// each volume contribution is 3 times the actual volume -- (1/3) of the altitude sums was the centroid altitude.
|
|
244233
244353
|
while (source.moveToNextFacet()) {
|
|
244234
244354
|
source.point.getPoint3dAtUncheckedPointIndex(0, facetOrigin);
|
|
244235
244355
|
h0 = plane.altitude(facetOrigin);
|
|
244236
244356
|
singleFacetArea = 0;
|
|
244237
244357
|
// within a single facets, the singleFacetArea sum is accumulated with signs of individual triangles.
|
|
244238
|
-
//
|
|
244239
|
-
//
|
|
244358
|
+
// for a non-convex facet, this can be a mixture of positive and negative areas.
|
|
244359
|
+
// the absoluteProjectedAreaSum contribution is forced positive after the sum for the facet.
|
|
244240
244360
|
for (let i = 1; i + 1 < source.point.length; i++) {
|
|
244241
244361
|
source.point.getPoint3dAtUncheckedPointIndex(i, targetA);
|
|
244242
244362
|
source.point.getPoint3dAtUncheckedPointIndex(i + 1, targetB);
|
|
@@ -244267,7 +244387,7 @@ class PolyfaceQuery {
|
|
|
244267
244387
|
negativeProjectedFacetAreaMoments: negativeAreaMoments,
|
|
244268
244388
|
};
|
|
244269
244389
|
}
|
|
244270
|
-
/** Return the inertia products [xx,xy,xz,xw,
|
|
244390
|
+
/** Return the inertia products [xx,xy,xz,xw,yw, etc] integrated over all all facets as viewed from origin. */
|
|
244271
244391
|
static sumFacetSecondAreaMomentProducts(source, origin) {
|
|
244272
244392
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
244273
244393
|
return PolyfaceQuery.sumFacetSecondAreaMomentProducts(source.createVisitor(0), origin);
|
|
@@ -244278,7 +244398,7 @@ class PolyfaceQuery {
|
|
|
244278
244398
|
}
|
|
244279
244399
|
return products;
|
|
244280
244400
|
}
|
|
244281
|
-
/** Return the inertia products [xx,xy,xz,xw,
|
|
244401
|
+
/** Return the inertia products [xx,xy,xz,xw,yw, etc] integrated over all tetrahedral volumes from origin. */
|
|
244282
244402
|
static sumFacetSecondVolumeMomentProducts(source, origin) {
|
|
244283
244403
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
244284
244404
|
return PolyfaceQuery.sumFacetSecondVolumeMomentProducts(source.createVisitor(0), origin);
|
|
@@ -244289,10 +244409,11 @@ class PolyfaceQuery {
|
|
|
244289
244409
|
}
|
|
244290
244410
|
return products;
|
|
244291
244411
|
}
|
|
244292
|
-
/**
|
|
244293
|
-
*
|
|
244294
|
-
* *
|
|
244295
|
-
* *
|
|
244412
|
+
/**
|
|
244413
|
+
* Compute area moments for the mesh. In the returned `MomentData`:
|
|
244414
|
+
* * `origin` is the centroid.
|
|
244415
|
+
* * `localToWorldMap` has the origin and principal directions.
|
|
244416
|
+
* * `radiiOfGyration` radii for rotation around the x,y,z axes.
|
|
244296
244417
|
*/
|
|
244297
244418
|
static computePrincipalAreaMoments(source) {
|
|
244298
244419
|
const origin = source.data.getPoint(0);
|
|
@@ -244301,12 +244422,13 @@ class PolyfaceQuery {
|
|
|
244301
244422
|
const inertiaProducts = PolyfaceQuery.sumFacetSecondAreaMomentProducts(source, origin);
|
|
244302
244423
|
return _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_8__.MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
|
|
244303
244424
|
}
|
|
244304
|
-
/**
|
|
244305
|
-
*
|
|
244306
|
-
* *
|
|
244307
|
-
* *
|
|
244425
|
+
/**
|
|
244426
|
+
* Compute area moments for the mesh. In the returned MomentData:
|
|
244427
|
+
* * `origin` is the centroid.
|
|
244428
|
+
* * `localToWorldMap` has the origin and principal directions.
|
|
244429
|
+
* * `radiiOfGyration` radii for rotation around the x,y,z axes.
|
|
244308
244430
|
* * The result is only valid if the mesh is closed.
|
|
244309
|
-
* * There is no test for closure.
|
|
244431
|
+
* * There is no test for closure. Use `PolyfaceQuery.isPolyfaceClosedByEdgePairing(polyface)` to test for closure.
|
|
244310
244432
|
*/
|
|
244311
244433
|
static computePrincipalVolumeMoments(source) {
|
|
244312
244434
|
const origin = source.data.getPoint(0);
|
|
@@ -244315,8 +244437,10 @@ class PolyfaceQuery {
|
|
|
244315
244437
|
const inertiaProducts = PolyfaceQuery.sumFacetSecondVolumeMomentProducts(source, origin);
|
|
244316
244438
|
return _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_8__.MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
|
|
244317
244439
|
}
|
|
244318
|
-
/**
|
|
244319
|
-
*
|
|
244440
|
+
/**
|
|
244441
|
+
* Determine whether all facets are convex.
|
|
244442
|
+
* @param source polyface or visitor.
|
|
244443
|
+
* @returns `true` if all facets are convex; `false` otherwise.
|
|
244320
244444
|
*/
|
|
244321
244445
|
static areFacetsConvex(source) {
|
|
244322
244446
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
@@ -244332,56 +244456,50 @@ class PolyfaceQuery {
|
|
|
244332
244456
|
return true;
|
|
244333
244457
|
}
|
|
244334
244458
|
/**
|
|
244335
|
-
*
|
|
244336
|
-
* *
|
|
244337
|
-
*
|
|
244338
|
-
*
|
|
244339
|
-
*
|
|
244340
|
-
*
|
|
244341
|
-
*
|
|
244342
|
-
*
|
|
244343
|
-
*
|
|
244344
|
-
*
|
|
244345
|
-
*
|
|
244459
|
+
* Compute a number summarizing the dihedral angles in the mesh.
|
|
244460
|
+
* * A dihedral angle is the signed angle between adjacent facets' normals. This angle is positive when the cross
|
|
244461
|
+
* product `normalA x normalB` has the same direction as facetA's traversal of the facets' shared edge.
|
|
244462
|
+
* @param source mesh.
|
|
244463
|
+
* @param ignoreBoundaries if `true` ignore simple boundary edges, i.e., allow unclosed meshes. Default is `false`.
|
|
244464
|
+
* See [[isConvexByDihedralAngleCount]] for comments about passing true when there are multiple
|
|
244465
|
+
* connected components.
|
|
244466
|
+
* * Return `0` if all dihedral angles are zero (and `ignoreBoundaries === true`). The mesh is planar.
|
|
244467
|
+
* * Otherwise, return `1` if all dihedral angles are non-negative. The mesh probably encloses a convex volume and
|
|
244468
|
+
* has outward normals.
|
|
244469
|
+
* * Otherwise, return `-1` if all dihedral angles are non-positive. The mesh probably encloses a convex volume and
|
|
244470
|
+
* has inward normals.
|
|
244471
|
+
* * Otherwise, return `-2`. Also return `-2` if a non-manifold condition was detected, or a facet normal could not
|
|
244472
|
+
* be computed. A non-manifold condition is a positive-length edge adjacent to more than 2 facets or (if
|
|
244473
|
+
* `ignoreBoundaries` is false) adjacent to exactly one facet.
|
|
244346
244474
|
*/
|
|
244347
|
-
static isConvexByDihedralAngleCount(source, ignoreBoundaries = false) {
|
|
244348
|
-
return this.dihedralAngleSummary(source, ignoreBoundaries) > 0;
|
|
244349
|
-
}
|
|
244350
|
-
/**
|
|
244351
|
-
* Compute a number summarizing the dihedral angles in the mesh.
|
|
244352
|
-
* @see [[isConvexByDihedralAngleCount]] for comments about ignoreBoundaries===true when there are multiple connected components.
|
|
244353
|
-
* @param source mesh to examine
|
|
244354
|
-
* @param ignoreBoundaries if true, ignore simple boundary edges, i.e. allow unclosed meshes.
|
|
244355
|
-
* @returns a number summarizing the dihedral angles in the mesh.
|
|
244356
|
-
* * Return 1 if all angles are positive or planar. The mesh is probably convex with outward normals.
|
|
244357
|
-
* * Return -1 if all angles are negative or planar. The mesh is probably convex with inward normals.
|
|
244358
|
-
* * Return 0 if
|
|
244359
|
-
* * angles area mixed
|
|
244360
|
-
* * any edge has other than 1 incident facet or more than 2 incident facets.
|
|
244361
|
-
* * (but null edges are permitted -- These occur naturally at edges of quads at north or south pole)
|
|
244362
|
-
*/
|
|
244363
244475
|
static dihedralAngleSummary(source, ignoreBoundaries = false) {
|
|
244476
|
+
// more info can be found at geometry/internaldocs/Polyface.md
|
|
244364
244477
|
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
|
|
244365
244478
|
const visitor = source.createVisitor(1);
|
|
244366
244479
|
visitor.reset();
|
|
244480
|
+
// find centroid normals of all facets
|
|
244367
244481
|
const centroidNormal = [];
|
|
244368
244482
|
let normalCounter = 0;
|
|
244369
244483
|
while (visitor.moveToNextFacet()) {
|
|
244370
244484
|
const numEdges = visitor.pointCount - 1;
|
|
244371
244485
|
const normal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.centroidAreaNormal(visitor.point);
|
|
244372
244486
|
if (normal === undefined)
|
|
244373
|
-
return
|
|
244487
|
+
return -2;
|
|
244374
244488
|
centroidNormal.push(normal);
|
|
244375
244489
|
for (let i = 0; i < numEdges; i++) {
|
|
244376
244490
|
edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), normalCounter);
|
|
244377
244491
|
}
|
|
244378
244492
|
normalCounter++;
|
|
244379
244493
|
}
|
|
244494
|
+
// find "manifold clusters" and "bad clusters"
|
|
244495
|
+
// manifold clusters are edges adjacent to 2 facets
|
|
244496
|
+
// bad clusters are edges adjacent to more than 2 facets or (if ignoreBoundaries is false) adjacent to 1 facet
|
|
244380
244497
|
const badClusters = [];
|
|
244381
244498
|
const manifoldClusters = [];
|
|
244382
244499
|
edges.sortAndCollectClusters(manifoldClusters, ignoreBoundaries ? undefined : badClusters, undefined, badClusters);
|
|
244383
244500
|
if (badClusters.length > 0)
|
|
244384
|
-
return
|
|
244501
|
+
return -2;
|
|
244502
|
+
// find angle between facet centroid normals (dihedral angles)
|
|
244385
244503
|
let numPositive = 0;
|
|
244386
244504
|
let numPlanar = 0;
|
|
244387
244505
|
let numNegative = 0;
|
|
@@ -244389,8 +244507,7 @@ class PolyfaceQuery {
|
|
|
244389
244507
|
for (const cluster of manifoldClusters) {
|
|
244390
244508
|
const sideA = cluster[0];
|
|
244391
244509
|
const sideB = cluster[1];
|
|
244392
|
-
if (sideA instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge
|
|
244393
|
-
&& sideB instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge
|
|
244510
|
+
if (sideA instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge && sideB instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge
|
|
244394
244511
|
&& source.data.point.vectorIndexIndex(sideA.vertexIndexA, sideA.vertexIndexB, edgeVector)) {
|
|
244395
244512
|
const dihedralAngle = centroidNormal[sideA.facetIndex].direction.signedAngleTo(centroidNormal[sideB.facetIndex].direction, edgeVector);
|
|
244396
244513
|
if (dihedralAngle.isAlmostZero)
|
|
@@ -244401,26 +244518,40 @@ class PolyfaceQuery {
|
|
|
244401
244518
|
numNegative++;
|
|
244402
244519
|
}
|
|
244403
244520
|
}
|
|
244521
|
+
// categorize the mesh
|
|
244404
244522
|
if (numPositive > 0 && numNegative === 0)
|
|
244405
244523
|
return 1;
|
|
244406
244524
|
if (numNegative > 0 && numPositive === 0)
|
|
244407
244525
|
return -1;
|
|
244408
|
-
|
|
244409
|
-
|
|
244410
|
-
|
|
244411
|
-
|
|
244526
|
+
if (numPlanar > 0 && numPositive === 0 && numNegative === 0) // planar mesh
|
|
244527
|
+
return 0;
|
|
244528
|
+
return -2;
|
|
244529
|
+
}
|
|
244530
|
+
/**
|
|
244531
|
+
* Test for convex volume by dihedral angle tests on all edges.
|
|
244532
|
+
* * This tests if all dihedral angles of the mesh are positive.
|
|
244533
|
+
* * In a closed solid, this is a strong test for overall mesh convexity with outward facing normals.
|
|
244534
|
+
* * See [[dihedralAngleSummary]] for the definition of "dihedral angle".
|
|
244535
|
+
* * With `ignoreBoundaries` true, this may be a useful test when all the facets are in a single edge-connected
|
|
244536
|
+
* component, such as a pyramid with no underside.
|
|
244537
|
+
* * It is not a correct test if there are multiple, disjoint components.
|
|
244538
|
+
* * Take the above-mentioned pyramid with no underside.
|
|
244539
|
+
* * Within the same mesh, have a second pyramid placed to the side, still facing upward.
|
|
244540
|
+
* * The angles will pass the dihedral convexity test, but the composite thing surely is not convex.
|
|
244541
|
+
* @param source mesh.
|
|
244542
|
+
* @param ignoreBoundaries if `true` ignore simple boundary edges, i.e., allow unclosed meshes. Default is `false`.
|
|
244543
|
+
* @returns true if all dihedral angles of the mesh are positive.
|
|
244544
|
+
*/
|
|
244545
|
+
static isConvexByDihedralAngleCount(source, ignoreBoundaries = false) {
|
|
244546
|
+
return this.dihedralAngleSummary(source, ignoreBoundaries) > 0;
|
|
244412
244547
|
}
|
|
244413
244548
|
/**
|
|
244414
|
-
* Test
|
|
244415
|
-
|
|
244416
|
-
|
|
244417
|
-
|
|
244418
|
-
|
|
244419
|
-
|
|
244420
|
-
* * for `allowSimpleBoundaries === false` true return means this is a closed 2-manifold surface
|
|
244421
|
-
* * for `allowSimpleBoundaries === true` true means this is a 2-manifold surface which may have boundary, but is still properly matched internally.
|
|
244422
|
-
* * Any edge with 3 or more incident facets triggers `false` return.
|
|
244423
|
-
* * Any edge with 2 incident facets in the same direction triggers a `false` return.
|
|
244549
|
+
* Test edges pairing in `source` mesh.
|
|
244550
|
+
* * For `allowSimpleBoundaries === false` true return means this is a closed 2-manifold surface.
|
|
244551
|
+
* * For `allowSimpleBoundaries === true` true means this is a 2-manifold surface which may have boundary, but is
|
|
244552
|
+
* still properly matched internally.
|
|
244553
|
+
* * Any edge with 3 or more adjacent facets triggers `false` return.
|
|
244554
|
+
* * Any edge with 2 adjacent facets in the same direction triggers a `false` return.
|
|
244424
244555
|
*/
|
|
244425
244556
|
static isPolyfaceManifold(source, allowSimpleBoundaries = false) {
|
|
244426
244557
|
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
|
|
@@ -244436,44 +244567,18 @@ class PolyfaceQuery {
|
|
|
244436
244567
|
edges.sortAndCollectClusters(undefined, allowSimpleBoundaries ? undefined : badClusters, undefined, badClusters);
|
|
244437
244568
|
return badClusters.length === 0;
|
|
244438
244569
|
}
|
|
244439
|
-
/**
|
|
244440
|
-
|
|
244441
|
-
|
|
244442
|
-
* @param source polyface or visitor
|
|
244443
|
-
* @param includeTypical true to in include typical boundary edges with a single incident facet
|
|
244444
|
-
* @param includeMismatch true to include edges with more than 2 incident facets
|
|
244445
|
-
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
244446
|
-
*/
|
|
244447
|
-
static boundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
244448
|
-
const result = new _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_5__.BagOfCurves();
|
|
244449
|
-
const announceEdge = (pointA, pointB, _indexA, _indexB, _readIndex) => {
|
|
244450
|
-
result.tryAddChild(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(pointA, pointB));
|
|
244451
|
-
};
|
|
244452
|
-
PolyfaceQuery.announceBoundaryEdges(source, announceEdge, includeTypical, includeMismatch, includeNull);
|
|
244453
|
-
if (result.children.length === 0)
|
|
244454
|
-
return undefined;
|
|
244455
|
-
return result;
|
|
244456
|
-
}
|
|
244457
|
-
/**
|
|
244458
|
-
* Collect boundary edges.
|
|
244459
|
-
* * Return the edges as the simplest collection of chains of line segments.
|
|
244460
|
-
* @param source facets
|
|
244461
|
-
* @param includeTypical true to in include typical boundary edges with a single incident facet
|
|
244462
|
-
* @param includeMismatch true to include edges with more than 2 incident facets
|
|
244463
|
-
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
244464
|
-
*/
|
|
244465
|
-
static collectBoundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
244466
|
-
const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_12__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
|
|
244467
|
-
PolyfaceQuery.announceBoundaryEdges(source, (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(ptA, ptB)), includeTypical, includeMismatch, includeNull);
|
|
244468
|
-
return collector.grabResult(true);
|
|
244570
|
+
/** Test if the facets in `source` occur in perfectly mated pairs, as is required for a closed manifold volume. */
|
|
244571
|
+
static isPolyfaceClosedByEdgePairing(source) {
|
|
244572
|
+
return this.isPolyfaceManifold(source, false);
|
|
244469
244573
|
}
|
|
244470
244574
|
/**
|
|
244471
244575
|
* Test if the facets in `source` occur in perfectly mated pairs, as is required for a closed manifold volume.
|
|
244472
244576
|
* If not, extract the boundary edges as lines.
|
|
244473
|
-
* @param source polyface or visitor
|
|
244474
|
-
* @param announceEdge function to be called with each boundary edge. The announcement is start and end points,
|
|
244475
|
-
*
|
|
244476
|
-
* @param
|
|
244577
|
+
* @param source polyface or visitor.
|
|
244578
|
+
* @param announceEdge function to be called with each boundary edge. The announcement is start and end points,
|
|
244579
|
+
* start and end indices, and facet index.
|
|
244580
|
+
* @param includeTypical true to announce typical boundary edges with a single adjacent facet.
|
|
244581
|
+
* @param includeMismatch true to announce edges with more than 2 adjacent facets.
|
|
244477
244582
|
* @param includeNull true to announce edges with identical start and end vertex indices.
|
|
244478
244583
|
*/
|
|
244479
244584
|
static announceBoundaryEdges(source, announceEdge, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
@@ -244489,17 +244594,17 @@ class PolyfaceQuery {
|
|
|
244489
244594
|
edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), visitor.currentReadIndex());
|
|
244490
244595
|
}
|
|
244491
244596
|
}
|
|
244492
|
-
const
|
|
244493
|
-
const
|
|
244494
|
-
const
|
|
244495
|
-
edges.sortAndCollectClusters(undefined,
|
|
244597
|
+
const boundaryEdges = [];
|
|
244598
|
+
const nullEdges = [];
|
|
244599
|
+
const allOtherEdges = [];
|
|
244600
|
+
edges.sortAndCollectClusters(undefined, boundaryEdges, nullEdges, allOtherEdges);
|
|
244496
244601
|
const badList = [];
|
|
244497
|
-
if (includeTypical &&
|
|
244498
|
-
badList.push(
|
|
244499
|
-
if (
|
|
244500
|
-
badList.push(
|
|
244501
|
-
if (
|
|
244502
|
-
badList.push(
|
|
244602
|
+
if (includeTypical && boundaryEdges.length > 0)
|
|
244603
|
+
badList.push(boundaryEdges);
|
|
244604
|
+
if (includeNull && nullEdges.length > 0)
|
|
244605
|
+
badList.push(nullEdges);
|
|
244606
|
+
if (includeMismatch && allOtherEdges.length > 0)
|
|
244607
|
+
badList.push(allOtherEdges);
|
|
244503
244608
|
if (badList.length === 0)
|
|
244504
244609
|
return undefined;
|
|
244505
244610
|
const sourcePolyface = visitor.clientPolyface();
|
|
@@ -244516,12 +244621,61 @@ class PolyfaceQuery {
|
|
|
244516
244621
|
}
|
|
244517
244622
|
}
|
|
244518
244623
|
/**
|
|
244519
|
-
*
|
|
244624
|
+
* Construct a CurveCollection containing boundary edges.
|
|
244625
|
+
* * Each edge is a LineSegment3d.
|
|
244626
|
+
* @param source polyface or visitor.
|
|
244627
|
+
* @param includeTypical true to in include typical boundary edges with a single adjacent facet.
|
|
244628
|
+
* @param includeMismatch true to include edges with more than 2 adjacent facets.
|
|
244629
|
+
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
244630
|
+
*/
|
|
244631
|
+
static boundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
244632
|
+
const result = new _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_5__.BagOfCurves();
|
|
244633
|
+
const announceEdge = (pointA, pointB, _indexA, _indexB, _readIndex) => {
|
|
244634
|
+
result.tryAddChild(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(pointA, pointB));
|
|
244635
|
+
};
|
|
244636
|
+
PolyfaceQuery.announceBoundaryEdges(source, announceEdge, includeTypical, includeMismatch, includeNull);
|
|
244637
|
+
if (result.children.length === 0)
|
|
244638
|
+
return undefined;
|
|
244639
|
+
return result;
|
|
244640
|
+
}
|
|
244641
|
+
/**
|
|
244642
|
+
* Collect boundary edges.
|
|
244643
|
+
* * Return the edges as the simplest collection of chains of line segments.
|
|
244644
|
+
* @param source polyface or visitor.
|
|
244645
|
+
* @param includeTypical true to in include typical boundary edges with a single adjacent facet.
|
|
244646
|
+
* @param includeMismatch true to include edges with more than 2 adjacent facets.
|
|
244647
|
+
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
244648
|
+
*/
|
|
244649
|
+
static collectBoundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
244650
|
+
const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_12__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
|
|
244651
|
+
PolyfaceQuery.announceBoundaryEdges(source, (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(ptA, ptB)), includeTypical, includeMismatch, includeNull);
|
|
244652
|
+
return collector.grabResult(true);
|
|
244653
|
+
}
|
|
244654
|
+
/**
|
|
244655
|
+
* Load all half edges from a mesh to an IndexedEdgeMatcher.
|
|
244656
|
+
* @param polyface a mesh or a visitor assumed to have numWrap === 1.
|
|
244657
|
+
*/
|
|
244658
|
+
static createIndexedEdges(polyface) {
|
|
244659
|
+
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
244660
|
+
return this.createIndexedEdges(polyface.createVisitor(1));
|
|
244661
|
+
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
|
|
244662
|
+
polyface.reset();
|
|
244663
|
+
while (polyface.moveToNextFacet()) {
|
|
244664
|
+
const numEdges = polyface.pointCount - 1;
|
|
244665
|
+
for (let i = 0; i < numEdges; i++) {
|
|
244666
|
+
edges.addEdge(polyface.clientPointIndex(i), polyface.clientPointIndex(i + 1), polyface.currentReadIndex());
|
|
244667
|
+
}
|
|
244668
|
+
}
|
|
244669
|
+
return edges;
|
|
244670
|
+
}
|
|
244671
|
+
/**
|
|
244672
|
+
* Invoke the callback on each manifold edge whose adjacent facet normals form vectorToEye dot products
|
|
244673
|
+
* with opposite sign.
|
|
244520
244674
|
* * The callback is not called on boundary edges.
|
|
244521
|
-
* @param source
|
|
244522
|
-
* @param announce callback function invoked on manifold silhouette edges
|
|
244523
|
-
* @param vectorToEye normal of plane in which to compute silhouette edges
|
|
244524
|
-
* @param sideAngle angular tolerance for perpendicularity test
|
|
244675
|
+
* @param source polyface or visitor.
|
|
244676
|
+
* @param announce callback function invoked on manifold silhouette edges.
|
|
244677
|
+
* @param vectorToEye normal of plane in which to compute silhouette edges.
|
|
244678
|
+
* @param sideAngle angular tolerance for perpendicularity test.
|
|
244525
244679
|
*/
|
|
244526
244680
|
static announceSilhouetteEdges(source, announce, vectorToEye, sideAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle()) {
|
|
244527
244681
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
@@ -244571,16 +244725,17 @@ class PolyfaceQuery {
|
|
|
244571
244725
|
* Collect manifold edges whose adjacent facet normals form vectorToEye dot products with opposite sign.
|
|
244572
244726
|
* * Does not return boundary edges.
|
|
244573
244727
|
* * Return the edges as chains of line segments.
|
|
244574
|
-
* @param source
|
|
244575
|
-
* @param vectorToEye normal of plane in which to compute silhouette edges
|
|
244576
|
-
* @param sideAngle angular tolerance for perpendicularity test
|
|
244728
|
+
* @param source polyface or visitor.
|
|
244729
|
+
* @param vectorToEye normal of plane in which to compute silhouette edges.
|
|
244730
|
+
* @param sideAngle angular tolerance for perpendicularity test.
|
|
244577
244731
|
*/
|
|
244578
244732
|
static collectSilhouetteEdges(source, vectorToEye, sideAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle()) {
|
|
244579
244733
|
const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_12__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
|
|
244580
244734
|
PolyfaceQuery.announceSilhouetteEdges(source, (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(ptA, ptB)), vectorToEye, sideAngle);
|
|
244581
244735
|
return collector.grabResult(true);
|
|
244582
244736
|
}
|
|
244583
|
-
/**
|
|
244737
|
+
/**
|
|
244738
|
+
* Find segments (within the linestring) which project to facets.
|
|
244584
244739
|
* * Announce each pair of linestring segment and on-facet segment through a callback.
|
|
244585
244740
|
* * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
244586
244741
|
*/
|
|
@@ -244593,7 +244748,24 @@ class PolyfaceQuery {
|
|
|
244593
244748
|
}
|
|
244594
244749
|
}
|
|
244595
244750
|
}
|
|
244596
|
-
/**
|
|
244751
|
+
/**
|
|
244752
|
+
* Set the limit on work during an async time blocks, and return the old value.
|
|
244753
|
+
* * This should be a large number -- default is 1.0e6
|
|
244754
|
+
* @internal
|
|
244755
|
+
*/
|
|
244756
|
+
static setAsyncWorkLimit(value) {
|
|
244757
|
+
const oldValue = this._asyncWorkLimit;
|
|
244758
|
+
this._asyncWorkLimit = value;
|
|
244759
|
+
return oldValue;
|
|
244760
|
+
}
|
|
244761
|
+
/**
|
|
244762
|
+
* Query the current limit on work during an async time block.
|
|
244763
|
+
* @internal
|
|
244764
|
+
*/
|
|
244765
|
+
static get asyncWorkLimit() {
|
|
244766
|
+
return this._asyncWorkLimit;
|
|
244767
|
+
}
|
|
244768
|
+
/** Execute `context.projectToPolygon` until its work estimates accumulate to workLimit. */
|
|
244597
244769
|
static async continueAnnounceSweepLinestringToConvexPolyfaceXY(context, visitor, announce) {
|
|
244598
244770
|
let workCount = 0;
|
|
244599
244771
|
while ((workCount < this.asyncWorkLimit) && visitor.moveToNextFacet()) {
|
|
@@ -244601,16 +244773,8 @@ class PolyfaceQuery {
|
|
|
244601
244773
|
}
|
|
244602
244774
|
return workCount;
|
|
244603
244775
|
}
|
|
244604
|
-
/**
|
|
244605
|
-
*
|
|
244606
|
-
* @internal
|
|
244607
|
-
*/
|
|
244608
|
-
static setAsyncWorkLimit(value) { const a = this._asyncWorkLimit; this._asyncWorkLimit = value; return a; }
|
|
244609
|
-
/** Query the current limit on work during an async time block.
|
|
244610
|
-
* @internal
|
|
244611
|
-
*/
|
|
244612
|
-
static get asyncWorkLimit() { return this._asyncWorkLimit; }
|
|
244613
|
-
/** Find segments (within the linestring) which project to facets.
|
|
244776
|
+
/**
|
|
244777
|
+
* Find segments (within the linestring) which project to facets.
|
|
244614
244778
|
* * Announce each pair of linestring segment and on-facet segment through a callback.
|
|
244615
244779
|
* * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
244616
244780
|
* * REMARK: Although this is public, the usual use is via slightly higher level public methods, viz:
|
|
@@ -244633,14 +244797,15 @@ class PolyfaceQuery {
|
|
|
244633
244797
|
// GeometryCoreTestIO.consoleLog({ myWorkTotal: workTotal, myBlockCount: this.awaitBlockCount });
|
|
244634
244798
|
return workTotal;
|
|
244635
244799
|
}
|
|
244636
|
-
/**
|
|
244800
|
+
/**
|
|
244801
|
+
* Search the facets for facet subsets that are connected with at least vertex contact.
|
|
244637
244802
|
* * Return array of arrays of facet indices.
|
|
244638
244803
|
*/
|
|
244639
244804
|
static partitionFacetIndicesByVertexConnectedComponent(polyface) {
|
|
244640
244805
|
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
|
|
244641
244806
|
return this.partitionFacetIndicesByVertexConnectedComponent(polyface.createVisitor(0));
|
|
244642
244807
|
}
|
|
244643
|
-
// The polyface is really a visitor
|
|
244808
|
+
// The polyface is really a visitor
|
|
244644
244809
|
const context = new _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_14__.UnionFindContext(this.visitorClientPointCount(polyface));
|
|
244645
244810
|
for (polyface.reset(); polyface.moveToNextFacet();) {
|
|
244646
244811
|
const firstVertexIndexOnThisFacet = polyface.pointIndex[0];
|
|
@@ -244668,9 +244833,9 @@ class PolyfaceQuery {
|
|
|
244668
244833
|
/**
|
|
244669
244834
|
* * Examine the normal orientation for each faces.
|
|
244670
244835
|
* * Separate to 3 partitions:
|
|
244671
|
-
* *
|
|
244672
|
-
* *
|
|
244673
|
-
* *
|
|
244836
|
+
* * Facets with normal in the positive direction of the vectorToEye (partition 0).
|
|
244837
|
+
* * Facets with normal in the negative direction of the vectorToEye (partition 1).
|
|
244838
|
+
* * Facets nearly perpendicular to the view vector (partition 2).
|
|
244674
244839
|
* * Return array of arrays of facet indices.
|
|
244675
244840
|
*/
|
|
244676
244841
|
static partitionFacetIndicesByVisibilityVector(polyface, vectorToEye, sideAngleTolerance) {
|
|
@@ -244705,13 +244870,13 @@ class PolyfaceQuery {
|
|
|
244705
244870
|
}
|
|
244706
244871
|
/**
|
|
244707
244872
|
* Return the boundary of facets that are facing the eye.
|
|
244708
|
-
* @param polyface
|
|
244873
|
+
* @param polyface the indexed polyface
|
|
244709
244874
|
* @param visibilitySubset selector among the visible facet sets extracted by partitionFacetIndicesByVisibilityVector
|
|
244710
244875
|
* * 0 ==> forward facing
|
|
244711
244876
|
* * 1 ==> rear facing
|
|
244712
244877
|
* * 2 ==> side facing
|
|
244713
|
-
* @param vectorToEye
|
|
244714
|
-
* @param sideAngleTolerance
|
|
244878
|
+
* @param vectorToEye the vector to eye
|
|
244879
|
+
* @param sideAngleTolerance the tolerance of side angle
|
|
244715
244880
|
*/
|
|
244716
244881
|
static boundaryOfVisibleSubset(polyface, visibilitySelect, vectorToEye, sideAngleTolerance = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(1.0e-3)) {
|
|
244717
244882
|
const partitionedIndices = this.partitionFacetIndicesByVisibilityVector(polyface, vectorToEye, sideAngleTolerance);
|
|
@@ -244721,10 +244886,9 @@ class PolyfaceQuery {
|
|
|
244721
244886
|
return this.boundaryEdges(visitor, true, false, false);
|
|
244722
244887
|
}
|
|
244723
244888
|
/**
|
|
244724
|
-
* Search for edges with only 1
|
|
244725
|
-
* *
|
|
244726
|
-
* *
|
|
244727
|
-
* @param mesh
|
|
244889
|
+
* Search for edges with only 1 adjacent facet.
|
|
244890
|
+
* * Chain them into loops.
|
|
244891
|
+
* * Emit the loops to the announceLoop function.
|
|
244728
244892
|
*/
|
|
244729
244893
|
static announceBoundaryChainsAsLineString3d(mesh, announceLoop) {
|
|
244730
244894
|
const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_12__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance, 1000);
|
|
@@ -244735,9 +244899,9 @@ class PolyfaceQuery {
|
|
|
244735
244899
|
* Return a mesh with
|
|
244736
244900
|
* * clusters of adjacent, coplanar facets merged into larger facets.
|
|
244737
244901
|
* * other facets included unchanged.
|
|
244738
|
-
* @param mesh existing mesh or visitor
|
|
244739
|
-
* @param maxSmoothEdgeAngle maximum dihedral angle across an edge between facets deemed coplanar. If undefined,
|
|
244740
|
-
*
|
|
244902
|
+
* @param mesh existing mesh or visitor.
|
|
244903
|
+
* @param maxSmoothEdgeAngle maximum dihedral angle across an edge between facets deemed coplanar. If undefined,
|
|
244904
|
+
* uses `Geometry.smallAngleRadians`.
|
|
244741
244905
|
*/
|
|
244742
244906
|
static cloneWithMaximalPlanarFacets(mesh, maxSmoothEdgeAngle) {
|
|
244743
244907
|
if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
@@ -244796,14 +244960,14 @@ class PolyfaceQuery {
|
|
|
244796
244960
|
* * Unclosed chains are rejected.
|
|
244797
244961
|
* * Closed chains are triangulated and returned as a mesh.
|
|
244798
244962
|
* * The options structure enforces restrictions on how complicated the hole filling can be:
|
|
244799
|
-
* * maxEdgesAroundHole -- holes with more edges are skipped
|
|
244963
|
+
* * maxEdgesAroundHole -- holes with more edges are skipped.
|
|
244800
244964
|
* * maxPerimeter -- holes with larger summed edge lengths are skipped.
|
|
244801
244965
|
* * upVector -- holes that do not have positive area along this view are skipped.
|
|
244802
|
-
* * includeOriginalMesh -- includes the original mesh in the output mesh, so the composite mesh is a
|
|
244803
|
-
*
|
|
244966
|
+
* * includeOriginalMesh -- includes the original mesh in the output mesh, so the composite mesh is a
|
|
244967
|
+
* clone with holes filled.
|
|
244968
|
+
* @param mesh existing mesh.
|
|
244804
244969
|
* @param options options controlling the hole fill.
|
|
244805
244970
|
* @param unfilledChains optional array to receive the points around holes that were not filled.
|
|
244806
|
-
* @returns
|
|
244807
244971
|
*/
|
|
244808
244972
|
static fillSimpleHoles(mesh, options, unfilledChains) {
|
|
244809
244973
|
if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
@@ -244839,9 +245003,7 @@ class PolyfaceQuery {
|
|
|
244839
245003
|
}
|
|
244840
245004
|
return builder.claimPolyface(true);
|
|
244841
245005
|
}
|
|
244842
|
-
/** Clone the facets in each partition to a separate polyface.
|
|
244843
|
-
*
|
|
244844
|
-
*/
|
|
245006
|
+
/** Clone the facets in each partition to a separate polyface. */
|
|
244845
245007
|
static clonePartitions(polyface, partitions) {
|
|
244846
245008
|
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
|
|
244847
245009
|
return this.clonePartitions(polyface.createVisitor(0), partitions);
|
|
@@ -244864,7 +245026,7 @@ class PolyfaceQuery {
|
|
|
244864
245026
|
}
|
|
244865
245027
|
return polyfaces;
|
|
244866
245028
|
}
|
|
244867
|
-
/** Clone facets that pass a filter function */
|
|
245029
|
+
/** Clone facets that pass a filter function. */
|
|
244868
245030
|
static cloneFiltered(source, filter) {
|
|
244869
245031
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
|
|
244870
245032
|
return this.cloneFiltered(source.createVisitor(0), filter);
|
|
@@ -244934,46 +245096,44 @@ class PolyfaceQuery {
|
|
|
244934
245096
|
}
|
|
244935
245097
|
return builder.claimPolyface(true);
|
|
244936
245098
|
}
|
|
244937
|
-
/**
|
|
244938
|
-
|
|
244939
|
-
|
|
244940
|
-
|
|
244941
|
-
|
|
244942
|
-
return visitor.data.point.length;
|
|
244943
|
-
const polyface = visitor.clientPolyface();
|
|
245099
|
+
/** Return the point count of the `source`. */
|
|
245100
|
+
static visitorClientPointCount(source) {
|
|
245101
|
+
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
245102
|
+
return source.data.point.length;
|
|
245103
|
+
const polyface = source.clientPolyface();
|
|
244944
245104
|
if (polyface !== undefined)
|
|
244945
245105
|
return polyface.data.point.length;
|
|
244946
|
-
|
|
245106
|
+
source.reset();
|
|
244947
245107
|
let maxIndex = -1;
|
|
244948
|
-
while (
|
|
244949
|
-
for (const pointIndex of
|
|
245108
|
+
while (source.moveToNextFacet()) {
|
|
245109
|
+
for (const pointIndex of source.pointIndex)
|
|
244950
245110
|
if (pointIndex > maxIndex)
|
|
244951
245111
|
maxIndex = pointIndex;
|
|
244952
245112
|
}
|
|
244953
245113
|
return maxIndex + 1;
|
|
244954
245114
|
}
|
|
244955
|
-
/**
|
|
244956
|
-
|
|
244957
|
-
|
|
244958
|
-
|
|
244959
|
-
|
|
244960
|
-
|
|
244961
|
-
return visitor.facetCount;
|
|
244962
|
-
visitor = visitor.createVisitor(0);
|
|
245115
|
+
/** Return the facet count of the `source`. */
|
|
245116
|
+
static visitorClientFacetCount(source) {
|
|
245117
|
+
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
|
|
245118
|
+
if (source.facetCount !== undefined)
|
|
245119
|
+
return source.facetCount;
|
|
245120
|
+
source = source.createVisitor(0);
|
|
244963
245121
|
}
|
|
244964
|
-
const polyface =
|
|
245122
|
+
const polyface = source.clientPolyface();
|
|
244965
245123
|
if (polyface !== undefined && polyface.facetCount !== undefined)
|
|
244966
245124
|
return polyface.facetCount;
|
|
244967
245125
|
let facetCount = 0;
|
|
244968
|
-
|
|
244969
|
-
while (
|
|
245126
|
+
source.reset();
|
|
245127
|
+
while (source.moveToNextFacet())
|
|
244970
245128
|
++facetCount;
|
|
244971
245129
|
return facetCount;
|
|
244972
245130
|
}
|
|
244973
|
-
/**
|
|
245131
|
+
/**
|
|
245132
|
+
* Partition the facet set into connected components such that two adjacent facets are in the same component if and
|
|
245133
|
+
* only if they are adjacent across a clustered edge.
|
|
244974
245134
|
* @param edgeClusters sorted and clustered edges (cf. `IndexedEdgeMatcher.sortAndCollectClusters`).
|
|
244975
245135
|
* @param numFacets facet count in the parent mesh. In particular, `edge.facetIndex < numFacets` for every input edge.
|
|
244976
|
-
* @return collection of facet index arrays, one array per connected component
|
|
245136
|
+
* @return collection of facet index arrays, one array per connected component.
|
|
244977
245137
|
*/
|
|
244978
245138
|
static partitionFacetIndicesBySortableEdgeClusters(edgeClusters, numFacets) {
|
|
244979
245139
|
const context = new _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_14__.UnionFindContext(numFacets);
|
|
@@ -245004,10 +245164,12 @@ class PolyfaceQuery {
|
|
|
245004
245164
|
}
|
|
245005
245165
|
return facetsInComponent;
|
|
245006
245166
|
}
|
|
245007
|
-
/**
|
|
245008
|
-
*
|
|
245009
|
-
*
|
|
245010
|
-
* @
|
|
245167
|
+
/**
|
|
245168
|
+
* Partition the facet set into connected components. Each facet in a given component shares an edge only with
|
|
245169
|
+
* other facets in the component (or is a boundary edge).
|
|
245170
|
+
* @param polyface facets to partition.
|
|
245171
|
+
* @param stopAtVisibleEdges whether to further split connected components by visible edges of the polyface.
|
|
245172
|
+
* @return collection of facet index arrays, one per connected component.
|
|
245011
245173
|
*/
|
|
245012
245174
|
static partitionFacetIndicesByEdgeConnectedComponent(polyface, stopAtVisibleEdges = false) {
|
|
245013
245175
|
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
|
|
@@ -245032,7 +245194,8 @@ class PolyfaceQuery {
|
|
|
245032
245194
|
matcher.sortAndCollectClusters(allEdges, allEdges, allEdges, allEdges);
|
|
245033
245195
|
return this.partitionFacetIndicesBySortableEdgeClusters(allEdges, numFacets);
|
|
245034
245196
|
}
|
|
245035
|
-
/**
|
|
245197
|
+
/**
|
|
245198
|
+
* Find segments (within the line string) which project to facets.
|
|
245036
245199
|
* * Assemble each input segment paired with its projected segment/point as a quad/triangle facet in a new polyface.
|
|
245037
245200
|
* * Input facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
245038
245201
|
*/
|
|
@@ -245046,7 +245209,7 @@ class PolyfaceQuery {
|
|
|
245046
245209
|
});
|
|
245047
245210
|
return builder.claimPolyface(true);
|
|
245048
245211
|
}
|
|
245049
|
-
/** @deprecated in 4.x. Use sweepLineStringToFacetsXYReturnSweptFacets instead. */
|
|
245212
|
+
/** @deprecated in 4.x. Use [[sweepLineStringToFacetsXYReturnSweptFacets]] instead. */
|
|
245050
245213
|
static sweepLinestringToFacetsXYreturnSweptFacets(linestringPoints, polyface) {
|
|
245051
245214
|
return this.sweepLineStringToFacetsXYReturnSweptFacets(linestringPoints, polyface);
|
|
245052
245215
|
}
|
|
@@ -245059,11 +245222,10 @@ class PolyfaceQuery {
|
|
|
245059
245222
|
*/
|
|
245060
245223
|
static sweepLineStringToFacets(linestringPoints, polyfaceOrVisitor, options) {
|
|
245061
245224
|
let result = [];
|
|
245062
|
-
// setup default options
|
|
245225
|
+
// setup default options
|
|
245063
245226
|
if (options === undefined)
|
|
245064
245227
|
options = SweepLineStringToFacetsOptions.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallAngleRadians), // tight geometry tolerance for vertical side facets
|
|
245065
|
-
true,
|
|
245066
|
-
true, true, true); // accept all outputs
|
|
245228
|
+
true, true, true, true);
|
|
245067
245229
|
let chainContext;
|
|
245068
245230
|
if (options.assembleChains)
|
|
245069
245231
|
chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_25__.ChainMergeContext.create();
|
|
@@ -245094,9 +245256,9 @@ class PolyfaceQuery {
|
|
|
245094
245256
|
}
|
|
245095
245257
|
/**
|
|
245096
245258
|
* Sweep the line string in the z-direction to intersections with a mesh, using a search object for speedup.
|
|
245097
|
-
* @param lineStringPoints input line string to drape on the mesh
|
|
245098
|
-
* @param polyfaceOrVisitor mesh, or mesh visitor to traverse only part of a mesh
|
|
245099
|
-
* @param searchByReadIndex object for searching facet 2D ranges tagged by mesh read index
|
|
245259
|
+
* @param lineStringPoints input line string to drape on the mesh.
|
|
245260
|
+
* @param polyfaceOrVisitor mesh, or mesh visitor to traverse only part of a mesh.
|
|
245261
|
+
* @param searchByReadIndex object for searching facet 2D ranges tagged by mesh read index.
|
|
245100
245262
|
* @example Using a 5x5 indexed search grid:
|
|
245101
245263
|
* ```
|
|
245102
245264
|
* const xyRange = Range2d.createFrom(myPolyface.range());
|
|
@@ -245106,7 +245268,7 @@ class PolyfaceQuery {
|
|
|
245106
245268
|
* }
|
|
245107
245269
|
* const drapedLineStrings = PolyfaceQuery.sweepLineStringToFacetsXY(lineString, myPolyface, searcher);
|
|
245108
245270
|
* ```
|
|
245109
|
-
* @returns collected line strings
|
|
245271
|
+
* @returns the collected line strings.
|
|
245110
245272
|
*/
|
|
245111
245273
|
static sweepLineStringToFacetsXY(lineStringPoints, polyfaceOrVisitor, searchByReadIndex) {
|
|
245112
245274
|
const chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_25__.ChainMergeContext.create();
|
|
@@ -245140,32 +245302,36 @@ class PolyfaceQuery {
|
|
|
245140
245302
|
chainContext.clusterAndMergeVerticesXYZ();
|
|
245141
245303
|
return chainContext.collectMaximalChains();
|
|
245142
245304
|
}
|
|
245143
|
-
/**
|
|
245305
|
+
/**
|
|
245306
|
+
* Find segments (within the linestring) which project to facets.
|
|
245144
245307
|
* * Return collected line segments.
|
|
245145
245308
|
* * This calls [[sweepLineStringToFacets]] with options created by
|
|
245146
|
-
* `const options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createSmallAngle(),false, true, true, true);`
|
|
245147
|
-
* @deprecated in 4.x. Use [[sweepLineStringToFacets]] to get further options.
|
|
245309
|
+
* `const options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createSmallAngle(), false, true, true, true);`
|
|
245310
|
+
* @deprecated in 4.x. Use [[PolyfaceQuery.sweepLineStringToFacets]] to get further options.
|
|
245148
245311
|
*/
|
|
245149
245312
|
static sweepLinestringToFacetsXYReturnLines(linestringPoints, polyface) {
|
|
245150
245313
|
const options = SweepLineStringToFacetsOptions.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle(), false, true, true, true);
|
|
245151
245314
|
const result = PolyfaceQuery.sweepLineStringToFacets(linestringPoints, polyface, options);
|
|
245152
245315
|
return result;
|
|
245153
245316
|
}
|
|
245154
|
-
/**
|
|
245317
|
+
/**
|
|
245318
|
+
* Find segments (within the linestring) which project to facets.
|
|
245155
245319
|
* * Return chains.
|
|
245156
245320
|
* * This calls [[sweepLineStringToFacets]] with options created by
|
|
245157
245321
|
* `const options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createSmallAngle(),true, true, true, true);`
|
|
245158
|
-
* @deprecated in 4.x. Use [[sweepLineStringToFacets]] to get further options.
|
|
245322
|
+
* @deprecated in 4.x. Use [[PolyfaceQuery.sweepLineStringToFacets]] to get further options.
|
|
245159
245323
|
*/
|
|
245160
245324
|
static sweepLinestringToFacetsXYReturnChains(linestringPoints, polyface) {
|
|
245161
245325
|
const options = SweepLineStringToFacetsOptions.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle(), true, true, true, true);
|
|
245162
245326
|
const result = PolyfaceQuery.sweepLineStringToFacets(linestringPoints, polyface, options);
|
|
245163
245327
|
return result;
|
|
245164
245328
|
}
|
|
245165
|
-
/**
|
|
245329
|
+
/**
|
|
245330
|
+
* Find segments (within the linestring) which project to facets.
|
|
245166
245331
|
* * This is done as a sequence of "await" steps.
|
|
245167
|
-
* * Each "await" step deals with approximately PolyfaceQuery.asyncWorkLimit pairings of
|
|
245168
|
-
*
|
|
245332
|
+
* * Each "await" step deals with approximately PolyfaceQuery.asyncWorkLimit pairings of "linestring edge"
|
|
245333
|
+
* with "facet edge".
|
|
245334
|
+
* * PolyfaceQuery.setAsyncWorkLimit() to change work blocks from default.
|
|
245169
245335
|
* * Return chains.
|
|
245170
245336
|
* * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
245171
245337
|
*/
|
|
@@ -245179,7 +245345,7 @@ class PolyfaceQuery {
|
|
|
245179
245345
|
return chains;
|
|
245180
245346
|
}
|
|
245181
245347
|
/**
|
|
245182
|
-
*
|
|
245348
|
+
* Examine ranges of facets.
|
|
245183
245349
|
* * Return statistical summary of x,y,z ranges.
|
|
245184
245350
|
*/
|
|
245185
245351
|
static collectRangeLengthData(polyface) {
|
|
@@ -245187,17 +245353,18 @@ class PolyfaceQuery {
|
|
|
245187
245353
|
return this.collectRangeLengthData(polyface.createVisitor(0));
|
|
245188
245354
|
}
|
|
245189
245355
|
const rangeData = new _RangeLengthData__WEBPACK_IMPORTED_MODULE_28__.RangeLengthData();
|
|
245190
|
-
// polyface is a visitor
|
|
245356
|
+
// polyface is a visitor
|
|
245191
245357
|
for (polyface.reset(); polyface.moveToNextFacet();)
|
|
245192
245358
|
rangeData.accumulateGrowableXYZArrayRange(polyface.point);
|
|
245193
245359
|
return rangeData;
|
|
245194
245360
|
}
|
|
245195
|
-
/**
|
|
245196
|
-
*
|
|
245361
|
+
/**
|
|
245362
|
+
* Clone the facets, inserting vertices (within edges) where points not part of each facet's vertex indices
|
|
245363
|
+
* impinge within edges.
|
|
245197
245364
|
*/
|
|
245198
245365
|
static cloneWithTVertexFixup(polyface) {
|
|
245199
|
-
const oldFacetVisitor = polyface.createVisitor(1); //
|
|
245200
|
-
const newFacetVisitor = polyface.createVisitor(0); //
|
|
245366
|
+
const oldFacetVisitor = polyface.createVisitor(1); // this is to visit the existing facets
|
|
245367
|
+
const newFacetVisitor = polyface.createVisitor(0); // this is to build the new facets
|
|
245201
245368
|
const rangeSearcher = _multiclip_XYPointBuckets__WEBPACK_IMPORTED_MODULE_29__.XYPointBuckets.create(polyface.data.point, 30);
|
|
245202
245369
|
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
245203
245370
|
const edgeRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_26__.Range3d.createNull();
|
|
@@ -245208,7 +245375,7 @@ class PolyfaceQuery {
|
|
|
245208
245375
|
for (oldFacetVisitor.reset(); oldFacetVisitor.moveToNextFacet();) {
|
|
245209
245376
|
newFacetVisitor.clearArrays();
|
|
245210
245377
|
for (let i = 0; i + 1 < oldFacetVisitor.point.length; i++) {
|
|
245211
|
-
// each base vertex is part of the result
|
|
245378
|
+
// each base vertex is part of the result
|
|
245212
245379
|
oldFacetVisitor.point.getPoint3dAtUncheckedPointIndex(i, point0);
|
|
245213
245380
|
oldFacetVisitor.point.getPoint3dAtUncheckedPointIndex(i + 1, point1);
|
|
245214
245381
|
newFacetVisitor.pushDataFrom(oldFacetVisitor, i);
|
|
@@ -245219,12 +245386,12 @@ class PolyfaceQuery {
|
|
|
245219
245386
|
edgeRange.extend(point1);
|
|
245220
245387
|
edgeRange.ensureMinLengths(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance); // add some slop in case segment is axis-aligned
|
|
245221
245388
|
rangeSearcher.announcePointsInRange(edgeRange, (index, _x, _y, _z) => {
|
|
245222
|
-
// x,y,z has x,y within the range of the search
|
|
245389
|
+
// x,y,z has x,y within the range of the search; test for exact on (in full 3d)
|
|
245223
245390
|
polyface.data.point.getPoint3dAtUncheckedPointIndex(index, spacePoint);
|
|
245224
245391
|
const detail = segment.closestPoint(spacePoint, false);
|
|
245225
245392
|
if (undefined !== detail) {
|
|
245226
|
-
if (detail.fraction > 0.0 && detail.fraction < 1.0 && !detail.point.isAlmostEqual(point0) &&
|
|
245227
|
-
&& spacePoint.isAlmostEqual(detail.point)) {
|
|
245393
|
+
if (detail.fraction > 0.0 && detail.fraction < 1.0 && !detail.point.isAlmostEqual(point0) &&
|
|
245394
|
+
!detail.point.isAlmostEqual(point1) && spacePoint.isAlmostEqual(detail.point)) {
|
|
245228
245395
|
if (detailArray === undefined)
|
|
245229
245396
|
detailArray = [];
|
|
245230
245397
|
detail.a = index;
|
|
@@ -245245,14 +245412,13 @@ class PolyfaceQuery {
|
|
|
245245
245412
|
return builder.claimPolyface();
|
|
245246
245413
|
}
|
|
245247
245414
|
/**
|
|
245415
|
+
* Compare index arrays formatted as follows. Return 0 if arrays are the same.
|
|
245248
245416
|
* * Each array input structure is: [facetIndex, vertexIndex0, vertexIndex1, ....]
|
|
245249
|
-
* * Vertex indices assumed reversed so
|
|
245250
|
-
* * vertexIndex0 is the lowest index on the facet
|
|
245251
|
-
* * vertexIndex1 is the lowest neighbor of vertex0
|
|
245417
|
+
* * Vertex indices assumed reversed so:
|
|
245418
|
+
* * vertexIndex0 is the lowest index on the facet.
|
|
245419
|
+
* * vertexIndex1 is the lowest neighbor of vertex0.
|
|
245252
245420
|
* * first different entry among vertex indices determines lexical result.
|
|
245253
|
-
* *
|
|
245254
|
-
* @param arrayA
|
|
245255
|
-
* @param arrayB
|
|
245421
|
+
* * hence facets with duplicate indices (whether forward or reversed) are considered equal.
|
|
245256
245422
|
*/
|
|
245257
245423
|
static compareFacetIndexAndVertexIndices(arrayA, arrayB) {
|
|
245258
245424
|
if (arrayA.length !== arrayB.length)
|
|
@@ -245265,25 +245431,12 @@ class PolyfaceQuery {
|
|
|
245265
245431
|
return 0;
|
|
245266
245432
|
}
|
|
245267
245433
|
/**
|
|
245268
|
-
*
|
|
245269
|
-
* @
|
|
245270
|
-
*
|
|
245271
|
-
*/
|
|
245272
|
-
static collectDuplicateFacetIndices(polyface, includeSingletons = false) {
|
|
245273
|
-
const result = [];
|
|
245274
|
-
this.announceDuplicateFacetIndices(polyface, (clusterFacetIndices) => {
|
|
245275
|
-
if (includeSingletons || clusterFacetIndices.length > 1)
|
|
245276
|
-
result.push(clusterFacetIndices.slice());
|
|
245277
|
-
});
|
|
245278
|
-
return result;
|
|
245279
|
-
}
|
|
245280
|
-
/**
|
|
245281
|
-
* * Return an array of arrays describing facet duplication.
|
|
245282
|
-
* @param includeSingletons if true, non-duplicated facets are included in the output.
|
|
245283
|
-
* * Each array `entry` in the output contains read indices of a cluster of facets with the same vertex indices.
|
|
245434
|
+
* Announce facet duplicates.
|
|
245435
|
+
* @returns an array of arrays describing facet duplication. Each array `entry` in the output contains read
|
|
245436
|
+
* indices of a cluster of facets with the same vertex indices.
|
|
245284
245437
|
*/
|
|
245285
245438
|
static announceDuplicateFacetIndices(polyface, announceCluster) {
|
|
245286
|
-
const visitor = polyface.createVisitor(0); //
|
|
245439
|
+
const visitor = polyface.createVisitor(0); // this is to visit the existing facets
|
|
245287
245440
|
const facetIndexAndVertexIndices = [];
|
|
245288
245441
|
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
245289
245442
|
const facetIndex = visitor.currentReadIndex();
|
|
@@ -245291,12 +245444,12 @@ class PolyfaceQuery {
|
|
|
245291
245444
|
const pointIndex = visitor.pointIndex;
|
|
245292
245445
|
const numPointsThisFacet = pointIndex.length;
|
|
245293
245446
|
let lowIndex = 0;
|
|
245294
|
-
// find the lowest point index
|
|
245447
|
+
// find the lowest point index
|
|
245295
245448
|
for (let i = 1; i < visitor.pointIndex.length; i++) {
|
|
245296
245449
|
if (pointIndex[i] < pointIndex[lowIndex])
|
|
245297
245450
|
lowIndex = i;
|
|
245298
245451
|
}
|
|
245299
|
-
// find its lowest neighbor
|
|
245452
|
+
// find its lowest neighbor; assemble sort array in that direction
|
|
245300
245453
|
if (pointIndex[(lowIndex + 1) % numPointsThisFacet] < pointIndex[(lowIndex + numPointsThisFacet - 1) % numPointsThisFacet]) {
|
|
245301
245454
|
for (let i = 0; i < numPointsThisFacet; i++) {
|
|
245302
245455
|
entry.push(pointIndex[(lowIndex + i) % numPointsThisFacet]);
|
|
@@ -245324,9 +245477,26 @@ class PolyfaceQuery {
|
|
|
245324
245477
|
announceCluster(clusterArray);
|
|
245325
245478
|
}
|
|
245326
245479
|
}
|
|
245327
|
-
/**
|
|
245480
|
+
/**
|
|
245481
|
+
* Collect facet duplicates.
|
|
245482
|
+
* @param polyface the polyface.
|
|
245483
|
+
* @param includeSingletons if true, non-duplicated facets are included in the output.
|
|
245484
|
+
* @returns an array of arrays describing facet duplication. Each array `entry` in the output contains read
|
|
245485
|
+
* indices of a cluster of facets with the same vertex indices.
|
|
245486
|
+
*/
|
|
245487
|
+
static collectDuplicateFacetIndices(polyface, includeSingletons = false) {
|
|
245488
|
+
const result = [];
|
|
245489
|
+
this.announceDuplicateFacetIndices(polyface, (clusterFacetIndices) => {
|
|
245490
|
+
if (includeSingletons || clusterFacetIndices.length > 1)
|
|
245491
|
+
result.push(clusterFacetIndices.slice());
|
|
245492
|
+
});
|
|
245493
|
+
return result;
|
|
245494
|
+
}
|
|
245495
|
+
/**
|
|
245496
|
+
* Return a new facet set with a subset of facets in polyface.
|
|
245497
|
+
* @param source the polyface.
|
|
245328
245498
|
* @param includeSingletons true to copy facets that only appear once
|
|
245329
|
-
* @param clusterSelector indicates whether duplicate clusters are to have 0, 1, or all facets included
|
|
245499
|
+
* @param clusterSelector indicates whether duplicate clusters are to have 0, 1, or all facets included.
|
|
245330
245500
|
*/
|
|
245331
245501
|
static cloneByFacetDuplication(source, includeSingletons, clusterSelector) {
|
|
245332
245502
|
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
@@ -245352,25 +245522,23 @@ class PolyfaceQuery {
|
|
|
245352
245522
|
});
|
|
245353
245523
|
return builder.claimPolyface();
|
|
245354
245524
|
}
|
|
245355
|
-
/** Clone the facets,
|
|
245356
|
-
*
|
|
245357
|
-
*/
|
|
245525
|
+
/** Clone the facets, removing points that are simply within colinear edges. */
|
|
245358
245526
|
static cloneWithColinearEdgeFixup(polyface) {
|
|
245359
|
-
const oldFacetVisitor = polyface.createVisitor(2); //
|
|
245360
|
-
const newFacetVisitor = polyface.createVisitor(0); //
|
|
245527
|
+
const oldFacetVisitor = polyface.createVisitor(2); // this is to visit the existing facets
|
|
245528
|
+
const newFacetVisitor = polyface.createVisitor(0); // this is to build the new facets
|
|
245361
245529
|
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
245362
245530
|
const vector01 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
245363
245531
|
const vector12 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
245364
245532
|
const numPoint = polyface.data.point.length;
|
|
245365
245533
|
const pointState = new Int32Array(numPoint);
|
|
245366
|
-
// FIRST PASS
|
|
245367
|
-
//
|
|
245368
|
-
//
|
|
245369
|
-
//
|
|
245370
|
-
//
|
|
245534
|
+
// FIRST PASS: in each sector of each facet, determine if the sector has colinear incoming and outgoing vectors.
|
|
245535
|
+
// Mark each point as
|
|
245536
|
+
// 0 unvisited
|
|
245537
|
+
// -1 adjacent to a non-colinear sector
|
|
245538
|
+
// n adjacent to n colinear sectors
|
|
245371
245539
|
for (oldFacetVisitor.reset(); oldFacetVisitor.moveToNextFacet();) {
|
|
245372
245540
|
for (let i = 0; i + 2 < oldFacetVisitor.point.length; i++) {
|
|
245373
|
-
// each base vertex is part of the result
|
|
245541
|
+
// each base vertex is part of the result
|
|
245374
245542
|
oldFacetVisitor.point.vectorIndexIndex(i, i + 1, vector01);
|
|
245375
245543
|
oldFacetVisitor.point.vectorIndexIndex(i + 1, i + 2, vector12);
|
|
245376
245544
|
const pointIndex = oldFacetVisitor.clientPointIndex(i + 1);
|
|
@@ -245385,7 +245553,7 @@ class PolyfaceQuery {
|
|
|
245385
245553
|
}
|
|
245386
245554
|
}
|
|
245387
245555
|
}
|
|
245388
|
-
// SECOND PASS
|
|
245556
|
+
// SECOND PASS: make copies, omitting references to points at colinear sectors.
|
|
245389
245557
|
for (oldFacetVisitor.reset(); oldFacetVisitor.moveToNextFacet();) {
|
|
245390
245558
|
newFacetVisitor.clearArrays();
|
|
245391
245559
|
for (let i = 0; i + 2 < oldFacetVisitor.point.length; i++) {
|
|
@@ -245401,9 +245569,9 @@ class PolyfaceQuery {
|
|
|
245401
245569
|
}
|
|
245402
245570
|
/**
|
|
245403
245571
|
* Set the edge visibility for specified edges in the polyface.
|
|
245404
|
-
* @param polyface mesh to be edited
|
|
245405
|
-
* @param clusters array of edge references
|
|
245406
|
-
* @param value visibility value (true or false)
|
|
245572
|
+
* @param polyface mesh to be edited.
|
|
245573
|
+
* @param clusters array of edge references.
|
|
245574
|
+
* @param value visibility value (true or false).
|
|
245407
245575
|
*/
|
|
245408
245576
|
static setEdgeVisibility(polyface, clusters, value) {
|
|
245409
245577
|
for (const cluster of clusters) {
|
|
@@ -245418,9 +245586,9 @@ class PolyfaceQuery {
|
|
|
245418
245586
|
}
|
|
245419
245587
|
/**
|
|
245420
245588
|
* Set the visibility of a particular edge of a particular facet.
|
|
245421
|
-
* @param polyface containing polyface
|
|
245422
|
-
* @param facetIndex facet index
|
|
245423
|
-
* @param vertexIndex vertex index (in vertex array) at which the edge starts
|
|
245589
|
+
* @param polyface containing polyface.
|
|
245590
|
+
* @param facetIndex facet index.
|
|
245591
|
+
* @param vertexIndex vertex index (in vertex array) at which the edge starts.
|
|
245424
245592
|
* @param value visibility value.
|
|
245425
245593
|
*/
|
|
245426
245594
|
static setSingleEdgeVisibility(polyface, facetIndex, vertexIndex, value) {
|
|
@@ -245433,9 +245601,9 @@ class PolyfaceQuery {
|
|
|
245433
245601
|
}
|
|
245434
245602
|
/**
|
|
245435
245603
|
* Get the visibility of a particular edge of a particular facet.
|
|
245436
|
-
* @param polyface containing polyface
|
|
245437
|
-
* @param facetIndex facet index
|
|
245438
|
-
* @param vertexIndex vertex index (in vertex array) at which the edge starts
|
|
245604
|
+
* @param polyface containing polyface.
|
|
245605
|
+
* @param facetIndex facet index.
|
|
245606
|
+
* @param vertexIndex vertex index (in vertex array) at which the edge starts.
|
|
245439
245607
|
*/
|
|
245440
245608
|
static getSingleEdgeVisibility(polyface, facetIndex, vertexIndex) {
|
|
245441
245609
|
const data = polyface.data;
|
|
@@ -245446,29 +245614,13 @@ class PolyfaceQuery {
|
|
|
245446
245614
|
return data.edgeVisible[i]; // return visibility of first edge in the face that starts at this vertex
|
|
245447
245615
|
return undefined;
|
|
245448
245616
|
}
|
|
245449
|
-
/** Load all half edges from a mesh to an IndexedEdgeMatcher.
|
|
245450
|
-
* @param polyface a mesh, or a visitor assumed to have numWrap === 1
|
|
245451
|
-
*/
|
|
245452
|
-
static createIndexedEdges(polyface) {
|
|
245453
|
-
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
245454
|
-
return this.createIndexedEdges(polyface.createVisitor(1));
|
|
245455
|
-
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
|
|
245456
|
-
polyface.reset();
|
|
245457
|
-
while (polyface.moveToNextFacet()) {
|
|
245458
|
-
const numEdges = polyface.pointCount - 1;
|
|
245459
|
-
for (let i = 0; i < numEdges; i++) {
|
|
245460
|
-
edges.addEdge(polyface.clientPointIndex(i), polyface.clientPointIndex(i + 1), polyface.currentReadIndex());
|
|
245461
|
-
}
|
|
245462
|
-
}
|
|
245463
|
-
return edges;
|
|
245464
|
-
}
|
|
245465
245617
|
/**
|
|
245466
245618
|
* Return manifold edge pairs whose dihedral angle is bounded by the given angle.
|
|
245467
245619
|
* * The dihedral angle of a manifold edge is measured between the normals of its two adjacent faces.
|
|
245468
245620
|
* * Boundary edges are not returned as they are not manifold.
|
|
245469
|
-
* @param mesh existing polyface or visitor
|
|
245470
|
-
* @param maxSmoothEdgeAngle maximum dihedral angle of a smooth edge. If undefined
|
|
245471
|
-
* @param sharpEdges true to reverse the angle threshold test and return sharp edges; otherwise return smooth edges (default)
|
|
245621
|
+
* @param mesh existing polyface or visitor.
|
|
245622
|
+
* @param maxSmoothEdgeAngle maximum dihedral angle of a smooth edge. If `undefined`, uses `Geometry.smallAngleRadians`.
|
|
245623
|
+
* @param sharpEdges true to reverse the angle threshold test and return sharp edges; otherwise return smooth edges (default).
|
|
245472
245624
|
*/
|
|
245473
245625
|
static collectEdgesByDihedralAngle(mesh, maxSmoothEdgeAngle, sharpEdges = false) {
|
|
245474
245626
|
if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
@@ -245503,13 +245655,13 @@ class PolyfaceQuery {
|
|
|
245503
245655
|
return outEdges;
|
|
245504
245656
|
}
|
|
245505
245657
|
/**
|
|
245658
|
+
* Make paired edges invisible.
|
|
245506
245659
|
* * Find mated pairs among facet edges.
|
|
245507
245660
|
* * Mated pairs have the same vertex indices appearing in opposite order.
|
|
245508
245661
|
* * Mark all non-mated pairs visible.
|
|
245509
245662
|
* * At mated pairs
|
|
245510
245663
|
* * if angle across the edge is larger than `sharpEdgeAngle`, mark visible
|
|
245511
245664
|
* * otherwise mark invisible.
|
|
245512
|
-
* @param mesh mesh to be marked
|
|
245513
245665
|
*/
|
|
245514
245666
|
static markPairedEdgesInvisible(mesh, sharpEdgeAngle) {
|
|
245515
245667
|
const visitor = mesh.createVisitor(1);
|
|
@@ -245538,7 +245690,8 @@ class PolyfaceQuery {
|
|
|
245538
245690
|
}
|
|
245539
245691
|
}
|
|
245540
245692
|
}
|
|
245541
|
-
/**
|
|
245693
|
+
/**
|
|
245694
|
+
* Try to compute a unit normal for a facet accessible through a visitor.
|
|
245542
245695
|
* * Unit normal is computed by `PolygonOps.unitNormal` with the points around the facet.
|
|
245543
245696
|
*/
|
|
245544
245697
|
static computeFacetUnitNormal(visitor, facetIndex, result) {
|
|
@@ -245551,18 +245704,18 @@ class PolyfaceQuery {
|
|
|
245551
245704
|
return undefined;
|
|
245552
245705
|
}
|
|
245553
245706
|
/**
|
|
245554
|
-
|
|
245555
|
-
|
|
245556
|
-
|
|
245557
|
-
|
|
245707
|
+
* * Mark all edge visibilities in the IndexedPolyface.
|
|
245708
|
+
* @param mesh mesh to be marked.
|
|
245709
|
+
* @param value true for visible, false for hidden.
|
|
245710
|
+
*/
|
|
245558
245711
|
static markAllEdgeVisibility(mesh, value) {
|
|
245559
245712
|
const data = mesh.data;
|
|
245560
245713
|
for (let i = 0; i < data.edgeVisible.length; i++)
|
|
245561
245714
|
data.edgeVisible[i] = value;
|
|
245562
245715
|
}
|
|
245563
245716
|
/**
|
|
245564
|
-
* Create a HalfEdgeGraph with a face for each facet of the IndexedPolyface
|
|
245565
|
-
* @param mesh mesh to convert
|
|
245717
|
+
* Create a HalfEdgeGraph with a face for each facet of the IndexedPolyface.
|
|
245718
|
+
* @param mesh mesh to convert.
|
|
245566
245719
|
* @internal
|
|
245567
245720
|
*/
|
|
245568
245721
|
static convertToHalfEdgeGraph(mesh) {
|
|
@@ -245581,28 +245734,22 @@ class PolyfaceQuery {
|
|
|
245581
245734
|
});
|
|
245582
245735
|
return graph;
|
|
245583
245736
|
}
|
|
245584
|
-
/**
|
|
245585
|
-
* * Examine adjacent facet orientations throughout the mesh
|
|
245586
|
-
* * If possible, reverse a subset to achieve proper pairing.
|
|
245587
|
-
* @param mesh
|
|
245588
|
-
*/
|
|
245737
|
+
/** Examine adjacent facet orientations throughout the mesh. If possible, reverse a subset to achieve proper pairing. */
|
|
245589
245738
|
static reorientVertexOrderAroundFacetsForConsistentOrientation(mesh) {
|
|
245590
245739
|
return _FacetOrientation__WEBPACK_IMPORTED_MODULE_31__.FacetOrientationFixup.doFixup(mesh);
|
|
245591
245740
|
}
|
|
245592
|
-
/**
|
|
245593
|
-
* Set up indexed normals with one normal in the plane of each facet of the mesh.
|
|
245594
|
-
* @param polyface
|
|
245595
|
-
*/
|
|
245741
|
+
/** Set up indexed normals with one normal in the plane of each facet of the mesh. */
|
|
245596
245742
|
static buildPerFaceNormals(polyface) {
|
|
245597
245743
|
_multiclip_BuildAverageNormalsContext__WEBPACK_IMPORTED_MODULE_32__.BuildAverageNormalsContext.buildPerFaceNormals(polyface);
|
|
245598
245744
|
}
|
|
245599
245745
|
/**
|
|
245600
|
-
* * At each vertex of the mesh
|
|
245601
|
-
* * Find clusters of almost parallel normals
|
|
245602
|
-
* * Compute simple average of those normals
|
|
245603
|
-
* * Index to the averages
|
|
245746
|
+
* * At each vertex of the mesh:
|
|
245747
|
+
* * Find clusters of almost parallel normals.
|
|
245748
|
+
* * Compute simple average of those normals.
|
|
245749
|
+
* * Index to the averages.
|
|
245604
245750
|
* * For typical meshes, this correctly clusters adjacent normals.
|
|
245605
|
-
* * One can imagine a vertex with multiple "smooth cone-like" sets of
|
|
245751
|
+
* * One can imagine a vertex with multiple "smooth cone-like" sets of adjacent facets such that averaging occurs
|
|
245752
|
+
* among two nonadjacent cones. But this does not seem to be a problem in practice.
|
|
245606
245753
|
* @param polyface polyface to update.
|
|
245607
245754
|
* @param toleranceAngle averaging is done between normals up to this angle.
|
|
245608
245755
|
*/
|
|
@@ -245611,9 +245758,9 @@ class PolyfaceQuery {
|
|
|
245611
245758
|
}
|
|
245612
245759
|
/**
|
|
245613
245760
|
* Offset the faces of the mesh.
|
|
245614
|
-
* @param source original mesh
|
|
245761
|
+
* @param source original mesh.
|
|
245615
245762
|
* @param signedOffsetDistance distance to offset
|
|
245616
|
-
* @param offsetOptions angle options.
|
|
245763
|
+
* @param offsetOptions angle options. The default options are recommended.
|
|
245617
245764
|
* @returns shifted mesh.
|
|
245618
245765
|
*/
|
|
245619
245766
|
static cloneOffset(source, signedOffsetDistance, offsetOptions = OffsetMeshOptions.create()) {
|
|
@@ -245622,16 +245769,22 @@ class PolyfaceQuery {
|
|
|
245622
245769
|
_multiclip_OffsetMeshContext__WEBPACK_IMPORTED_MODULE_33__.OffsetMeshContext.buildOffsetMeshWithEdgeChamfers(source, offsetBuilder, signedOffsetDistance, offsetOptions);
|
|
245623
245770
|
return offsetBuilder.claimPolyface();
|
|
245624
245771
|
}
|
|
245625
|
-
/**
|
|
245626
|
-
*
|
|
245627
|
-
*
|
|
245772
|
+
/**
|
|
245773
|
+
* Search facets for the first one that intersects the infinite line.
|
|
245774
|
+
* * To process _all_ intersections, callers can supply an `options.acceptIntersection` callback that always
|
|
245775
|
+
* returns `false`.
|
|
245776
|
+
* In this case, `intersectRay3d` will return `undefined`, but the callback will be invoked for each intersection.
|
|
245628
245777
|
* * Example callback logic:
|
|
245629
245778
|
* * Accept the first found facet that intersects the half-line specified by the ray: `return detail.a >= 0.0;`
|
|
245630
|
-
* * Collect all intersections: `myIntersections.push(detail.clone()); return false;` Then after `intersectRay3d`
|
|
245631
|
-
*
|
|
245632
|
-
* @param
|
|
245633
|
-
* @param
|
|
245634
|
-
*
|
|
245779
|
+
* * Collect all intersections: `myIntersections.push(detail.clone()); return false;` Then after `intersectRay3d`
|
|
245780
|
+
* returns, sort along `ray` with `myIntersections.sort((d0, d1) => d0.a - d1.a);`
|
|
245781
|
+
* @param visitor facet iterator.
|
|
245782
|
+
* @param ray infinite line parameterized as a ray. The returned `detail.a` is the intersection parameter on the
|
|
245783
|
+
* ray, e.g., zero at `ray.origin` and increasing in `ray.direction`.
|
|
245784
|
+
* @param options options for computing and populating an intersection detail, and an optional callback for
|
|
245785
|
+
* accepting one.
|
|
245786
|
+
* @return detail for the (accepted) intersection with `detail.IsInsideOrOn === true`, or `undefined` if no
|
|
245787
|
+
* (accepted) intersection.
|
|
245635
245788
|
* @see PolygonOps.intersectRay3d
|
|
245636
245789
|
*/
|
|
245637
245790
|
static intersectRay3d(visitor, ray, options) {
|
|
@@ -245674,7 +245827,8 @@ class PolyfaceQuery {
|
|
|
245674
245827
|
}
|
|
245675
245828
|
// amount of computation to do per step of async methods.
|
|
245676
245829
|
PolyfaceQuery._asyncWorkLimit = 1.e06;
|
|
245677
|
-
/**
|
|
245830
|
+
/**
|
|
245831
|
+
* Number of "await" steps executed in recent async calls.
|
|
245678
245832
|
* @internal
|
|
245679
245833
|
*/
|
|
245680
245834
|
PolyfaceQuery.awaitBlockCount = 0;
|
|
@@ -255038,44 +255192,45 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
255038
255192
|
/* harmony export */ "DgnSpiralTypeQueries": () => (/* binding */ DgnSpiralTypeQueries)
|
|
255039
255193
|
/* harmony export */ });
|
|
255040
255194
|
/* harmony import */ var flatbuffers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flatbuffers */ "../../common/temp/node_modules/.pnpm/flatbuffers@1.12.0/node_modules/flatbuffers/js/flatbuffers.mjs");
|
|
255041
|
-
/* harmony import */ var
|
|
255042
|
-
/* harmony import */ var
|
|
255043
|
-
/* harmony import */ var
|
|
255044
|
-
/* harmony import */ var
|
|
255045
|
-
/* harmony import */ var
|
|
255046
|
-
/* harmony import */ var
|
|
255047
|
-
/* harmony import */ var
|
|
255048
|
-
/* harmony import */ var
|
|
255049
|
-
/* harmony import */ var
|
|
255050
|
-
/* harmony import */ var
|
|
255051
|
-
/* harmony import */ var
|
|
255052
|
-
/* harmony import */ var
|
|
255053
|
-
/* harmony import */ var
|
|
255054
|
-
/* harmony import */ var
|
|
255055
|
-
/* harmony import */ var
|
|
255056
|
-
/* harmony import */ var
|
|
255057
|
-
/* harmony import */ var
|
|
255058
|
-
/* harmony import */ var
|
|
255059
|
-
/* harmony import */ var
|
|
255060
|
-
/* harmony import */ var
|
|
255061
|
-
/* harmony import */ var
|
|
255062
|
-
/* harmony import */ var
|
|
255063
|
-
/* harmony import */ var
|
|
255064
|
-
/* harmony import */ var
|
|
255065
|
-
/* harmony import */ var
|
|
255066
|
-
/* harmony import */ var
|
|
255067
|
-
/* harmony import */ var
|
|
255068
|
-
/* harmony import */ var
|
|
255069
|
-
/* harmony import */ var
|
|
255070
|
-
/* harmony import */ var
|
|
255071
|
-
/* harmony import */ var
|
|
255072
|
-
/* harmony import */ var
|
|
255073
|
-
/* harmony import */ var
|
|
255074
|
-
/* harmony import */ var
|
|
255075
|
-
/* harmony import */ var
|
|
255076
|
-
/* harmony import */ var
|
|
255077
|
-
/* harmony import */ var
|
|
255078
|
-
/* harmony import */ var
|
|
255195
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
255196
|
+
/* harmony import */ var _bspline_AkimaCurve3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../bspline/AkimaCurve3d */ "../../core/geometry/lib/esm/bspline/AkimaCurve3d.js");
|
|
255197
|
+
/* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
|
|
255198
|
+
/* harmony import */ var _bspline_BSplineCurve3dH__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../bspline/BSplineCurve3dH */ "../../core/geometry/lib/esm/bspline/BSplineCurve3dH.js");
|
|
255199
|
+
/* harmony import */ var _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../bspline/BSplineSurface */ "../../core/geometry/lib/esm/bspline/BSplineSurface.js");
|
|
255200
|
+
/* harmony import */ var _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../bspline/InterpolationCurve3d */ "../../core/geometry/lib/esm/bspline/InterpolationCurve3d.js");
|
|
255201
|
+
/* harmony import */ var _curve_Arc3d__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../curve/Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
255202
|
+
/* harmony import */ var _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../curve/CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
255203
|
+
/* harmony import */ var _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../curve/GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
|
|
255204
|
+
/* harmony import */ var _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../curve/LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
255205
|
+
/* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
255206
|
+
/* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
255207
|
+
/* harmony import */ var _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../curve/ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
|
|
255208
|
+
/* harmony import */ var _curve_Path__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../curve/Path */ "../../core/geometry/lib/esm/curve/Path.js");
|
|
255209
|
+
/* harmony import */ var _curve_PointString3d__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../curve/PointString3d */ "../../core/geometry/lib/esm/curve/PointString3d.js");
|
|
255210
|
+
/* harmony import */ var _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../curve/spiral/DirectSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/DirectSpiral3d.js");
|
|
255211
|
+
/* harmony import */ var _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../curve/spiral/IntegratedSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/IntegratedSpiral3d.js");
|
|
255212
|
+
/* harmony import */ var _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../curve/spiral/TransitionSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/TransitionSpiral3d.js");
|
|
255213
|
+
/* harmony import */ var _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../curve/UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
|
|
255214
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
255215
|
+
/* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
|
|
255216
|
+
/* harmony import */ var _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../geometry3d/AngleSweep */ "../../core/geometry/lib/esm/geometry3d/AngleSweep.js");
|
|
255217
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
255218
|
+
/* harmony import */ var _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/PointHelpers */ "../../core/geometry/lib/esm/geometry3d/PointHelpers.js");
|
|
255219
|
+
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
255220
|
+
/* harmony import */ var _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../geometry3d/Segment1d */ "../../core/geometry/lib/esm/geometry3d/Segment1d.js");
|
|
255221
|
+
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
255222
|
+
/* harmony import */ var _polyface_AuxData__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../polyface/AuxData */ "../../core/geometry/lib/esm/polyface/AuxData.js");
|
|
255223
|
+
/* harmony import */ var _polyface_Polyface__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../polyface/Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
|
|
255224
|
+
/* harmony import */ var _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../polyface/TaggedNumericData */ "../../core/geometry/lib/esm/polyface/TaggedNumericData.js");
|
|
255225
|
+
/* harmony import */ var _solid_Box__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../solid/Box */ "../../core/geometry/lib/esm/solid/Box.js");
|
|
255226
|
+
/* harmony import */ var _solid_Cone__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../solid/Cone */ "../../core/geometry/lib/esm/solid/Cone.js");
|
|
255227
|
+
/* harmony import */ var _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../solid/LinearSweep */ "../../core/geometry/lib/esm/solid/LinearSweep.js");
|
|
255228
|
+
/* harmony import */ var _solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../solid/RotationalSweep */ "../../core/geometry/lib/esm/solid/RotationalSweep.js");
|
|
255229
|
+
/* harmony import */ var _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../solid/RuledSweep */ "../../core/geometry/lib/esm/solid/RuledSweep.js");
|
|
255230
|
+
/* harmony import */ var _solid_Sphere__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../solid/Sphere */ "../../core/geometry/lib/esm/solid/Sphere.js");
|
|
255231
|
+
/* harmony import */ var _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../solid/TorusPipe */ "../../core/geometry/lib/esm/solid/TorusPipe.js");
|
|
255232
|
+
/* harmony import */ var _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BGFBAccessors */ "../../core/geometry/lib/esm/serialization/BGFBAccessors.js");
|
|
255233
|
+
/* harmony import */ var _SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SerializationHelpers */ "../../core/geometry/lib/esm/serialization/SerializationHelpers.js");
|
|
255079
255234
|
/*---------------------------------------------------------------------------------------------
|
|
255080
255235
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
255081
255236
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -255117,6 +255272,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
255117
255272
|
|
|
255118
255273
|
|
|
255119
255274
|
|
|
255275
|
+
|
|
255120
255276
|
|
|
255121
255277
|
|
|
255122
255278
|
/** * Context to write to a flatbuffer blob.
|
|
@@ -255134,8 +255290,8 @@ class BGFBReader {
|
|
|
255134
255290
|
readBSplineSurfaceFromVariant(variantHeader) {
|
|
255135
255291
|
let newSurface;
|
|
255136
255292
|
const geometryType = variantHeader.geometryType();
|
|
255137
|
-
if (geometryType ===
|
|
255138
|
-
const bsurfHeader = variantHeader.geometry(new
|
|
255293
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagBsplineSurface) {
|
|
255294
|
+
const bsurfHeader = variantHeader.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.BsplineSurface());
|
|
255139
255295
|
if (bsurfHeader !== null) {
|
|
255140
255296
|
const orderU = bsurfHeader.orderU();
|
|
255141
255297
|
const orderV = bsurfHeader.orderV();
|
|
@@ -255148,23 +255304,23 @@ class BGFBReader {
|
|
|
255148
255304
|
const closedU = bsurfHeader.closedU();
|
|
255149
255305
|
const closedV = bsurfHeader.closedV();
|
|
255150
255306
|
if (xyzArray !== null && knotArrayU !== null && knotArrayV !== null) {
|
|
255151
|
-
const myData =
|
|
255307
|
+
const myData = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.createBSplineSurfaceData(xyzArray, 3, knotArrayU, numPolesU, orderU, knotArrayV, numPolesV, orderV);
|
|
255152
255308
|
if (weightArray !== null)
|
|
255153
255309
|
myData.weights = weightArray;
|
|
255154
255310
|
if (closedU)
|
|
255155
255311
|
myData.uParams.closed = true;
|
|
255156
255312
|
if (closedV)
|
|
255157
255313
|
myData.vParams.closed = true;
|
|
255158
|
-
if (
|
|
255314
|
+
if (_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.Import.prepareBSplineSurfaceData(myData, { jsonPoles: false })) {
|
|
255159
255315
|
if (undefined === myData.weights)
|
|
255160
|
-
newSurface =
|
|
255316
|
+
newSurface = _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_4__.BSplineSurface3d.create(myData.poles, myData.uParams.numPoles, myData.uParams.order, myData.uParams.knots, myData.vParams.numPoles, myData.vParams.order, myData.vParams.knots);
|
|
255161
255317
|
else
|
|
255162
|
-
newSurface =
|
|
255318
|
+
newSurface = _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_4__.BSplineSurface3dH.create(myData.poles, myData.weights, myData.uParams.numPoles, myData.uParams.order, myData.uParams.knots, myData.vParams.numPoles, myData.vParams.order, myData.vParams.knots);
|
|
255163
255319
|
if (undefined !== newSurface) {
|
|
255164
255320
|
if (undefined !== myData.uParams.wrapMode)
|
|
255165
|
-
newSurface.setWrappable(
|
|
255321
|
+
newSurface.setWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_4__.UVSelect.uDirection, myData.uParams.wrapMode);
|
|
255166
255322
|
if (undefined !== myData.vParams.wrapMode)
|
|
255167
|
-
newSurface.setWrappable(
|
|
255323
|
+
newSurface.setWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_4__.UVSelect.vDirection, myData.vParams.wrapMode);
|
|
255168
255324
|
}
|
|
255169
255325
|
}
|
|
255170
255326
|
}
|
|
@@ -255180,11 +255336,11 @@ class BGFBReader {
|
|
|
255180
255336
|
const xyzArray = header.fitPointsArray();
|
|
255181
255337
|
if (xyzArray instanceof Float64Array) {
|
|
255182
255338
|
const knots = header.knotsArray();
|
|
255183
|
-
const options = new
|
|
255339
|
+
const options = new _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_5__.InterpolationCurve3dOptions(_geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_6__.Point3dArray.clonePoint3dArray(xyzArray), knots ? _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_6__.NumberArray.create(knots) : undefined);
|
|
255184
255340
|
const startTangent = header.startTangent();
|
|
255185
255341
|
const endTangent = header.endTangent();
|
|
255186
|
-
options.captureOptionalProps(header.order(), header.closed(), header.isChordLenKnots(), header.isColinearTangents(), header.isChordLenTangents(), header.isNaturalTangents(), startTangent !== null ?
|
|
255187
|
-
return
|
|
255342
|
+
options.captureOptionalProps(header.order(), header.closed(), header.isChordLenKnots(), header.isColinearTangents(), header.isChordLenTangents(), header.isNaturalTangents(), startTangent !== null ? _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(startTangent.x(), startTangent.y(), startTangent.z()) : undefined, endTangent !== null ? _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(endTangent.x(), endTangent.y(), endTangent.z()) : undefined);
|
|
255343
|
+
return _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_5__.InterpolationCurve3d.createCapture(options);
|
|
255188
255344
|
}
|
|
255189
255345
|
return undefined;
|
|
255190
255346
|
}
|
|
@@ -255195,8 +255351,8 @@ class BGFBReader {
|
|
|
255195
255351
|
readAkimaCurve3d(header) {
|
|
255196
255352
|
const xyzArray = header.pointsArray();
|
|
255197
255353
|
if (xyzArray instanceof Float64Array) {
|
|
255198
|
-
const options = new
|
|
255199
|
-
return
|
|
255354
|
+
const options = new _bspline_AkimaCurve3d__WEBPACK_IMPORTED_MODULE_8__.AkimaCurve3dOptions(_geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_6__.Point3dArray.clonePoint3dArray(xyzArray));
|
|
255355
|
+
return _bspline_AkimaCurve3d__WEBPACK_IMPORTED_MODULE_8__.AkimaCurve3d.createCapture(options);
|
|
255200
255356
|
}
|
|
255201
255357
|
return undefined;
|
|
255202
255358
|
}
|
|
@@ -255213,17 +255369,17 @@ class BGFBReader {
|
|
|
255213
255369
|
const closed = header.closed();
|
|
255214
255370
|
if (xyzArray !== null && knots !== null) {
|
|
255215
255371
|
const numPoles = Math.floor(xyzArray.length / 3);
|
|
255216
|
-
const myData =
|
|
255372
|
+
const myData = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.createBSplineCurveData(xyzArray, 3, knots, numPoles, order);
|
|
255217
255373
|
if (closed)
|
|
255218
255374
|
myData.params.closed = true;
|
|
255219
255375
|
if (weightsArray === null) {
|
|
255220
|
-
if (
|
|
255221
|
-
newCurve =
|
|
255376
|
+
if (_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.Import.prepareBSplineCurveData(myData))
|
|
255377
|
+
newCurve = _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_9__.BSplineCurve3d.create(myData.poles, myData.params.knots, myData.params.order);
|
|
255222
255378
|
}
|
|
255223
255379
|
else {
|
|
255224
255380
|
myData.weights = weightsArray;
|
|
255225
|
-
if (
|
|
255226
|
-
newCurve =
|
|
255381
|
+
if (_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.Import.prepareBSplineCurveData(myData, { jsonPoles: false }))
|
|
255382
|
+
newCurve = _bspline_BSplineCurve3dH__WEBPACK_IMPORTED_MODULE_10__.BSplineCurve3dH.create({ xyz: myData.poles, weights: myData.weights }, myData.params.knots, myData.params.order);
|
|
255227
255383
|
}
|
|
255228
255384
|
if (undefined !== newCurve) {
|
|
255229
255385
|
if (undefined !== myData.params.wrapMode)
|
|
@@ -255247,17 +255403,17 @@ class BGFBReader {
|
|
|
255247
255403
|
const bearing0Radians = detailHeader.bearing0Radians();
|
|
255248
255404
|
const bearing1Radians = detailHeader.bearing1Radians();
|
|
255249
255405
|
const fbTransform = detailHeader.transform();
|
|
255250
|
-
const localToWorld = fbTransform ?
|
|
255251
|
-
|
|
255252
|
-
const activeFractionInterval =
|
|
255406
|
+
const localToWorld = fbTransform ? _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_11__.Transform.createRowValues(fbTransform.axx(), fbTransform.axy(), fbTransform.axz(), fbTransform.axw(), fbTransform.ayx(), fbTransform.ayy(), fbTransform.ayz(), fbTransform.ayw(), fbTransform.azx(), fbTransform.azy(), fbTransform.azz(), fbTransform.azw()) :
|
|
255407
|
+
_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_11__.Transform.createIdentity();
|
|
255408
|
+
const activeFractionInterval = _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_12__.Segment1d.create(detailHeader.fractionA(), detailHeader.fractionB());
|
|
255253
255409
|
if (!directDetailHeader) {
|
|
255254
|
-
const integratedSpiral =
|
|
255410
|
+
const integratedSpiral = _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_13__.IntegratedSpiral3d.createRadiusRadiusBearingBearing(_geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_12__.Segment1d.create(_curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_13__.IntegratedSpiral3d.curvatureToRadius(curvature0), _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_13__.IntegratedSpiral3d.curvatureToRadius(curvature1)), _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_14__.AngleSweep.createStartEndRadians(bearing0Radians, bearing1Radians), activeFractionInterval, localToWorld, spiralTypeName);
|
|
255255
255411
|
if (integratedSpiral)
|
|
255256
255412
|
return integratedSpiral;
|
|
255257
|
-
const radius0 =
|
|
255258
|
-
const radius1 =
|
|
255259
|
-
const arcLength =
|
|
255260
|
-
const directSpiral =
|
|
255413
|
+
const radius0 = _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_15__.TransitionSpiral3d.curvatureToRadius(curvature0);
|
|
255414
|
+
const radius1 = _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_15__.TransitionSpiral3d.curvatureToRadius(curvature1);
|
|
255415
|
+
const arcLength = _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_15__.TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(radius0, radius1, bearing1Radians - bearing0Radians);
|
|
255416
|
+
const directSpiral = _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_16__.DirectSpiral3d.createFromLengthAndRadius(spiralTypeName, radius0, radius1, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_17__.Angle.createRadians(bearing0Radians), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_17__.Angle.createRadians(bearing1Radians), arcLength, activeFractionInterval, localToWorld);
|
|
255261
255417
|
if (directSpiral)
|
|
255262
255418
|
return directSpiral;
|
|
255263
255419
|
}
|
|
@@ -255270,42 +255426,42 @@ class BGFBReader {
|
|
|
255270
255426
|
*/
|
|
255271
255427
|
readCurvePrimitiveFromVariant(variant) {
|
|
255272
255428
|
const geometryType = variant.geometryType();
|
|
255273
|
-
if (geometryType ===
|
|
255274
|
-
const offsetToLineSegment = variant.geometry(new
|
|
255429
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagLineSegment) {
|
|
255430
|
+
const offsetToLineSegment = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.LineSegment());
|
|
255275
255431
|
const offsetToCoordinates = offsetToLineSegment.segment();
|
|
255276
|
-
return
|
|
255432
|
+
return _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_18__.LineSegment3d.createXYZXYZ(offsetToCoordinates.point0X(), offsetToCoordinates.point0Y(), offsetToCoordinates.point0Z(), offsetToCoordinates.point1X(), offsetToCoordinates.point1Y(), offsetToCoordinates.point1Z());
|
|
255277
255433
|
}
|
|
255278
|
-
else if (geometryType ===
|
|
255279
|
-
const offsetToEllipticArc = variant.geometry(new
|
|
255434
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagEllipticArc) {
|
|
255435
|
+
const offsetToEllipticArc = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.EllipticArc());
|
|
255280
255436
|
const offsetToCoordinates = offsetToEllipticArc.arc();
|
|
255281
|
-
return
|
|
255437
|
+
return _curve_Arc3d__WEBPACK_IMPORTED_MODULE_19__.Arc3d.createXYZXYZXYZ(offsetToCoordinates.centerX(), offsetToCoordinates.centerY(), offsetToCoordinates.centerZ(), offsetToCoordinates.vector0X(), offsetToCoordinates.vector0Y(), offsetToCoordinates.vector0Z(), offsetToCoordinates.vector90X(), offsetToCoordinates.vector90Y(), offsetToCoordinates.vector90Z(), _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_14__.AngleSweep.createStartSweepRadians(offsetToCoordinates.startRadians(), offsetToCoordinates?.sweepRadians()));
|
|
255282
255438
|
}
|
|
255283
|
-
else if (geometryType ===
|
|
255284
|
-
const offsetToLineString = variant.geometry(new
|
|
255439
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagLineString) {
|
|
255440
|
+
const offsetToLineString = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.LineString());
|
|
255285
255441
|
const numCoordinates = offsetToLineString.pointsLength();
|
|
255286
|
-
const result =
|
|
255442
|
+
const result = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_20__.LineString3d.create();
|
|
255287
255443
|
for (let i = 0; i + 2 < numCoordinates; i += 3) {
|
|
255288
255444
|
result.packedPoints.pushXYZ(offsetToLineString.points(i), offsetToLineString.points(i + 1), offsetToLineString.points(i + 2));
|
|
255289
255445
|
}
|
|
255290
255446
|
return result;
|
|
255291
255447
|
}
|
|
255292
|
-
else if (geometryType ===
|
|
255293
|
-
const offsetToBCurve = variant.geometry(new
|
|
255448
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagBsplineCurve) {
|
|
255449
|
+
const offsetToBCurve = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.BsplineCurve());
|
|
255294
255450
|
if (offsetToBCurve !== null)
|
|
255295
255451
|
return this.readBSplineCurve(offsetToBCurve);
|
|
255296
255452
|
}
|
|
255297
|
-
else if (geometryType ===
|
|
255298
|
-
const offsetToTransitionSpiralTable = variant.geometry(new
|
|
255453
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagTransitionSpiral) {
|
|
255454
|
+
const offsetToTransitionSpiralTable = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.TransitionSpiral());
|
|
255299
255455
|
if (offsetToTransitionSpiralTable !== null)
|
|
255300
255456
|
return this.readTransitionSpiral(offsetToTransitionSpiralTable);
|
|
255301
255457
|
}
|
|
255302
|
-
else if (geometryType ===
|
|
255303
|
-
const offsetToInterpolationCurveTable = variant.geometry(new
|
|
255458
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagInterpolationCurve) {
|
|
255459
|
+
const offsetToInterpolationCurveTable = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.InterpolationCurve());
|
|
255304
255460
|
if (offsetToInterpolationCurveTable !== null)
|
|
255305
255461
|
return this.readInterpolationCurve3d(offsetToInterpolationCurveTable);
|
|
255306
255462
|
}
|
|
255307
|
-
else if (geometryType ===
|
|
255308
|
-
const offsetToAkimaCurveTable = variant.geometry(new
|
|
255463
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagAkimaCurve) {
|
|
255464
|
+
const offsetToAkimaCurveTable = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.AkimaCurve());
|
|
255309
255465
|
if (offsetToAkimaCurveTable !== null)
|
|
255310
255466
|
return this.readAkimaCurve3d(offsetToAkimaCurveTable);
|
|
255311
255467
|
}
|
|
@@ -255317,34 +255473,28 @@ class BGFBReader {
|
|
|
255317
255473
|
*/
|
|
255318
255474
|
readPointStringFromVariant(variant) {
|
|
255319
255475
|
const geometryType = variant.geometryType();
|
|
255320
|
-
if (geometryType ===
|
|
255321
|
-
const offsetToLineString = variant.geometry(new
|
|
255476
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagPointString) {
|
|
255477
|
+
const offsetToLineString = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.PointString());
|
|
255322
255478
|
const numCoordinates = offsetToLineString.pointsLength();
|
|
255323
|
-
const result =
|
|
255479
|
+
const result = _curve_PointString3d__WEBPACK_IMPORTED_MODULE_21__.PointString3d.create();
|
|
255324
255480
|
for (let i = 0; i + 2 < numCoordinates; i += 3) {
|
|
255325
|
-
result.points.push(
|
|
255481
|
+
result.points.push(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(offsetToLineString.points(i), offsetToLineString.points(i + 1), offsetToLineString.points(i + 2)));
|
|
255326
255482
|
}
|
|
255327
255483
|
return result;
|
|
255328
255484
|
}
|
|
255329
255485
|
return undefined;
|
|
255330
255486
|
}
|
|
255331
|
-
/**
|
|
255332
|
-
* Extract auxData for a mesh
|
|
255333
|
-
* @param variant read position in the flat buffer.
|
|
255334
|
-
*/
|
|
255487
|
+
/** Extract auxData channel data for a mesh */
|
|
255335
255488
|
readPolyfaceAuxChannelData(channelDataHeader) {
|
|
255336
255489
|
if (channelDataHeader !== null) {
|
|
255337
255490
|
const input = channelDataHeader.input();
|
|
255338
255491
|
const values = channelDataHeader.valuesArray();
|
|
255339
255492
|
if (values !== null)
|
|
255340
|
-
return new
|
|
255493
|
+
return new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_22__.AuxChannelData(input, values);
|
|
255341
255494
|
}
|
|
255342
255495
|
return undefined;
|
|
255343
255496
|
}
|
|
255344
|
-
/**
|
|
255345
|
-
* Extract auxData for a mesh
|
|
255346
|
-
* @param variant read position in the flat buffer.
|
|
255347
|
-
*/
|
|
255497
|
+
/** Extract auxData channel for a mesh */
|
|
255348
255498
|
readPolyfaceAuxChannel(channelHeader) {
|
|
255349
255499
|
if (channelHeader) {
|
|
255350
255500
|
const dataType = channelHeader.dataType();
|
|
@@ -255357,43 +255507,107 @@ class BGFBReader {
|
|
|
255357
255507
|
if (channelData)
|
|
255358
255508
|
channelDataArray.push(channelData);
|
|
255359
255509
|
}
|
|
255360
|
-
return new
|
|
255510
|
+
return new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_22__.AuxChannel(channelDataArray, dataType, name ? name : undefined, inputName ? inputName : undefined);
|
|
255361
255511
|
}
|
|
255362
255512
|
return undefined;
|
|
255363
255513
|
}
|
|
255364
|
-
/**
|
|
255365
|
-
|
|
255366
|
-
|
|
255367
|
-
|
|
255368
|
-
|
|
255369
|
-
if (
|
|
255370
|
-
|
|
255371
|
-
|
|
255372
|
-
|
|
255373
|
-
|
|
255374
|
-
|
|
255375
|
-
|
|
255376
|
-
|
|
255377
|
-
|
|
255378
|
-
|
|
255379
|
-
|
|
255380
|
-
|
|
255381
|
-
|
|
255382
|
-
|
|
255383
|
-
|
|
255384
|
-
|
|
255385
|
-
|
|
255386
|
-
|
|
255514
|
+
/** Compute the number of logical entries in every flat data array in the AuxData */
|
|
255515
|
+
static channelDataLength(fbAuxData) {
|
|
255516
|
+
if (fbAuxData.channelsLength() <= 0)
|
|
255517
|
+
return 0;
|
|
255518
|
+
const fbChannel0 = nullToUndefined(fbAuxData.channels(0));
|
|
255519
|
+
if (!fbChannel0)
|
|
255520
|
+
return 0;
|
|
255521
|
+
const numChannel0Data = fbChannel0.dataLength();
|
|
255522
|
+
if (numChannel0Data <= 0)
|
|
255523
|
+
return 0;
|
|
255524
|
+
const fbChannel0Data0 = nullToUndefined(fbChannel0.data(0));
|
|
255525
|
+
if (!fbChannel0Data0)
|
|
255526
|
+
return 0;
|
|
255527
|
+
const numChannelDataValues = fbChannel0Data0.valuesLength();
|
|
255528
|
+
if (numChannelDataValues <= 0)
|
|
255529
|
+
return 0;
|
|
255530
|
+
return numChannelDataValues / _polyface_AuxData__WEBPACK_IMPORTED_MODULE_22__.AuxChannel.entriesPerValue(fbChannel0.dataType());
|
|
255531
|
+
}
|
|
255532
|
+
/** Examine int array for range and zero count */
|
|
255533
|
+
countIntArray(ints) {
|
|
255534
|
+
let min = Infinity;
|
|
255535
|
+
let max = -Infinity;
|
|
255536
|
+
let numZeroes = 0;
|
|
255537
|
+
for (const i of ints) {
|
|
255538
|
+
if (min > i)
|
|
255539
|
+
min = i;
|
|
255540
|
+
if (max < i)
|
|
255541
|
+
max = i;
|
|
255542
|
+
if (0 === i)
|
|
255543
|
+
++numZeroes;
|
|
255544
|
+
}
|
|
255545
|
+
return { min, max, numZeroes };
|
|
255546
|
+
}
|
|
255547
|
+
/**
|
|
255548
|
+
* Extract auxData for a mesh.
|
|
255549
|
+
* Typescript object format for Polyface/PolyfaceAuxData indices is 0-based, unterminated.
|
|
255550
|
+
* FlatBuffer format for Polyface/PolyfaceAuxData indices is 1-based, 0-terminated/padded.
|
|
255551
|
+
* Typescript API previously wrote FlatBuffer PolyfaceAuxData indices as 0-based, unterminated;
|
|
255552
|
+
* heuristics are used herein to identify this legacy format so it can still be read.
|
|
255553
|
+
*/
|
|
255554
|
+
readPolyfaceAuxData(fbPolyface, fbAuxData) {
|
|
255555
|
+
if (!fbPolyface || !fbAuxData)
|
|
255556
|
+
return undefined;
|
|
255557
|
+
const fbPointIndices = nullToUndefined(fbPolyface.pointIndexArray());
|
|
255558
|
+
const fbAuxIndices = nullToUndefined(fbAuxData.indicesArray());
|
|
255559
|
+
const numChannels = fbAuxData.channelsLength();
|
|
255560
|
+
const fbNumData = BGFBReader.channelDataLength(fbAuxData);
|
|
255561
|
+
if (!fbPointIndices || !fbPointIndices.length || !fbAuxIndices || !fbAuxIndices.length || numChannels <= 0 || fbNumData <= 0)
|
|
255562
|
+
return undefined;
|
|
255563
|
+
const numPerFace = fbPolyface.numPerFace();
|
|
255564
|
+
// HEURISTICS to detect legacy AuxData indices, previously mistakenly serialized by BGFBWriter.writePolyfaceAsFBVariantGeometry as 0-based unblocked indices
|
|
255565
|
+
let isLegacy = false;
|
|
255566
|
+
const pointIndicesPadCount = fbPointIndices.filter((index) => index === 0).length;
|
|
255567
|
+
if (numPerFace > 1) {
|
|
255568
|
+
const auxIndexCounts = this.countIntArray(fbAuxIndices);
|
|
255569
|
+
if (auxIndexCounts.max > fbNumData) // auxIndices invalid
|
|
255570
|
+
return undefined;
|
|
255571
|
+
if (auxIndexCounts.max === fbNumData) // auxIndices 1-based
|
|
255572
|
+
isLegacy = false;
|
|
255573
|
+
else if (auxIndexCounts.max <= 0 || auxIndexCounts.min < 0) // auxIndices 1-based (signed)
|
|
255574
|
+
isLegacy = false;
|
|
255575
|
+
else if (auxIndexCounts.min === 0) // auxIndices likely legacy 0-based index, but could be modern with padding
|
|
255576
|
+
isLegacy = pointIndicesPadCount !== auxIndexCounts.numZeroes;
|
|
255577
|
+
else if (auxIndexCounts.min > 0) // auxIndices likely modern without padding, but could be legacy if first datum not indexed
|
|
255578
|
+
isLegacy = pointIndicesPadCount > 0;
|
|
255387
255579
|
}
|
|
255388
|
-
|
|
255580
|
+
else {
|
|
255581
|
+
isLegacy = (fbAuxIndices.length < fbPointIndices.length) && (fbAuxIndices.length + pointIndicesPadCount === fbPointIndices.length);
|
|
255582
|
+
}
|
|
255583
|
+
if (!isLegacy && fbAuxIndices.length !== fbPointIndices.length)
|
|
255584
|
+
return undefined; // auxIndices invalid
|
|
255585
|
+
const indices = [];
|
|
255586
|
+
if (isLegacy)
|
|
255587
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesWithExternalBlocking(fbAuxIndices, fbPointIndices, numPerFace, (i0) => { indices.push(i0); });
|
|
255588
|
+
else
|
|
255589
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(fbAuxIndices, numPerFace, (i0) => { indices.push(i0); });
|
|
255590
|
+
if (indices.length + pointIndicesPadCount !== fbPointIndices.length)
|
|
255591
|
+
return undefined;
|
|
255592
|
+
const maxIndex = Math.max(...indices);
|
|
255593
|
+
const channels = [];
|
|
255594
|
+
for (let i = 0; i < numChannels; i++) {
|
|
255595
|
+
const channelHeader = fbAuxData.channels(i);
|
|
255596
|
+
const channelContent = this.readPolyfaceAuxChannel(channelHeader);
|
|
255597
|
+
if (channelContent) {
|
|
255598
|
+
if (maxIndex >= channelContent.valueCount)
|
|
255599
|
+
return undefined; // invalid index
|
|
255600
|
+
channels.push(channelContent);
|
|
255601
|
+
}
|
|
255602
|
+
}
|
|
255603
|
+
if (!channels.length)
|
|
255604
|
+
return undefined;
|
|
255605
|
+
return new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_22__.PolyfaceAuxData(channels, indices);
|
|
255389
255606
|
}
|
|
255390
|
-
/**
|
|
255391
|
-
* Extract auxData for a mesh
|
|
255392
|
-
* @param variant read position in the flat buffer.
|
|
255393
|
-
*/
|
|
255607
|
+
/** Extract tagged numeric data for a mesh */
|
|
255394
255608
|
readTaggedNumericData(accessor) {
|
|
255395
255609
|
if (accessor) {
|
|
255396
|
-
const taggedNumericData = new
|
|
255610
|
+
const taggedNumericData = new _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_23__.TaggedNumericData(accessor.tagA(), accessor.tagB());
|
|
255397
255611
|
const intDataArray = nullToUndefined(accessor.intDataArray());
|
|
255398
255612
|
const doubleDataArray = nullToUndefined(accessor.doubleDataArray());
|
|
255399
255613
|
if (intDataArray) {
|
|
@@ -255411,13 +255625,13 @@ class BGFBReader {
|
|
|
255411
255625
|
return undefined;
|
|
255412
255626
|
}
|
|
255413
255627
|
/**
|
|
255414
|
-
|
|
255415
|
-
|
|
255416
|
-
|
|
255628
|
+
* Extract a mesh
|
|
255629
|
+
* @param variant read position in the flat buffer.
|
|
255630
|
+
*/
|
|
255417
255631
|
readPolyfaceFromVariant(variant) {
|
|
255418
255632
|
const geometryType = variant.geometryType();
|
|
255419
|
-
if (geometryType ===
|
|
255420
|
-
const polyfaceHeader = variant.geometry(new
|
|
255633
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagPolyface) {
|
|
255634
|
+
const polyfaceHeader = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.Polyface());
|
|
255421
255635
|
if (polyfaceHeader) {
|
|
255422
255636
|
const twoSided = polyfaceHeader.twoSided();
|
|
255423
255637
|
const expectedClosure = polyfaceHeader.expectedClosure();
|
|
@@ -255432,59 +255646,35 @@ class BGFBReader {
|
|
|
255432
255646
|
const normalIndexI32 = nullToUndefined(polyfaceHeader.normalIndexArray());
|
|
255433
255647
|
const colorIndexI32 = nullToUndefined(polyfaceHeader.colorIndexArray());
|
|
255434
255648
|
const taggedNumericDataOffset = polyfaceHeader.taggedNumericData();
|
|
255649
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_1__.assert)(meshStyle === 1, "Unrecognized flatbuffer mesh style");
|
|
255650
|
+
// The flatbuffer data is one based.
|
|
255651
|
+
// If numPerFace is less than 2, facets are variable size and zero terminated
|
|
255652
|
+
// If numPerFace is 2 or more, indices are blocked
|
|
255435
255653
|
if (meshStyle === 1 && pointF64 && pointIndexI32) {
|
|
255436
|
-
const polyface =
|
|
255654
|
+
const polyface = _polyface_Polyface__WEBPACK_IMPORTED_MODULE_24__.IndexedPolyface.create();
|
|
255655
|
+
polyface.twoSided = twoSided;
|
|
255437
255656
|
polyface.expectedClosure = expectedClosure;
|
|
255438
|
-
|
|
255439
|
-
|
|
255440
|
-
|
|
255441
|
-
|
|
255442
|
-
polyface.data.param.pushXY(paramF64[i], paramF64[i + 1]);
|
|
255657
|
+
if (normalF64 && normalIndexI32) {
|
|
255658
|
+
for (let i = 0; i + 2 < normalF64.length; i += 3)
|
|
255659
|
+
polyface.addNormalXYZ(normalF64[i], normalF64[i + 1], normalF64[i + 2]);
|
|
255660
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(normalIndexI32, numPerFace, (i) => { polyface.addNormalIndex(i); });
|
|
255443
255661
|
}
|
|
255444
|
-
if (
|
|
255445
|
-
for (let i = 0; i +
|
|
255446
|
-
polyface.
|
|
255662
|
+
if (paramF64 && paramIndexI32) {
|
|
255663
|
+
for (let i = 0; i + 1 < paramF64.length; i += 2)
|
|
255664
|
+
polyface.addParamUV(paramF64[i], paramF64[i + 1]);
|
|
255665
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(paramIndexI32, numPerFace, (i) => { polyface.addParamIndex(i); });
|
|
255447
255666
|
}
|
|
255448
|
-
if (intColorU32) {
|
|
255667
|
+
if (intColorU32 && colorIndexI32) {
|
|
255449
255668
|
for (const c of intColorU32)
|
|
255450
|
-
polyface.
|
|
255669
|
+
polyface.addColor(c);
|
|
255670
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(colorIndexI32, numPerFace, (i) => { polyface.addColorIndex(i); });
|
|
255451
255671
|
}
|
|
255452
|
-
|
|
255453
|
-
|
|
255454
|
-
|
|
255455
|
-
|
|
255456
|
-
|
|
255457
|
-
|
|
255458
|
-
const q = pointIndexI32[k];
|
|
255459
|
-
polyface.addPointIndex(Math.abs(q) - 1, q > 0);
|
|
255460
|
-
if (normalF64 && normalIndexI32) {
|
|
255461
|
-
polyface.addNormalIndex(Math.abs(normalIndexI32[k]) - 1);
|
|
255462
|
-
}
|
|
255463
|
-
if (paramF64 && paramIndexI32) {
|
|
255464
|
-
polyface.addParamIndex(Math.abs(paramIndexI32[k]) - 1);
|
|
255465
|
-
}
|
|
255466
|
-
if (intColorU32 && colorIndexI32) {
|
|
255467
|
-
polyface.addColorIndex(Math.abs(colorIndexI32[k]) - 1);
|
|
255468
|
-
}
|
|
255469
|
-
}
|
|
255470
|
-
};
|
|
255471
|
-
if (numPerFace > 1) {
|
|
255472
|
-
for (let i0 = 0; i0 + numPerFace <= numIndex; i0 += numPerFace) {
|
|
255473
|
-
addIndicesInBlock(i0, i0 + numPerFace);
|
|
255474
|
-
polyface.terminateFacet(true);
|
|
255475
|
-
}
|
|
255476
|
-
}
|
|
255477
|
-
else {
|
|
255478
|
-
let i0 = 0;
|
|
255479
|
-
for (let i1 = i0; i1 < numIndex; i1++) {
|
|
255480
|
-
if (pointIndexI32[i1] === 0) {
|
|
255481
|
-
addIndicesInBlock(i0, i1);
|
|
255482
|
-
polyface.terminateFacet(true);
|
|
255483
|
-
i0 = i1 + 1;
|
|
255484
|
-
}
|
|
255485
|
-
}
|
|
255486
|
-
}
|
|
255487
|
-
polyface.data.auxData = this.readPolyfaceAuxData(polyfaceHeader.auxData());
|
|
255672
|
+
for (let i = 0; i + 2 < pointF64.length; i += 3)
|
|
255673
|
+
polyface.addPointXYZ(pointF64[i], pointF64[i + 1], pointF64[i + 2]);
|
|
255674
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(pointIndexI32, numPerFace, (i, v) => { polyface.addPointIndex(i, v); }, () => { polyface.terminateFacet(false); });
|
|
255675
|
+
if (!polyface.validateAllIndices())
|
|
255676
|
+
return undefined;
|
|
255677
|
+
polyface.data.auxData = this.readPolyfaceAuxData(polyfaceHeader, polyfaceHeader.auxData());
|
|
255488
255678
|
if (taggedNumericDataOffset) {
|
|
255489
255679
|
const taggedNumericDataAccessor = nullToUndefined(taggedNumericDataOffset);
|
|
255490
255680
|
if (taggedNumericDataAccessor !== undefined) {
|
|
@@ -255524,8 +255714,8 @@ class BGFBReader {
|
|
|
255524
255714
|
*/
|
|
255525
255715
|
readCurveCollectionFromVariantGeometry(variant) {
|
|
255526
255716
|
const geometryType = variant.geometryType();
|
|
255527
|
-
if (geometryType ===
|
|
255528
|
-
const cvTable = variant.geometry(new
|
|
255717
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagCurveVector) {
|
|
255718
|
+
const cvTable = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.CurveVector());
|
|
255529
255719
|
return this.readCurveCollectionFromCurveVectorTable(cvTable);
|
|
255530
255720
|
}
|
|
255531
255721
|
return undefined;
|
|
@@ -255536,66 +255726,66 @@ class BGFBReader {
|
|
|
255536
255726
|
*/
|
|
255537
255727
|
readSolidPrimitiveFromVariant(variant) {
|
|
255538
255728
|
const geometryType = variant.geometryType();
|
|
255539
|
-
if (geometryType ===
|
|
255540
|
-
const header = variant.geometry(new
|
|
255729
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnBox) {
|
|
255730
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnBox());
|
|
255541
255731
|
const detail = header.detail();
|
|
255542
|
-
return
|
|
255732
|
+
return _solid_Box__WEBPACK_IMPORTED_MODULE_25__.Box.createDgnBox(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(detail.baseOriginX(), detail.baseOriginY(), detail.baseOriginZ()), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(detail.vectorXX(), detail.vectorXY(), detail.vectorXZ()), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(detail.vectorYX(), detail.vectorYY(), detail.vectorYZ()), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(detail.topOriginX(), detail.topOriginY(), detail.topOriginZ()), detail.baseX(), detail.baseY(), detail.topX(), detail.topY(), detail.capped());
|
|
255543
255733
|
}
|
|
255544
|
-
if (geometryType ===
|
|
255545
|
-
const header = variant.geometry(new
|
|
255734
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnSphere) {
|
|
255735
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnSphere());
|
|
255546
255736
|
const detail = header.detail();
|
|
255547
255737
|
const lToWDetail = detail.localToWorld();
|
|
255548
|
-
const localToWorld =
|
|
255549
|
-
return
|
|
255738
|
+
const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_11__.Transform.createRowValues(lToWDetail.axx(), lToWDetail.axy(), lToWDetail.axz(), lToWDetail.axw(), lToWDetail.ayx(), lToWDetail.ayy(), lToWDetail.ayz(), lToWDetail.ayw(), lToWDetail.azx(), lToWDetail.azy(), lToWDetail.azz(), lToWDetail.azw());
|
|
255739
|
+
return _solid_Sphere__WEBPACK_IMPORTED_MODULE_26__.Sphere.createEllipsoid(localToWorld, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_14__.AngleSweep.createStartSweepRadians(detail.startLatitudeRadians(), detail.latitudeSweepRadians()), detail.capped());
|
|
255550
255740
|
}
|
|
255551
|
-
if (geometryType ===
|
|
255552
|
-
const header = variant.geometry(new
|
|
255741
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnCone) {
|
|
255742
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnCone());
|
|
255553
255743
|
const detail = header.detail();
|
|
255554
|
-
const centerA =
|
|
255555
|
-
const centerB =
|
|
255556
|
-
const vector0 =
|
|
255557
|
-
const vector90 =
|
|
255744
|
+
const centerA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(detail.centerAX(), detail.centerAY(), detail.centerAZ());
|
|
255745
|
+
const centerB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(detail.centerBX(), detail.centerBY(), detail.centerBZ());
|
|
255746
|
+
const vector0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(detail.vector0X(), detail.vector0Y(), detail.vector0Z());
|
|
255747
|
+
const vector90 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(detail.vector90X(), detail.vector90Y(), detail.vector90Z());
|
|
255558
255748
|
const radiusA = detail.radiusA();
|
|
255559
255749
|
const radiusB = detail.radiusB();
|
|
255560
|
-
return
|
|
255750
|
+
return _solid_Cone__WEBPACK_IMPORTED_MODULE_27__.Cone.createBaseAndTarget(centerA, centerB, vector0, vector90, radiusA, radiusB, detail.capped());
|
|
255561
255751
|
}
|
|
255562
|
-
if (geometryType ===
|
|
255563
|
-
const header = variant.geometry(new
|
|
255752
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnTorusPipe) {
|
|
255753
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnTorusPipe());
|
|
255564
255754
|
const detail = header.detail();
|
|
255565
|
-
const center =
|
|
255566
|
-
const vectorX =
|
|
255567
|
-
const vectorY =
|
|
255755
|
+
const center = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(detail.centerX(), detail.centerY(), detail.centerZ());
|
|
255756
|
+
const vectorX = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(detail.vectorXX(), detail.vectorXY(), detail.vectorXZ());
|
|
255757
|
+
const vectorY = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(detail.vectorYX(), detail.vectorYY(), detail.vectorYZ());
|
|
255568
255758
|
const sweepRadians = detail.sweepRadians();
|
|
255569
255759
|
const majorRadius = detail.majorRadius();
|
|
255570
255760
|
const minorRadius = detail.minorRadius();
|
|
255571
|
-
return
|
|
255761
|
+
return _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_28__.TorusPipe.createDgnTorusPipe(center, vectorX, vectorY, majorRadius, minorRadius, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_17__.Angle.createRadians(sweepRadians), detail.capped());
|
|
255572
255762
|
}
|
|
255573
|
-
if (geometryType ===
|
|
255574
|
-
const header = variant.geometry(new
|
|
255575
|
-
const dVector = new
|
|
255763
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnExtrusion) {
|
|
255764
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnExtrusion());
|
|
255765
|
+
const dVector = new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DVector3d();
|
|
255576
255766
|
header.extrusionVector(dVector);
|
|
255577
|
-
const extrusionVector =
|
|
255767
|
+
const extrusionVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(dVector.x(), dVector.y(), dVector.z());
|
|
255578
255768
|
const baseCurve = header.baseCurve();
|
|
255579
255769
|
if (baseCurve !== null) {
|
|
255580
255770
|
const contour = this.readCurveCollectionFromCurveVectorTable(baseCurve);
|
|
255581
|
-
return
|
|
255771
|
+
return _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_29__.LinearSweep.create(contour, extrusionVector, header.capped());
|
|
255582
255772
|
}
|
|
255583
255773
|
}
|
|
255584
|
-
if (geometryType ===
|
|
255585
|
-
const header = variant.geometry(new
|
|
255586
|
-
const dAxis = new
|
|
255774
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnRotationalSweep) {
|
|
255775
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnRotationalSweep());
|
|
255776
|
+
const dAxis = new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DRay3d();
|
|
255587
255777
|
header.axis(dAxis);
|
|
255588
|
-
const axis =
|
|
255589
|
-
const sweepAngle =
|
|
255778
|
+
const axis = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_30__.Ray3d.createXYZUVW(dAxis.x(), dAxis.y(), dAxis.z(), dAxis.ux(), dAxis.uy(), dAxis.uz());
|
|
255779
|
+
const sweepAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_17__.Angle.createRadians(header.sweepRadians());
|
|
255590
255780
|
// const numVRules = header.numVRules();
|
|
255591
255781
|
const baseCurve = header.baseCurve();
|
|
255592
255782
|
if (baseCurve !== null) {
|
|
255593
255783
|
const contour = this.readCurveCollectionFromCurveVectorTable(baseCurve);
|
|
255594
|
-
return
|
|
255784
|
+
return _solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_31__.RotationalSweep.create(contour, axis, sweepAngle, header.capped());
|
|
255595
255785
|
}
|
|
255596
255786
|
}
|
|
255597
|
-
if (geometryType ===
|
|
255598
|
-
const header = variant.geometry(new
|
|
255787
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnRuledSweep) {
|
|
255788
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnRuledSweep());
|
|
255599
255789
|
const numCurves = header.curvesLength();
|
|
255600
255790
|
const contours = [];
|
|
255601
255791
|
for (let i = 0; i < numCurves; i++) {
|
|
@@ -255607,7 +255797,7 @@ class BGFBReader {
|
|
|
255607
255797
|
}
|
|
255608
255798
|
}
|
|
255609
255799
|
if (contours.length > 0) {
|
|
255610
|
-
return
|
|
255800
|
+
return _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_32__.RuledSweep.create(contours, header.capped());
|
|
255611
255801
|
}
|
|
255612
255802
|
}
|
|
255613
255803
|
return undefined;
|
|
@@ -255619,43 +255809,43 @@ class BGFBReader {
|
|
|
255619
255809
|
readGeometryQueryFromVariant(variant) {
|
|
255620
255810
|
const rootType = variant.geometryType();
|
|
255621
255811
|
switch (rootType) {
|
|
255622
|
-
case
|
|
255623
|
-
case
|
|
255624
|
-
case
|
|
255625
|
-
case
|
|
255626
|
-
case
|
|
255627
|
-
case
|
|
255628
|
-
case
|
|
255812
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagLineSegment:
|
|
255813
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagLineString:
|
|
255814
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagEllipticArc:
|
|
255815
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagBsplineCurve:
|
|
255816
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagTransitionSpiral:
|
|
255817
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagInterpolationCurve:
|
|
255818
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagAkimaCurve:
|
|
255629
255819
|
{
|
|
255630
255820
|
return this.readCurvePrimitiveFromVariant(variant);
|
|
255631
255821
|
}
|
|
255632
|
-
case
|
|
255822
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagCurveVector:
|
|
255633
255823
|
{
|
|
255634
255824
|
return this.readCurveCollectionFromVariantGeometry(variant);
|
|
255635
255825
|
}
|
|
255636
|
-
case
|
|
255826
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagPolyface:
|
|
255637
255827
|
{
|
|
255638
255828
|
return this.readPolyfaceFromVariant(variant);
|
|
255639
255829
|
}
|
|
255640
|
-
case
|
|
255641
|
-
case
|
|
255642
|
-
case
|
|
255643
|
-
case
|
|
255644
|
-
case
|
|
255645
|
-
case
|
|
255646
|
-
case
|
|
255830
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnBox:
|
|
255831
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnCone:
|
|
255832
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnTorusPipe:
|
|
255833
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnSphere:
|
|
255834
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnExtrusion:
|
|
255835
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnRotationalSweep:
|
|
255836
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnRuledSweep:
|
|
255647
255837
|
{
|
|
255648
255838
|
return this.readSolidPrimitiveFromVariant(variant);
|
|
255649
255839
|
}
|
|
255650
|
-
case
|
|
255840
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagVectorOfVariantGeometry:
|
|
255651
255841
|
{
|
|
255652
255842
|
const geometry = [];
|
|
255653
|
-
const offsetToVectorOfVariantGeometry = variant.geometry(new
|
|
255843
|
+
const offsetToVectorOfVariantGeometry = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VectorOfVariantGeometry());
|
|
255654
255844
|
for (let i = 0; i < offsetToVectorOfVariantGeometry.membersLength(); i++) {
|
|
255655
255845
|
const child = offsetToVectorOfVariantGeometry.members(i);
|
|
255656
255846
|
if (child !== null) {
|
|
255657
255847
|
const childGeometry = this.readGeometryQueryFromVariant(child);
|
|
255658
|
-
if (childGeometry instanceof
|
|
255848
|
+
if (childGeometry instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_33__.GeometryQuery) {
|
|
255659
255849
|
geometry.push(childGeometry);
|
|
255660
255850
|
}
|
|
255661
255851
|
else if (Array.isArray(childGeometry)) {
|
|
@@ -255665,10 +255855,10 @@ class BGFBReader {
|
|
|
255665
255855
|
}
|
|
255666
255856
|
return geometry;
|
|
255667
255857
|
}
|
|
255668
|
-
case
|
|
255858
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagBsplineSurface: {
|
|
255669
255859
|
return this.readBSplineSurfaceFromVariant(variant);
|
|
255670
255860
|
}
|
|
255671
|
-
case
|
|
255861
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagPointString:
|
|
255672
255862
|
{
|
|
255673
255863
|
return this.readPointStringFromVariant(variant);
|
|
255674
255864
|
}
|
|
@@ -255689,7 +255879,7 @@ class BGFBReader {
|
|
|
255689
255879
|
return undefined;
|
|
255690
255880
|
newByteBuffer.setPosition(signature.length);
|
|
255691
255881
|
}
|
|
255692
|
-
const root =
|
|
255882
|
+
const root = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometry.getRootAsVariantGeometry(newByteBuffer);
|
|
255693
255883
|
const reader = new BGFBReader();
|
|
255694
255884
|
return reader.readGeometryQueryFromVariant(root);
|
|
255695
255885
|
}
|
|
@@ -255705,14 +255895,14 @@ function nullToUndefined(data) {
|
|
|
255705
255895
|
}
|
|
255706
255896
|
function createTypedCurveCollection(collectionType) {
|
|
255707
255897
|
if (collectionType === 1)
|
|
255708
|
-
return new
|
|
255898
|
+
return new _curve_Path__WEBPACK_IMPORTED_MODULE_34__.Path();
|
|
255709
255899
|
if (collectionType === 2 || collectionType === 3)
|
|
255710
|
-
return new
|
|
255900
|
+
return new _curve_Loop__WEBPACK_IMPORTED_MODULE_35__.Loop();
|
|
255711
255901
|
if (collectionType === 4)
|
|
255712
|
-
return new
|
|
255902
|
+
return new _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_36__.ParityRegion();
|
|
255713
255903
|
if (collectionType === 5)
|
|
255714
|
-
return new
|
|
255715
|
-
return new
|
|
255904
|
+
return new _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_37__.UnionRegion();
|
|
255905
|
+
return new _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_38__.BagOfCurves();
|
|
255716
255906
|
}
|
|
255717
255907
|
/**
|
|
255718
255908
|
* mappings between typescript spiral type strings and native integers.
|
|
@@ -255730,7 +255920,7 @@ class DgnSpiralTypeQueries {
|
|
|
255730
255920
|
/** Convert typescript string to native integer type */
|
|
255731
255921
|
static stringToTypeCode(s, defaultToClothoid = true) {
|
|
255732
255922
|
for (const entry of DgnSpiralTypeQueries.spiralTypeCodeMap) {
|
|
255733
|
-
if (
|
|
255923
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_39__.Geometry.equalStringNoCase(s, entry[1]))
|
|
255734
255924
|
return entry[0];
|
|
255735
255925
|
}
|
|
255736
255926
|
return defaultToClothoid ? 10 : undefined;
|
|
@@ -256234,14 +256424,15 @@ class BGFBWriter {
|
|
|
256234
256424
|
}
|
|
256235
256425
|
return undefined;
|
|
256236
256426
|
}
|
|
256237
|
-
writePolyfaceAuxDataAsFBVariantGeometry(data) {
|
|
256427
|
+
writePolyfaceAuxDataAsFBVariantGeometry(mesh, data) {
|
|
256238
256428
|
if (data instanceof _polyface_AuxData__WEBPACK_IMPORTED_MODULE_31__.PolyfaceAuxData) {
|
|
256239
256429
|
const channelOffsets = [];
|
|
256240
|
-
for (const channel of data.channels)
|
|
256430
|
+
for (const channel of data.channels)
|
|
256241
256431
|
channelOffsets.push(this.writePolyfaceAuxChannelAsFBVariantGeometry(channel));
|
|
256242
|
-
}
|
|
256243
256432
|
const channelOffsetsOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.PolyfaceAuxChannel.createDataVector(this.builder, channelOffsets);
|
|
256244
|
-
const
|
|
256433
|
+
const indexArray = [];
|
|
256434
|
+
this.fillOneBasedIndexArray(mesh, data.indices, undefined, 0, indexArray);
|
|
256435
|
+
const indicesOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.PolyfaceAuxData.createIndicesVector(this.builder, indexArray);
|
|
256245
256436
|
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.PolyfaceAuxData.createPolyfaceAuxData(this.builder, indicesOffset, channelOffsetsOffset);
|
|
256246
256437
|
}
|
|
256247
256438
|
return undefined;
|
|
@@ -256269,8 +256460,8 @@ class BGFBWriter {
|
|
|
256269
256460
|
let paramOffset = 0;
|
|
256270
256461
|
let auxDataOffset = 0;
|
|
256271
256462
|
let taggedNumericDataOffset = 0;
|
|
256272
|
-
const meshStyle = 1; // That is . . . MESH_ELM_STYLE_INDEXED_FACE_LOOPS
|
|
256273
|
-
const numPerFace = 0;
|
|
256463
|
+
const meshStyle = 1; // That is . . . MESH_ELM_STYLE_INDEXED_FACE_LOOPS
|
|
256464
|
+
const numPerFace = 0; // specifically, variable size with 0 terminators
|
|
256274
256465
|
this.fillOneBasedIndexArray(mesh, mesh.data.pointIndex, mesh.data.edgeVisible, 0, indexArray);
|
|
256275
256466
|
const twoSided = mesh.twoSided;
|
|
256276
256467
|
const pointIndexOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.Polyface.createPointIndexVector(this.builder, indexArray);
|
|
@@ -256289,12 +256480,6 @@ class BGFBWriter {
|
|
|
256289
256480
|
if (mesh.data.color !== undefined && mesh.data.color.length > 0) {
|
|
256290
256481
|
intColorOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.Polyface.createIntColorVector(this.builder, mesh.data.color);
|
|
256291
256482
|
}
|
|
256292
|
-
/*
|
|
256293
|
-
if (mesh.data.face !== undefined && mesh.data.face.length > 0) {
|
|
256294
|
-
this.writeOneBasedIndexArray(mesh, mesh.data.face, undefined, 0, indexArray);
|
|
256295
|
-
BGFBAccessors.Polyface.createFaceDataVector(this.builder, indexArray);
|
|
256296
|
-
}
|
|
256297
|
-
*/
|
|
256298
256483
|
if (mesh.data.normal) {
|
|
256299
256484
|
copyToPackedNumberArray(numberArray, mesh.data.normal.float64Data(), mesh.data.normal.float64Length);
|
|
256300
256485
|
normalOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.Polyface.createNormalVector(this.builder, numberArray);
|
|
@@ -256303,12 +256488,12 @@ class BGFBWriter {
|
|
|
256303
256488
|
copyToPackedNumberArray(numberArray, mesh.data.param.float64Data(), mesh.data.param.float64Length);
|
|
256304
256489
|
paramOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.Polyface.createPointVector(this.builder, numberArray);
|
|
256305
256490
|
}
|
|
256306
|
-
if (mesh.data.auxData)
|
|
256307
|
-
auxDataOffset = this.writePolyfaceAuxDataAsFBVariantGeometry(mesh.data.auxData);
|
|
256308
|
-
}
|
|
256491
|
+
if (mesh.data.auxData)
|
|
256492
|
+
auxDataOffset = this.writePolyfaceAuxDataAsFBVariantGeometry(mesh, mesh.data.auxData);
|
|
256309
256493
|
if (mesh.data.taggedNumericData)
|
|
256310
256494
|
taggedNumericDataOffset = this.writeTaggedNumericDataArray(mesh.data.taggedNumericData);
|
|
256311
256495
|
const expectedClosure = mesh.expectedClosure;
|
|
256496
|
+
// NOTE: mesh.data.face is not persistent
|
|
256312
256497
|
const polyfaceOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.Polyface.createPolyface(this.builder, pointOffset, paramOffset, normalOffset, 0, intColorOffset, pointIndexOffset, paramIndexOffset, normalIndexOffset, colorIndexOffset, 0, 0, 0, meshStyle, twoSided, numPerFace, 0, auxDataOffset, expectedClosure, taggedNumericDataOffset);
|
|
256313
256498
|
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.VariantGeometryUnion.tagPolyface, polyfaceOffset, 0);
|
|
256314
256499
|
}
|
|
@@ -259173,48 +259358,49 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
259173
259358
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
259174
259359
|
/* harmony export */ "IModelJson": () => (/* binding */ IModelJson)
|
|
259175
259360
|
/* harmony export */ });
|
|
259176
|
-
/* harmony import */ var
|
|
259177
|
-
/* harmony import */ var
|
|
259178
|
-
/* harmony import */ var
|
|
259179
|
-
/* harmony import */ var
|
|
259180
|
-
/* harmony import */ var
|
|
259181
|
-
/* harmony import */ var
|
|
259182
|
-
/* harmony import */ var
|
|
259183
|
-
/* harmony import */ var
|
|
259184
|
-
/* harmony import */ var
|
|
259185
|
-
/* harmony import */ var
|
|
259186
|
-
/* harmony import */ var
|
|
259187
|
-
/* harmony import */ var
|
|
259188
|
-
/* harmony import */ var
|
|
259189
|
-
/* harmony import */ var
|
|
259190
|
-
/* harmony import */ var
|
|
259191
|
-
/* harmony import */ var
|
|
259192
|
-
/* harmony import */ var
|
|
259193
|
-
/* harmony import */ var
|
|
259194
|
-
/* harmony import */ var
|
|
259195
|
-
/* harmony import */ var
|
|
259196
|
-
/* harmony import */ var
|
|
259197
|
-
/* harmony import */ var
|
|
259198
|
-
/* harmony import */ var
|
|
259199
|
-
/* harmony import */ var
|
|
259200
|
-
/* harmony import */ var
|
|
259201
|
-
/* harmony import */ var
|
|
259202
|
-
/* harmony import */ var
|
|
259203
|
-
/* harmony import */ var
|
|
259204
|
-
/* harmony import */ var
|
|
259205
|
-
/* harmony import */ var
|
|
259206
|
-
/* harmony import */ var
|
|
259207
|
-
/* harmony import */ var
|
|
259208
|
-
/* harmony import */ var
|
|
259209
|
-
/* harmony import */ var
|
|
259210
|
-
/* harmony import */ var
|
|
259211
|
-
/* harmony import */ var
|
|
259212
|
-
/* harmony import */ var
|
|
259213
|
-
/* harmony import */ var
|
|
259214
|
-
/* harmony import */ var
|
|
259215
|
-
/* harmony import */ var
|
|
259216
|
-
/* harmony import */ var
|
|
259217
|
-
/* harmony import */ var
|
|
259361
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
259362
|
+
/* harmony import */ var _bspline_AkimaCurve3d__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../bspline/AkimaCurve3d */ "../../core/geometry/lib/esm/bspline/AkimaCurve3d.js");
|
|
259363
|
+
/* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
|
|
259364
|
+
/* harmony import */ var _bspline_BSplineCurve3dH__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../bspline/BSplineCurve3dH */ "../../core/geometry/lib/esm/bspline/BSplineCurve3dH.js");
|
|
259365
|
+
/* harmony import */ var _bspline_BSplineCurveOps__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ../bspline/BSplineCurveOps */ "../../core/geometry/lib/esm/bspline/BSplineCurveOps.js");
|
|
259366
|
+
/* harmony import */ var _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../bspline/BSplineSurface */ "../../core/geometry/lib/esm/bspline/BSplineSurface.js");
|
|
259367
|
+
/* harmony import */ var _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../bspline/InterpolationCurve3d */ "../../core/geometry/lib/esm/bspline/InterpolationCurve3d.js");
|
|
259368
|
+
/* harmony import */ var _bspline_KnotVector__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../bspline/KnotVector */ "../../core/geometry/lib/esm/bspline/KnotVector.js");
|
|
259369
|
+
/* harmony import */ var _curve_Arc3d__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../curve/Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
259370
|
+
/* harmony import */ var _curve_CoordinateXYZ__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../curve/CoordinateXYZ */ "../../core/geometry/lib/esm/curve/CoordinateXYZ.js");
|
|
259371
|
+
/* harmony import */ var _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../curve/CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
259372
|
+
/* harmony import */ var _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../curve/GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
|
|
259373
|
+
/* harmony import */ var _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../curve/LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
259374
|
+
/* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
259375
|
+
/* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
259376
|
+
/* harmony import */ var _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../curve/ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
|
|
259377
|
+
/* harmony import */ var _curve_Path__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../curve/Path */ "../../core/geometry/lib/esm/curve/Path.js");
|
|
259378
|
+
/* harmony import */ var _curve_PointString3d__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../curve/PointString3d */ "../../core/geometry/lib/esm/curve/PointString3d.js");
|
|
259379
|
+
/* harmony import */ var _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../curve/spiral/DirectSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/DirectSpiral3d.js");
|
|
259380
|
+
/* harmony import */ var _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../curve/spiral/IntegratedSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/IntegratedSpiral3d.js");
|
|
259381
|
+
/* harmony import */ var _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../curve/UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
|
|
259382
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
259383
|
+
/* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
|
|
259384
|
+
/* harmony import */ var _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/AngleSweep */ "../../core/geometry/lib/esm/geometry3d/AngleSweep.js");
|
|
259385
|
+
/* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
|
|
259386
|
+
/* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
|
|
259387
|
+
/* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
|
|
259388
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
259389
|
+
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
259390
|
+
/* harmony import */ var _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/Segment1d */ "../../core/geometry/lib/esm/geometry3d/Segment1d.js");
|
|
259391
|
+
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
259392
|
+
/* harmony import */ var _geometry3d_YawPitchRollAngles__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/YawPitchRollAngles */ "../../core/geometry/lib/esm/geometry3d/YawPitchRollAngles.js");
|
|
259393
|
+
/* harmony import */ var _polyface_AuxData__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../polyface/AuxData */ "../../core/geometry/lib/esm/polyface/AuxData.js");
|
|
259394
|
+
/* harmony import */ var _polyface_Polyface__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../polyface/Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
|
|
259395
|
+
/* harmony import */ var _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../polyface/TaggedNumericData */ "../../core/geometry/lib/esm/polyface/TaggedNumericData.js");
|
|
259396
|
+
/* harmony import */ var _solid_Box__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../solid/Box */ "../../core/geometry/lib/esm/solid/Box.js");
|
|
259397
|
+
/* harmony import */ var _solid_Cone__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../solid/Cone */ "../../core/geometry/lib/esm/solid/Cone.js");
|
|
259398
|
+
/* harmony import */ var _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../solid/LinearSweep */ "../../core/geometry/lib/esm/solid/LinearSweep.js");
|
|
259399
|
+
/* harmony import */ var _solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../solid/RotationalSweep */ "../../core/geometry/lib/esm/solid/RotationalSweep.js");
|
|
259400
|
+
/* harmony import */ var _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../solid/RuledSweep */ "../../core/geometry/lib/esm/solid/RuledSweep.js");
|
|
259401
|
+
/* harmony import */ var _solid_Sphere__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../solid/Sphere */ "../../core/geometry/lib/esm/solid/Sphere.js");
|
|
259402
|
+
/* harmony import */ var _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../solid/TorusPipe */ "../../core/geometry/lib/esm/solid/TorusPipe.js");
|
|
259403
|
+
/* harmony import */ var _SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./SerializationHelpers */ "../../core/geometry/lib/esm/serialization/SerializationHelpers.js");
|
|
259218
259404
|
/*---------------------------------------------------------------------------------------------
|
|
259219
259405
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
259220
259406
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -259262,6 +259448,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
259262
259448
|
|
|
259263
259449
|
|
|
259264
259450
|
|
|
259451
|
+
|
|
259265
259452
|
|
|
259266
259453
|
|
|
259267
259454
|
// cspell:word bagof
|
|
@@ -259282,32 +259469,32 @@ var IModelJson;
|
|
|
259282
259469
|
static parseVector3dProperty(json, propertyName, defaultValue) {
|
|
259283
259470
|
if (json.hasOwnProperty(propertyName)) {
|
|
259284
259471
|
const value = json[propertyName];
|
|
259285
|
-
if (
|
|
259286
|
-
return
|
|
259287
|
-
if (
|
|
259288
|
-
return
|
|
259289
|
-
if (
|
|
259290
|
-
return
|
|
259472
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(value, 3))
|
|
259473
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(value[0], value[1], value[2]);
|
|
259474
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(value, 2))
|
|
259475
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(value[0], value[1]);
|
|
259476
|
+
if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.XYZ.isXAndY(value))
|
|
259477
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(value);
|
|
259291
259478
|
}
|
|
259292
259479
|
return defaultValue;
|
|
259293
259480
|
}
|
|
259294
259481
|
static parsePoint3dProperty(json, propertyName, defaultValue) {
|
|
259295
259482
|
if (json.hasOwnProperty(propertyName)) {
|
|
259296
259483
|
const value = json[propertyName];
|
|
259297
|
-
if (
|
|
259298
|
-
return
|
|
259299
|
-
if (
|
|
259300
|
-
return
|
|
259301
|
-
if (
|
|
259302
|
-
return
|
|
259484
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(value, 3))
|
|
259485
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(value[0], value[1], value[2]);
|
|
259486
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(value, 2))
|
|
259487
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(value[0], value[1]);
|
|
259488
|
+
if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.XYZ.isXAndY(value))
|
|
259489
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(value);
|
|
259303
259490
|
}
|
|
259304
259491
|
return defaultValue;
|
|
259305
259492
|
}
|
|
259306
259493
|
static parseSegment1dProperty(json, propertyName, defaultValue) {
|
|
259307
259494
|
if (json.hasOwnProperty(propertyName)) {
|
|
259308
259495
|
const value = json[propertyName];
|
|
259309
|
-
if (
|
|
259310
|
-
return
|
|
259496
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(value, 2))
|
|
259497
|
+
return _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_3__.Segment1d.create(value[0], value[1]);
|
|
259311
259498
|
}
|
|
259312
259499
|
return defaultValue;
|
|
259313
259500
|
}
|
|
@@ -259326,7 +259513,7 @@ var IModelJson;
|
|
|
259326
259513
|
const tagA = this.parseNumberProperty(json, "tagA");
|
|
259327
259514
|
const tagB = this.parseNumberProperty(json, "tagB", 0);
|
|
259328
259515
|
if (tagA !== undefined) {
|
|
259329
|
-
const result = new
|
|
259516
|
+
const result = new _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_4__.TaggedNumericData(tagA, tagB);
|
|
259330
259517
|
if (json.hasOwnProperty("intData"))
|
|
259331
259518
|
result.intData = this.parseNumberArrayProperty(json, "intData", 0, undefined);
|
|
259332
259519
|
if (json.hasOwnProperty("doubleData"))
|
|
@@ -259352,7 +259539,7 @@ var IModelJson;
|
|
|
259352
259539
|
static parseAngleProperty(json, propertyName, defaultValue) {
|
|
259353
259540
|
if (json.hasOwnProperty(propertyName)) {
|
|
259354
259541
|
const value = json[propertyName];
|
|
259355
|
-
return
|
|
259542
|
+
return _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_5__.Angle.fromJSON(value);
|
|
259356
259543
|
}
|
|
259357
259544
|
return defaultValue;
|
|
259358
259545
|
}
|
|
@@ -259362,7 +259549,7 @@ var IModelJson;
|
|
|
259362
259549
|
static parseAngleSweepProps(json, propertyName, defaultFunction) {
|
|
259363
259550
|
if (json.hasOwnProperty(propertyName)) {
|
|
259364
259551
|
const value = json[propertyName];
|
|
259365
|
-
return
|
|
259552
|
+
return _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_6__.AngleSweep.fromJSON(value);
|
|
259366
259553
|
}
|
|
259367
259554
|
if (defaultFunction === undefined)
|
|
259368
259555
|
return undefined;
|
|
@@ -259385,7 +259572,7 @@ var IModelJson;
|
|
|
259385
259572
|
const result = [];
|
|
259386
259573
|
for (const contourData of value) {
|
|
259387
259574
|
const contour = Reader.parse(contourData);
|
|
259388
|
-
if (contour instanceof
|
|
259575
|
+
if (contour instanceof _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_7__.CurveCollection) {
|
|
259389
259576
|
result.push(contour);
|
|
259390
259577
|
}
|
|
259391
259578
|
}
|
|
@@ -259396,7 +259583,7 @@ var IModelJson;
|
|
|
259396
259583
|
return undefined;
|
|
259397
259584
|
}
|
|
259398
259585
|
static parseYawPitchRollAnglesToMatrix3d(json) {
|
|
259399
|
-
const ypr =
|
|
259586
|
+
const ypr = _geometry3d_YawPitchRollAngles__WEBPACK_IMPORTED_MODULE_8__.YawPitchRollAngles.fromJSON(json);
|
|
259400
259587
|
return ypr.toMatrix3d();
|
|
259401
259588
|
}
|
|
259402
259589
|
static parseStringProperty(json, propertyName, defaultValue) {
|
|
@@ -259409,14 +259596,14 @@ var IModelJson;
|
|
|
259409
259596
|
}
|
|
259410
259597
|
static parseAxesFromVectors(json, axisOrder, createDefaultIdentity) {
|
|
259411
259598
|
if (Array.isArray(json) && json.length === 2) {
|
|
259412
|
-
const xVector =
|
|
259413
|
-
const yVector =
|
|
259414
|
-
const matrix =
|
|
259599
|
+
const xVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[0]);
|
|
259600
|
+
const yVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[1]);
|
|
259601
|
+
const matrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createRigidFromColumns(xVector, yVector, axisOrder);
|
|
259415
259602
|
if (matrix)
|
|
259416
259603
|
return matrix;
|
|
259417
259604
|
}
|
|
259418
259605
|
if (createDefaultIdentity)
|
|
259419
|
-
return
|
|
259606
|
+
return _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createIdentity();
|
|
259420
259607
|
return undefined;
|
|
259421
259608
|
}
|
|
259422
259609
|
/**
|
|
@@ -259433,13 +259620,13 @@ var IModelJson;
|
|
|
259433
259620
|
return Reader.parseYawPitchRollAnglesToMatrix3d(json.yawPitchRollAngles);
|
|
259434
259621
|
}
|
|
259435
259622
|
else if (json.xyVectors) {
|
|
259436
|
-
return Reader.parseAxesFromVectors(json.xyVectors,
|
|
259623
|
+
return Reader.parseAxesFromVectors(json.xyVectors, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.XYZ, createDefaultIdentity);
|
|
259437
259624
|
}
|
|
259438
259625
|
else if (json.zxVectors) {
|
|
259439
|
-
return Reader.parseAxesFromVectors(json.zxVectors,
|
|
259626
|
+
return Reader.parseAxesFromVectors(json.zxVectors, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.ZXY, createDefaultIdentity);
|
|
259440
259627
|
}
|
|
259441
259628
|
if (createDefaultIdentity)
|
|
259442
|
-
return
|
|
259629
|
+
return _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createIdentity();
|
|
259443
259630
|
return undefined;
|
|
259444
259631
|
}
|
|
259445
259632
|
static parseArcByVectorProps(data) {
|
|
@@ -259448,17 +259635,17 @@ var IModelJson;
|
|
|
259448
259635
|
&& data.vectorX !== undefined
|
|
259449
259636
|
&& data.vectorY !== undefined
|
|
259450
259637
|
&& data.sweepStartEnd !== undefined) {
|
|
259451
|
-
return
|
|
259638
|
+
return _curve_Arc3d__WEBPACK_IMPORTED_MODULE_10__.Arc3d.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(data.center), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(data.vectorX), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(data.vectorY), _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_6__.AngleSweep.fromJSON(data.sweepStartEnd));
|
|
259452
259639
|
}
|
|
259453
259640
|
return undefined;
|
|
259454
259641
|
}
|
|
259455
259642
|
// remark: Returns LineString3d as last default when give points are colinear.
|
|
259456
259643
|
static parseArcBy3Points(data) {
|
|
259457
259644
|
if (Array.isArray(data) && data.length > 2) {
|
|
259458
|
-
const pointA =
|
|
259459
|
-
const pointB =
|
|
259460
|
-
const pointC =
|
|
259461
|
-
return
|
|
259645
|
+
const pointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(data[0]);
|
|
259646
|
+
const pointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(data[1]);
|
|
259647
|
+
const pointC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(data[2]);
|
|
259648
|
+
return _curve_Arc3d__WEBPACK_IMPORTED_MODULE_10__.Arc3d.createCircularStartMiddleEnd(pointA, pointB, pointC);
|
|
259462
259649
|
}
|
|
259463
259650
|
return undefined;
|
|
259464
259651
|
}
|
|
@@ -259471,9 +259658,9 @@ var IModelJson;
|
|
|
259471
259658
|
}
|
|
259472
259659
|
/** Parse point content (right side) `[1,2,3]` to a CoordinateXYZ object. */
|
|
259473
259660
|
static parseCoordinate(data) {
|
|
259474
|
-
const point =
|
|
259661
|
+
const point = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(data);
|
|
259475
259662
|
if (point)
|
|
259476
|
-
return
|
|
259663
|
+
return _curve_CoordinateXYZ__WEBPACK_IMPORTED_MODULE_11__.CoordinateXYZ.create(point);
|
|
259477
259664
|
return undefined;
|
|
259478
259665
|
}
|
|
259479
259666
|
/** Parse TransitionSpiral content (right side) to TransitionSpiral3d. */
|
|
@@ -259497,10 +259684,10 @@ var IModelJson;
|
|
|
259497
259684
|
// REMARK: Our job is to parse and pass data along -- inscrutable validation happens in the implementation classes . . .
|
|
259498
259685
|
if (origin) {
|
|
259499
259686
|
let candidate;
|
|
259500
|
-
candidate =
|
|
259687
|
+
candidate = _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_12__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, startRadius, endRadius, startBearing, endBearing, length, interval, _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_13__.Transform.createOriginAndMatrix(origin, axes));
|
|
259501
259688
|
if (candidate)
|
|
259502
259689
|
return candidate;
|
|
259503
|
-
candidate =
|
|
259690
|
+
candidate = _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_14__.DirectSpiral3d.createFromLengthAndRadius(spiralType, startRadius, endRadius, startBearing, endBearing, length, interval, _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_13__.Transform.createOriginAndMatrix(origin, axes));
|
|
259504
259691
|
if (candidate)
|
|
259505
259692
|
return candidate;
|
|
259506
259693
|
}
|
|
@@ -259515,14 +259702,14 @@ var IModelJson;
|
|
|
259515
259702
|
&& data.hasOwnProperty("order") && Number.isFinite(data.order)
|
|
259516
259703
|
&& data.hasOwnProperty("points") && Array.isArray(data.points) && Array.isArray(data.points[0])
|
|
259517
259704
|
&& (dim = data.points[0].length) >= 3 && dim <= 4) {
|
|
259518
|
-
const myData =
|
|
259705
|
+
const myData = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.createBSplineCurveData(data.points, dim, data.knots, data.points.length, data.order);
|
|
259519
259706
|
if (data.hasOwnProperty("closed") && true === data.closed)
|
|
259520
259707
|
myData.params.closed = true;
|
|
259521
|
-
if (
|
|
259708
|
+
if (_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.Import.prepareBSplineCurveData(myData)) {
|
|
259522
259709
|
if (dim === 3)
|
|
259523
|
-
newCurve =
|
|
259710
|
+
newCurve = _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_16__.BSplineCurve3d.create(myData.poles, myData.params.knots, myData.params.order);
|
|
259524
259711
|
else
|
|
259525
|
-
newCurve =
|
|
259712
|
+
newCurve = _bspline_BSplineCurve3dH__WEBPACK_IMPORTED_MODULE_17__.BSplineCurve3dH.create(myData.poles, myData.params.knots, myData.params.order);
|
|
259526
259713
|
if (undefined !== newCurve) {
|
|
259527
259714
|
if (undefined !== myData.params.wrapMode)
|
|
259528
259715
|
newCurve.setWrappable(myData.params.wrapMode);
|
|
@@ -259535,13 +259722,13 @@ var IModelJson;
|
|
|
259535
259722
|
static parseInterpolationCurve(data) {
|
|
259536
259723
|
if (data === undefined)
|
|
259537
259724
|
return undefined;
|
|
259538
|
-
return
|
|
259725
|
+
return _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_18__.InterpolationCurve3d.create(data);
|
|
259539
259726
|
}
|
|
259540
259727
|
/** Parse `bcurve` content to an Akima curve object. */
|
|
259541
259728
|
static parseAkimaCurve3d(data) {
|
|
259542
259729
|
if (data === undefined)
|
|
259543
259730
|
return undefined;
|
|
259544
|
-
return
|
|
259731
|
+
return _bspline_AkimaCurve3d__WEBPACK_IMPORTED_MODULE_19__.AkimaCurve3d.create(data);
|
|
259545
259732
|
}
|
|
259546
259733
|
/** Parse array of json objects to array of instances. */
|
|
259547
259734
|
static parseArray(data) {
|
|
@@ -259557,24 +259744,6 @@ var IModelJson;
|
|
|
259557
259744
|
}
|
|
259558
259745
|
return undefined;
|
|
259559
259746
|
}
|
|
259560
|
-
// For each nonzero index, Announce Math.abs (value) -1
|
|
259561
|
-
static addZeroBasedIndicesFromSignedOneBased(data, numPerFace, f) {
|
|
259562
|
-
if (data && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isNumberArray(data)) {
|
|
259563
|
-
if (numPerFace > 1) {
|
|
259564
|
-
// all indices are used ...
|
|
259565
|
-
for (const value of data) {
|
|
259566
|
-
f(Math.abs(value) - 1);
|
|
259567
|
-
}
|
|
259568
|
-
}
|
|
259569
|
-
else {
|
|
259570
|
-
// ignore separator zeros ...
|
|
259571
|
-
for (const value of data) {
|
|
259572
|
-
if (value !== 0)
|
|
259573
|
-
f(Math.abs(value) - 1);
|
|
259574
|
-
}
|
|
259575
|
-
}
|
|
259576
|
-
}
|
|
259577
|
-
}
|
|
259578
259747
|
/** parse polyface aux data content to PolyfaceAuxData instance */
|
|
259579
259748
|
static parsePolyfaceAuxData(data = undefined, numPerFace = 0) {
|
|
259580
259749
|
if (!Array.isArray(data.channels) || !Array.isArray(data.indices))
|
|
@@ -259585,13 +259754,13 @@ var IModelJson;
|
|
|
259585
259754
|
const outChannelData = [];
|
|
259586
259755
|
for (const inChannelData of inChannel.data) {
|
|
259587
259756
|
if (inChannelData.hasOwnProperty("input") && Array.isArray(inChannelData.values))
|
|
259588
|
-
outChannelData.push(new
|
|
259757
|
+
outChannelData.push(new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_20__.AuxChannelData(inChannelData.input, inChannelData.values));
|
|
259589
259758
|
}
|
|
259590
|
-
outChannels.push(new
|
|
259759
|
+
outChannels.push(new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_20__.AuxChannel(outChannelData, inChannel.dataType, inChannel.name, inChannel.inputName));
|
|
259591
259760
|
}
|
|
259592
259761
|
}
|
|
259593
|
-
const auxData = new
|
|
259594
|
-
|
|
259762
|
+
const auxData = new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_20__.PolyfaceAuxData(outChannels, []);
|
|
259763
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(data.indices, numPerFace, (x) => { auxData.indices.push(x); });
|
|
259595
259764
|
return auxData;
|
|
259596
259765
|
}
|
|
259597
259766
|
/** parse indexed mesh content to an IndexedPolyface instance */
|
|
@@ -259600,75 +259769,50 @@ var IModelJson;
|
|
|
259600
259769
|
// CoordIndex[1,2,3,0] -- zero-terminated, one based !!!
|
|
259601
259770
|
if (data.hasOwnProperty("point") && Array.isArray(data.point)
|
|
259602
259771
|
&& data.hasOwnProperty("pointIndex") && Array.isArray(data.pointIndex)) {
|
|
259603
|
-
const polyface =
|
|
259604
|
-
|
|
259605
|
-
// for normals, addNormal() is overeager to detect the (common) case of duplicate normals in sequence.
|
|
259606
|
-
// use addNormalXYZ which always creates a new one.
|
|
259607
|
-
// likewise for params
|
|
259608
|
-
for (const uvw of data.normal) {
|
|
259609
|
-
if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isNumberArray(uvw, 3))
|
|
259610
|
-
polyface.addNormalXYZ(uvw[0], uvw[1], uvw[2]);
|
|
259611
|
-
}
|
|
259612
|
-
}
|
|
259772
|
+
const polyface = _polyface_Polyface__WEBPACK_IMPORTED_MODULE_21__.IndexedPolyface.create();
|
|
259773
|
+
const numPerFace = data.hasOwnProperty("numPerFace") ? data.numPerFace : 0;
|
|
259613
259774
|
if (data.hasOwnProperty("twoSided")) {
|
|
259614
259775
|
const q = data.twoSided;
|
|
259615
259776
|
if (q === true || q === false) {
|
|
259616
259777
|
polyface.twoSided = q;
|
|
259617
259778
|
}
|
|
259618
259779
|
}
|
|
259619
|
-
const numPerFace = data.hasOwnProperty("numPerFace") ? data.numPerFace : 0;
|
|
259620
259780
|
if (data.hasOwnProperty("expectedClosure")) {
|
|
259621
259781
|
const q = data.expectedClosure;
|
|
259622
259782
|
if (Number.isFinite(q)) {
|
|
259623
259783
|
polyface.expectedClosure = q;
|
|
259624
259784
|
}
|
|
259625
259785
|
}
|
|
259626
|
-
if (data.hasOwnProperty("
|
|
259786
|
+
if (data.hasOwnProperty("normal") && Array.isArray(data.normal) && data.hasOwnProperty("normalIndex")) {
|
|
259787
|
+
// For normals, addNormal() is overeager to detect the (common) case of duplicate normals in sequence.
|
|
259788
|
+
// Use addNormalXYZ which always creates a new one. Likewise for params.
|
|
259789
|
+
for (const uvw of data.normal) {
|
|
259790
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(uvw, 3))
|
|
259791
|
+
polyface.addNormalXYZ(uvw[0], uvw[1], uvw[2]);
|
|
259792
|
+
}
|
|
259793
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(data.normalIndex, numPerFace, (x) => { polyface.addNormalIndex(x); });
|
|
259794
|
+
}
|
|
259795
|
+
if (data.hasOwnProperty("param") && Array.isArray(data.param) && data.hasOwnProperty("paramIndex")) {
|
|
259627
259796
|
for (const uv of data.param) {
|
|
259628
|
-
if (
|
|
259797
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(uv, 2))
|
|
259629
259798
|
polyface.addParamUV(uv[0], uv[1]);
|
|
259630
259799
|
}
|
|
259800
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(data.paramIndex, numPerFace, (x) => { polyface.addParamIndex(x); });
|
|
259631
259801
|
}
|
|
259632
|
-
if (data.hasOwnProperty("color") && Array.isArray(data.color)) {
|
|
259633
|
-
for (const c of data.color)
|
|
259802
|
+
if (data.hasOwnProperty("color") && Array.isArray(data.color) && data.hasOwnProperty("colorIndex")) {
|
|
259803
|
+
for (const c of data.color)
|
|
259634
259804
|
polyface.addColor(c);
|
|
259635
|
-
}
|
|
259805
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(data.colorIndex, numPerFace, (x) => { polyface.addColorIndex(x); });
|
|
259636
259806
|
}
|
|
259637
259807
|
for (const p of data.point)
|
|
259638
259808
|
polyface.addPointXYZ(p[0], p[1], p[2]);
|
|
259639
|
-
|
|
259640
|
-
|
|
259641
|
-
|
|
259642
|
-
const p0 = Math.abs(p) - 1;
|
|
259643
|
-
polyface.addPointIndex(p0, p > 0);
|
|
259644
|
-
if ((i + 1) % numPerFace === 0)
|
|
259645
|
-
polyface.terminateFacet(false);
|
|
259646
|
-
}
|
|
259647
|
-
}
|
|
259648
|
-
else {
|
|
259649
|
-
for (const p of data.pointIndex) {
|
|
259650
|
-
if (p === 0)
|
|
259651
|
-
polyface.terminateFacet(false); // we are responsible for index checking !!!
|
|
259652
|
-
else {
|
|
259653
|
-
const p0 = Math.abs(p) - 1;
|
|
259654
|
-
polyface.addPointIndex(p0, p > 0);
|
|
259655
|
-
}
|
|
259656
|
-
}
|
|
259657
|
-
}
|
|
259658
|
-
if (data.hasOwnProperty("normalIndex")) {
|
|
259659
|
-
Reader.addZeroBasedIndicesFromSignedOneBased(data.normalIndex, numPerFace, (x) => { polyface.addNormalIndex(x); });
|
|
259660
|
-
}
|
|
259661
|
-
if (data.hasOwnProperty("paramIndex")) {
|
|
259662
|
-
Reader.addZeroBasedIndicesFromSignedOneBased(data.paramIndex, numPerFace, (x) => { polyface.addParamIndex(x); });
|
|
259663
|
-
}
|
|
259664
|
-
if (data.hasOwnProperty("colorIndex")) {
|
|
259665
|
-
Reader.addZeroBasedIndicesFromSignedOneBased(data.colorIndex, numPerFace, (x) => { polyface.addColorIndex(x); });
|
|
259666
|
-
}
|
|
259809
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(data.pointIndex, numPerFace, (i, v) => { polyface.addPointIndex(i, v); }, () => { polyface.terminateFacet(false); });
|
|
259810
|
+
if (!polyface.validateAllIndices())
|
|
259811
|
+
return undefined;
|
|
259667
259812
|
if (data.hasOwnProperty("auxData"))
|
|
259668
259813
|
polyface.data.auxData = Reader.parsePolyfaceAuxData(data.auxData, numPerFace);
|
|
259669
|
-
if (data.hasOwnProperty("tags"))
|
|
259814
|
+
if (data.hasOwnProperty("tags"))
|
|
259670
259815
|
polyface.data.taggedNumericData = Reader.parseTaggedNumericProps(data.tags);
|
|
259671
|
-
}
|
|
259672
259816
|
return polyface;
|
|
259673
259817
|
}
|
|
259674
259818
|
return undefined;
|
|
@@ -259678,7 +259822,7 @@ var IModelJson;
|
|
|
259678
259822
|
if (data && Array.isArray(data)) {
|
|
259679
259823
|
for (const c of data) {
|
|
259680
259824
|
const g = Reader.parse(c);
|
|
259681
|
-
if (g instanceof
|
|
259825
|
+
if (g instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_22__.GeometryQuery && ("curveCollection" === g.geometryCategory || "curvePrimitive" === g.geometryCategory))
|
|
259682
259826
|
result.tryAddChild(g);
|
|
259683
259827
|
}
|
|
259684
259828
|
return result;
|
|
@@ -259696,21 +259840,21 @@ var IModelJson;
|
|
|
259696
259840
|
&& data.hasOwnProperty("orderV") && Number.isFinite(data.orderV)
|
|
259697
259841
|
&& data.hasOwnProperty("points") && Array.isArray(data.points) && Array.isArray(data.points[0]) && Array.isArray(data.points[0][0])
|
|
259698
259842
|
&& (dim = data.points[0][0].length) >= 3 && dim <= 4) {
|
|
259699
|
-
const myData =
|
|
259843
|
+
const myData = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.createBSplineSurfaceData(data.points, dim, data.uKnots, data.points[0].length, data.orderU, data.vKnots, data.points.length, data.orderV);
|
|
259700
259844
|
if (data.hasOwnProperty("closedU") && true === data.closedU)
|
|
259701
259845
|
myData.uParams.closed = true;
|
|
259702
259846
|
if (data.hasOwnProperty("closedV") && true === data.closedV)
|
|
259703
259847
|
myData.vParams.closed = true;
|
|
259704
|
-
if (
|
|
259848
|
+
if (_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.Import.prepareBSplineSurfaceData(myData, { jsonPoles: true })) {
|
|
259705
259849
|
if (dim === 3)
|
|
259706
|
-
newSurface =
|
|
259850
|
+
newSurface = _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.BSplineSurface3d.createGrid(myData.poles, myData.uParams.order, myData.uParams.knots, myData.vParams.order, myData.vParams.knots);
|
|
259707
259851
|
else
|
|
259708
|
-
newSurface =
|
|
259852
|
+
newSurface = _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.BSplineSurface3dH.createGrid(myData.poles, _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.WeightStyle.WeightsAlreadyAppliedToCoordinates, myData.uParams.order, myData.uParams.knots, myData.vParams.order, myData.vParams.knots);
|
|
259709
259853
|
if (undefined !== newSurface) {
|
|
259710
259854
|
if (undefined !== myData.uParams.wrapMode)
|
|
259711
|
-
newSurface.setWrappable(
|
|
259855
|
+
newSurface.setWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.uDirection, myData.uParams.wrapMode);
|
|
259712
259856
|
if (undefined !== myData.vParams.wrapMode)
|
|
259713
|
-
newSurface.setWrappable(
|
|
259857
|
+
newSurface.setWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.vDirection, myData.vParams.wrapMode);
|
|
259714
259858
|
}
|
|
259715
259859
|
}
|
|
259716
259860
|
}
|
|
@@ -259730,14 +259874,14 @@ var IModelJson;
|
|
|
259730
259874
|
&& startRadius !== undefined
|
|
259731
259875
|
&& endRadius !== undefined) {
|
|
259732
259876
|
if (axes === undefined) {
|
|
259733
|
-
const axisVector =
|
|
259734
|
-
const frame =
|
|
259877
|
+
const axisVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(start, end);
|
|
259878
|
+
const frame = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createRigidHeadsUp(axisVector, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.ZXY);
|
|
259735
259879
|
const vectorX = frame.columnX();
|
|
259736
259880
|
const vectorY = frame.columnY();
|
|
259737
|
-
return
|
|
259881
|
+
return _solid_Cone__WEBPACK_IMPORTED_MODULE_24__.Cone.createBaseAndTarget(start, end, vectorX, vectorY, startRadius, endRadius, capped);
|
|
259738
259882
|
}
|
|
259739
259883
|
else {
|
|
259740
|
-
return
|
|
259884
|
+
return _solid_Cone__WEBPACK_IMPORTED_MODULE_24__.Cone.createBaseAndTarget(start, end, axes.columnX(), axes.columnY(), startRadius, endRadius, capped);
|
|
259741
259885
|
}
|
|
259742
259886
|
}
|
|
259743
259887
|
return undefined;
|
|
@@ -259751,14 +259895,14 @@ var IModelJson;
|
|
|
259751
259895
|
if (start
|
|
259752
259896
|
&& end
|
|
259753
259897
|
&& radius !== undefined) {
|
|
259754
|
-
return
|
|
259898
|
+
return _solid_Cone__WEBPACK_IMPORTED_MODULE_24__.Cone.createAxisPoints(start, end, radius, radius, capped);
|
|
259755
259899
|
}
|
|
259756
259900
|
return undefined;
|
|
259757
259901
|
}
|
|
259758
259902
|
/** Parse line segment (array of 2 points) properties to `LineSegment3d` instance */
|
|
259759
259903
|
static parseLineSegmentProps(value) {
|
|
259760
259904
|
if (Array.isArray(value) && value.length > 1)
|
|
259761
|
-
return
|
|
259905
|
+
return _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_25__.LineSegment3d.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(value[0]), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(value[1]));
|
|
259762
259906
|
else
|
|
259763
259907
|
return undefined;
|
|
259764
259908
|
}
|
|
@@ -259767,11 +259911,11 @@ var IModelJson;
|
|
|
259767
259911
|
const contour = Reader.parse(json.contour);
|
|
259768
259912
|
const capped = Reader.parseBooleanProperty(json, "capped");
|
|
259769
259913
|
const extrusionVector = Reader.parseVector3dProperty(json, "vector");
|
|
259770
|
-
if (contour instanceof
|
|
259914
|
+
if (contour instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_22__.GeometryQuery
|
|
259771
259915
|
&& "curveCollection" === contour.geometryCategory
|
|
259772
259916
|
&& capped !== undefined
|
|
259773
259917
|
&& extrusionVector) {
|
|
259774
|
-
return
|
|
259918
|
+
return _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_26__.LinearSweep.create(contour, extrusionVector, capped);
|
|
259775
259919
|
}
|
|
259776
259920
|
return undefined;
|
|
259777
259921
|
}
|
|
@@ -259784,13 +259928,13 @@ var IModelJson;
|
|
|
259784
259928
|
const axisVector = Reader.parseVector3dProperty(json, "axis");
|
|
259785
259929
|
const center = Reader.parsePoint3dProperty(json, "center");
|
|
259786
259930
|
const sweepDegrees = Reader.parseNumberProperty(json, "sweepAngle");
|
|
259787
|
-
if (contour instanceof
|
|
259931
|
+
if (contour instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_22__.GeometryQuery
|
|
259788
259932
|
&& "curveCollection" === contour.geometryCategory
|
|
259789
259933
|
&& sweepDegrees !== undefined
|
|
259790
259934
|
&& capped !== undefined
|
|
259791
259935
|
&& axisVector
|
|
259792
259936
|
&& center) {
|
|
259793
|
-
return
|
|
259937
|
+
return _solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_27__.RotationalSweep.create(contour, _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_28__.Ray3d.createCapture(center, axisVector), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_5__.Angle.createDegrees(sweepDegrees), capped);
|
|
259794
259938
|
}
|
|
259795
259939
|
return undefined;
|
|
259796
259940
|
}
|
|
@@ -259808,7 +259952,7 @@ var IModelJson;
|
|
|
259808
259952
|
const height = Reader.parseNumberProperty(json, "height", baseX);
|
|
259809
259953
|
const axes = Reader.parseOrientation(json, true);
|
|
259810
259954
|
if (origin && !topOrigin && height)
|
|
259811
|
-
topOrigin =
|
|
259955
|
+
topOrigin = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.xyzPlusMatrixTimesXYZ(origin, axes, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 0, height));
|
|
259812
259956
|
if (capped !== undefined
|
|
259813
259957
|
&& baseX !== undefined
|
|
259814
259958
|
&& baseY !== undefined
|
|
@@ -259817,7 +259961,7 @@ var IModelJson;
|
|
|
259817
259961
|
&& axes
|
|
259818
259962
|
&& origin
|
|
259819
259963
|
&& topOrigin) {
|
|
259820
|
-
return
|
|
259964
|
+
return _solid_Box__WEBPACK_IMPORTED_MODULE_29__.Box.createDgnBoxWithAxes(origin, axes, topOrigin, baseX, baseY, topX, topY, capped);
|
|
259821
259965
|
}
|
|
259822
259966
|
return undefined;
|
|
259823
259967
|
}
|
|
@@ -259839,7 +259983,7 @@ var IModelJson;
|
|
|
259839
259983
|
&& radiusY !== undefined
|
|
259840
259984
|
&& radiusZ !== undefined
|
|
259841
259985
|
&& capped !== undefined) {
|
|
259842
|
-
return
|
|
259986
|
+
return _solid_Sphere__WEBPACK_IMPORTED_MODULE_30__.Sphere.createFromAxesAndScales(center, axes, radiusX, radiusY, radiusZ, latitudeStartEnd, capped);
|
|
259843
259987
|
}
|
|
259844
259988
|
return undefined;
|
|
259845
259989
|
}
|
|
@@ -259849,7 +259993,7 @@ var IModelJson;
|
|
|
259849
259993
|
const contours = this.loadContourArray(json, "contour");
|
|
259850
259994
|
if (contours !== undefined
|
|
259851
259995
|
&& capped !== undefined) {
|
|
259852
|
-
return
|
|
259996
|
+
return _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_31__.RuledSweep.create(contours, capped);
|
|
259853
259997
|
}
|
|
259854
259998
|
return undefined;
|
|
259855
259999
|
}
|
|
@@ -259864,7 +260008,7 @@ var IModelJson;
|
|
|
259864
260008
|
if (center
|
|
259865
260009
|
&& radiusA !== undefined
|
|
259866
260010
|
&& radiusB !== undefined) {
|
|
259867
|
-
return
|
|
260011
|
+
return _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_32__.TorusPipe.createDgnTorusPipe(center, axes.columnX(), axes.columnY(), radiusA, radiusB, sweepAngle ? sweepAngle : _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_5__.Angle.createDegrees(360), capped);
|
|
259868
260012
|
}
|
|
259869
260013
|
return undefined;
|
|
259870
260014
|
}
|
|
@@ -259873,11 +260017,11 @@ var IModelJson;
|
|
|
259873
260017
|
const points = [];
|
|
259874
260018
|
if (json && Array.isArray(json)) {
|
|
259875
260019
|
for (const member of json) {
|
|
259876
|
-
if (
|
|
259877
|
-
points.push(
|
|
260020
|
+
if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.XYZ.isXAndY(member)) {
|
|
260021
|
+
points.push(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(member));
|
|
259878
260022
|
}
|
|
259879
|
-
else if (
|
|
259880
|
-
points.push(
|
|
260023
|
+
else if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(member, 2)) {
|
|
260024
|
+
points.push(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(member));
|
|
259881
260025
|
}
|
|
259882
260026
|
}
|
|
259883
260027
|
}
|
|
@@ -259890,7 +260034,7 @@ var IModelJson;
|
|
|
259890
260034
|
return Reader.parseLineSegmentProps(json.lineSegment);
|
|
259891
260035
|
}
|
|
259892
260036
|
else if (json.lineString !== undefined) {
|
|
259893
|
-
return
|
|
260037
|
+
return _curve_LineString3d__WEBPACK_IMPORTED_MODULE_33__.LineString3d.create(Reader.parsePointArray(json.lineString));
|
|
259894
260038
|
}
|
|
259895
260039
|
else if (json.arc !== undefined) {
|
|
259896
260040
|
return Reader.parseArcObject(json.arc);
|
|
@@ -259908,19 +260052,19 @@ var IModelJson;
|
|
|
259908
260052
|
return Reader.parseAkimaCurve3d(json.akimaCurve);
|
|
259909
260053
|
}
|
|
259910
260054
|
else if (json.hasOwnProperty("path")) {
|
|
259911
|
-
return Reader.parseCurveCollectionMembers(new
|
|
260055
|
+
return Reader.parseCurveCollectionMembers(new _curve_Path__WEBPACK_IMPORTED_MODULE_34__.Path(), json.path);
|
|
259912
260056
|
}
|
|
259913
260057
|
else if (json.hasOwnProperty("loop")) {
|
|
259914
|
-
return Reader.parseCurveCollectionMembers(new
|
|
260058
|
+
return Reader.parseCurveCollectionMembers(new _curve_Loop__WEBPACK_IMPORTED_MODULE_35__.Loop(), json.loop);
|
|
259915
260059
|
}
|
|
259916
260060
|
else if (json.hasOwnProperty("parityRegion")) {
|
|
259917
|
-
return Reader.parseCurveCollectionMembers(new
|
|
260061
|
+
return Reader.parseCurveCollectionMembers(new _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_36__.ParityRegion(), json.parityRegion);
|
|
259918
260062
|
}
|
|
259919
260063
|
else if (json.hasOwnProperty("unionRegion")) {
|
|
259920
|
-
return Reader.parseCurveCollectionMembers(new
|
|
260064
|
+
return Reader.parseCurveCollectionMembers(new _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_37__.UnionRegion(), json.unionRegion);
|
|
259921
260065
|
}
|
|
259922
260066
|
else if (json.hasOwnProperty("bagOfCurves")) {
|
|
259923
|
-
return Reader.parseCurveCollectionMembers(new
|
|
260067
|
+
return Reader.parseCurveCollectionMembers(new _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_7__.BagOfCurves(), json.bagOfCurves);
|
|
259924
260068
|
}
|
|
259925
260069
|
else if (json.hasOwnProperty("indexedMesh")) {
|
|
259926
260070
|
return Reader.parseIndexedMesh(json.indexedMesh);
|
|
@@ -259953,7 +260097,7 @@ var IModelJson;
|
|
|
259953
260097
|
return Reader.parseTorusPipe(json.torusPipe);
|
|
259954
260098
|
}
|
|
259955
260099
|
else if (json.hasOwnProperty("pointString")) {
|
|
259956
|
-
return
|
|
260100
|
+
return _curve_PointString3d__WEBPACK_IMPORTED_MODULE_38__.PointString3d.create(Reader.parsePointArray(json.pointString));
|
|
259957
260101
|
}
|
|
259958
260102
|
else if (json.hasOwnProperty("transitionSpiral")) {
|
|
259959
260103
|
return Reader.parseTransitionSpiral(json.transitionSpiral);
|
|
@@ -259974,7 +260118,7 @@ var IModelJson;
|
|
|
259974
260118
|
* Class to deserialize json objects into GeometryQuery objects
|
|
259975
260119
|
* @public
|
|
259976
260120
|
*/
|
|
259977
|
-
class Writer extends
|
|
260121
|
+
class Writer extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_39__.GeometryHandler {
|
|
259978
260122
|
handleTaggedNumericData(data) {
|
|
259979
260123
|
const result = { tagA: data.tagA, tagB: data.tagB };
|
|
259980
260124
|
if (data.intData !== undefined && data.intData.length > 0)
|
|
@@ -260054,7 +260198,7 @@ var IModelJson;
|
|
|
260054
260198
|
// TODO: HANDLE NONRIGID TRANSFORM !!
|
|
260055
260199
|
// the spiral may have indication of how it was defined. If so, use defined/undefined state of the original data
|
|
260056
260200
|
// as indication of what current data to use. (Current data may have changed due to transforms.)
|
|
260057
|
-
if (data instanceof
|
|
260201
|
+
if (data instanceof _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_14__.DirectSpiral3d) {
|
|
260058
260202
|
const value = {
|
|
260059
260203
|
origin: data.localToWorld.origin.toJSON(),
|
|
260060
260204
|
type: data.spiralType,
|
|
@@ -260068,7 +260212,7 @@ var IModelJson;
|
|
|
260068
260212
|
value.length = data.nominalL1;
|
|
260069
260213
|
return { transitionSpiral: value };
|
|
260070
260214
|
}
|
|
260071
|
-
else if (data instanceof
|
|
260215
|
+
else if (data instanceof _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_12__.IntegratedSpiral3d) {
|
|
260072
260216
|
// TODO: HANDLE NONRIGID TRANSFORM !!
|
|
260073
260217
|
// the spiral may have indication of how it was defined. If so, use defined/undefined state of the original data
|
|
260074
260218
|
// as indication of what current data to use. (Current data may have changed due to transforms.)
|
|
@@ -260118,12 +260262,12 @@ var IModelJson;
|
|
|
260118
260262
|
const centerB = data.getCenterB();
|
|
260119
260263
|
const vectorX = data.getVectorX();
|
|
260120
260264
|
const vectorY = data.getVectorY();
|
|
260121
|
-
const axisVector =
|
|
260122
|
-
if (
|
|
260265
|
+
const axisVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(centerA, centerB);
|
|
260266
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(radiusA, radiusB)
|
|
260123
260267
|
&& vectorX.isPerpendicularTo(axisVector)
|
|
260124
260268
|
&& vectorY.isPerpendicularTo(axisVector)
|
|
260125
|
-
&&
|
|
260126
|
-
&&
|
|
260269
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(vectorX.magnitude(), 1.0)
|
|
260270
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(vectorY.magnitude(), 1.0)) {
|
|
260127
260271
|
return {
|
|
260128
260272
|
cylinder: {
|
|
260129
260273
|
capped: data.capped,
|
|
@@ -260163,7 +260307,7 @@ var IModelJson;
|
|
|
260163
260307
|
const fullSweep = latitudeSweep.isFullLatitudeSweep;
|
|
260164
260308
|
if (data.capped && !fullSweep)
|
|
260165
260309
|
value.capped = data.capped;
|
|
260166
|
-
if (
|
|
260310
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(rX, rY) && _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(rX, rZ))
|
|
260167
260311
|
value.radius = rX;
|
|
260168
260312
|
else {
|
|
260169
260313
|
value.radiusX = rX;
|
|
@@ -260317,35 +260461,25 @@ var IModelJson;
|
|
|
260317
260461
|
};
|
|
260318
260462
|
const outBox = out.box;
|
|
260319
260463
|
Writer.insertXYOrientation(outBox, box.getVectorX(), box.getVectorY(), true);
|
|
260320
|
-
if (!
|
|
260464
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(box.getTopX(), box.getBaseX()))
|
|
260321
260465
|
outBox.topX = box.getTopX();
|
|
260322
|
-
if (!
|
|
260466
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(box.getTopY(), box.getBaseY()))
|
|
260323
260467
|
outBox.topY = box.getTopY();
|
|
260324
260468
|
return out;
|
|
260325
260469
|
}
|
|
260326
260470
|
handlePolyfaceAuxData(auxData, pf) {
|
|
260327
|
-
|
|
260328
|
-
contents
|
|
260471
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(auxData === pf.data.auxData);
|
|
260472
|
+
const contents = { indices: [], channels: [] };
|
|
260329
260473
|
const visitor = pf.createVisitor(0);
|
|
260330
|
-
if (!visitor.auxData)
|
|
260331
|
-
return;
|
|
260332
260474
|
while (visitor.moveToNextFacet()) {
|
|
260333
|
-
for (let i = 0; i < visitor.indexCount; i++)
|
|
260475
|
+
for (let i = 0; i < visitor.indexCount; i++)
|
|
260334
260476
|
contents.indices.push(visitor.auxData.indices[i] + 1);
|
|
260335
|
-
}
|
|
260336
260477
|
contents.indices.push(0); // facet terminator.
|
|
260337
260478
|
}
|
|
260338
|
-
contents.channels = [];
|
|
260339
260479
|
for (const inChannel of auxData.channels) {
|
|
260340
|
-
const outChannel = {};
|
|
260341
|
-
outChannel.dataType = inChannel.dataType;
|
|
260342
|
-
outChannel.name = inChannel.name;
|
|
260343
|
-
outChannel.inputName = inChannel.inputName;
|
|
260344
|
-
outChannel.data = [];
|
|
260480
|
+
const outChannel = { data: [], dataType: inChannel.dataType, name: inChannel.name, inputName: inChannel.inputName };
|
|
260345
260481
|
for (const inData of inChannel.data) {
|
|
260346
|
-
const outData = {};
|
|
260347
|
-
outData.input = inData.input;
|
|
260348
|
-
outData.values = inData.values.slice(0);
|
|
260482
|
+
const outData = { input: inData.input, values: inData.values.slice(0) };
|
|
260349
260483
|
outChannel.data.push(outData);
|
|
260350
260484
|
}
|
|
260351
260485
|
contents.channels.push(outChannel);
|
|
@@ -260360,20 +260494,20 @@ var IModelJson;
|
|
|
260360
260494
|
const params = [];
|
|
260361
260495
|
const colors = [];
|
|
260362
260496
|
{
|
|
260363
|
-
const p =
|
|
260497
|
+
const p = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create();
|
|
260364
260498
|
for (let i = 0; pf.data.point.getPoint3dAtCheckedPointIndex(i, p); i++)
|
|
260365
260499
|
points.push(p.toJSON());
|
|
260366
260500
|
}
|
|
260367
260501
|
if (pf.data.normal) {
|
|
260368
260502
|
const numNormal = pf.data.normal.length;
|
|
260369
|
-
const normal =
|
|
260503
|
+
const normal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create();
|
|
260370
260504
|
for (let i = 0; i < numNormal; i++) {
|
|
260371
260505
|
pf.data.normal.getVector3dAtCheckedVectorIndex(i, normal);
|
|
260372
260506
|
normals.push(normal.toJSON());
|
|
260373
260507
|
}
|
|
260374
260508
|
}
|
|
260375
260509
|
if (pf.data.param) {
|
|
260376
|
-
const uv =
|
|
260510
|
+
const uv = _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_40__.Point2d.create();
|
|
260377
260511
|
for (let i = 0; pf.data.param.getPoint2dAtCheckedPointIndex(i, uv); i++)
|
|
260378
260512
|
params.push(uv.toJSON());
|
|
260379
260513
|
}
|
|
@@ -260444,11 +260578,11 @@ var IModelJson;
|
|
|
260444
260578
|
return { indexedMesh: contents };
|
|
260445
260579
|
}
|
|
260446
260580
|
handleBSplineCurve(curve) {
|
|
260447
|
-
const data =
|
|
260581
|
+
const data = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.createBSplineCurveData(curve.polesRef, curve.poleDimension, curve.knotsRef, curve.numPoles, curve.order);
|
|
260448
260582
|
const wrapMode = curve.getWrappable();
|
|
260449
|
-
if (
|
|
260583
|
+
if (_bspline_KnotVector__WEBPACK_IMPORTED_MODULE_41__.BSplineWrapMode.None !== wrapMode)
|
|
260450
260584
|
data.params.wrapMode = wrapMode;
|
|
260451
|
-
if (!
|
|
260585
|
+
if (!_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.Export.prepareBSplineCurveData(data, { jsonPoles: true, jsonKnots: true }))
|
|
260452
260586
|
return undefined;
|
|
260453
260587
|
return {
|
|
260454
260588
|
bcurve: {
|
|
@@ -260466,7 +260600,7 @@ var IModelJson;
|
|
|
260466
260600
|
/** Convert strongly typed instance to tagged json */
|
|
260467
260601
|
handleInterpolationCurve3d(curve) {
|
|
260468
260602
|
const props = curve.cloneProps();
|
|
260469
|
-
|
|
260603
|
+
_bspline_BSplineCurveOps__WEBPACK_IMPORTED_MODULE_42__.BSplineCurveOps.C2CubicFit.convertToJsonKnots(props);
|
|
260470
260604
|
return { interpolationCurve: props };
|
|
260471
260605
|
}
|
|
260472
260606
|
/** Convert strongly typed instance to tagged json */
|
|
@@ -260515,14 +260649,14 @@ var IModelJson;
|
|
|
260515
260649
|
}
|
|
260516
260650
|
/** Convert strongly typed instance to tagged json */
|
|
260517
260651
|
handleBSplineSurface(surface) {
|
|
260518
|
-
const data =
|
|
260519
|
-
const wrapModeU = surface.getWrappable(
|
|
260520
|
-
const wrapModeV = surface.getWrappable(
|
|
260521
|
-
if (
|
|
260652
|
+
const data = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.createBSplineSurfaceData(surface.coffs, surface.poleDimension, surface.knots[_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.uDirection].knots, surface.numPolesUV(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.uDirection), surface.orderUV(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.uDirection), surface.knots[_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.vDirection].knots, surface.numPolesUV(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.vDirection), surface.orderUV(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.vDirection));
|
|
260653
|
+
const wrapModeU = surface.getWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.uDirection);
|
|
260654
|
+
const wrapModeV = surface.getWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.vDirection);
|
|
260655
|
+
if (_bspline_KnotVector__WEBPACK_IMPORTED_MODULE_41__.BSplineWrapMode.None !== wrapModeU)
|
|
260522
260656
|
data.uParams.wrapMode = wrapModeU;
|
|
260523
|
-
if (
|
|
260657
|
+
if (_bspline_KnotVector__WEBPACK_IMPORTED_MODULE_41__.BSplineWrapMode.None !== wrapModeV)
|
|
260524
260658
|
data.vParams.wrapMode = wrapModeV;
|
|
260525
|
-
if (!
|
|
260659
|
+
if (!_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.Export.prepareBSplineSurfaceData(data, { jsonPoles: true, jsonKnots: true }))
|
|
260526
260660
|
return undefined;
|
|
260527
260661
|
return {
|
|
260528
260662
|
bsurf: {
|
|
@@ -260553,10 +260687,10 @@ var IModelJson;
|
|
|
260553
260687
|
emit(data) {
|
|
260554
260688
|
if (Array.isArray(data))
|
|
260555
260689
|
return this.emitArray(data);
|
|
260556
|
-
if (data instanceof
|
|
260690
|
+
if (data instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_22__.GeometryQuery) {
|
|
260557
260691
|
return data.dispatchToGeometryHandler(this);
|
|
260558
260692
|
}
|
|
260559
|
-
else if (data instanceof
|
|
260693
|
+
else if (data instanceof _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_4__.TaggedNumericData) {
|
|
260560
260694
|
return this.handleTaggedNumericData(data);
|
|
260561
260695
|
}
|
|
260562
260696
|
return undefined;
|
|
@@ -260809,6 +260943,91 @@ var SerializationHelpers;
|
|
|
260809
260943
|
data.vParams.knots = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_0__.NumberArray.pack(data.vParams.knots);
|
|
260810
260944
|
}
|
|
260811
260945
|
}
|
|
260946
|
+
/**
|
|
260947
|
+
* Process 1-based blocked indices into 0-based indices.
|
|
260948
|
+
* @param sourceIndices signed, 1-based, 0-terminated/padded source indices, blocking specified by `numPerBlock`
|
|
260949
|
+
* @param numPerBlock index blocking: fixed blocks of size numPerBlock > 1, possibly 0-padded; otherwise, variable-sized blocks terminated by 0
|
|
260950
|
+
* @param announceZeroBasedIndex callback to receive a 0-based index and optional flag indicating whether the sign of the source index is positive
|
|
260951
|
+
* @param terminateBlock optional callback called after each index block has been announced
|
|
260952
|
+
*/
|
|
260953
|
+
function announceZeroBasedIndicesFromSignedOneBasedIndices(sourceIndices, numPerBlock, announceZeroBasedIndex, terminateBlock) {
|
|
260954
|
+
let numIndices = sourceIndices.length;
|
|
260955
|
+
if (!numIndices)
|
|
260956
|
+
return;
|
|
260957
|
+
if (numPerBlock > 1) {
|
|
260958
|
+
numIndices -= sourceIndices.length % numPerBlock;
|
|
260959
|
+
for (let i = 0; i < numIndices; i++) {
|
|
260960
|
+
const p = sourceIndices[i];
|
|
260961
|
+
if (p !== 0) // skip padding
|
|
260962
|
+
announceZeroBasedIndex(Math.abs(p) - 1, p > 0);
|
|
260963
|
+
if (terminateBlock && ((i + 1) % numPerBlock) === 0)
|
|
260964
|
+
terminateBlock();
|
|
260965
|
+
}
|
|
260966
|
+
}
|
|
260967
|
+
else {
|
|
260968
|
+
for (let i = 0; i < numIndices; i++) {
|
|
260969
|
+
const p = sourceIndices[i];
|
|
260970
|
+
if (p !== 0) // skip terminator
|
|
260971
|
+
announceZeroBasedIndex(Math.abs(p) - 1, p > 0);
|
|
260972
|
+
if (terminateBlock) {
|
|
260973
|
+
if (p === 0) {
|
|
260974
|
+
if (i + 1 === numIndices || sourceIndices[i + 1] !== 0) // skip extra terminators
|
|
260975
|
+
terminateBlock();
|
|
260976
|
+
}
|
|
260977
|
+
else {
|
|
260978
|
+
if (i + 1 === numIndices) // missing last terminator
|
|
260979
|
+
terminateBlock();
|
|
260980
|
+
}
|
|
260981
|
+
}
|
|
260982
|
+
}
|
|
260983
|
+
}
|
|
260984
|
+
}
|
|
260985
|
+
SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices = announceZeroBasedIndicesFromSignedOneBasedIndices;
|
|
260986
|
+
/**
|
|
260987
|
+
* Process 0-based indices with blocking specified by another index array.
|
|
260988
|
+
* @param sourceIndices 0-based source indices. This array is compressed (has no blocking).
|
|
260989
|
+
* @param blockingIndices 1-based source indices, blocking specified by `numPerBlock`. Assumed to have length equal to its zero count plus `sourceIndices.length`.
|
|
260990
|
+
* @param numPerBlock index blocking: fixed blocks of size numPerBlock > 1, possibly 0-padded; otherwise, variable-sized blocks terminated by 0
|
|
260991
|
+
* @param announceZeroBasedIndex callback to receive a 0-based index
|
|
260992
|
+
* @param terminateBlock optional callback called after each index block has been announced
|
|
260993
|
+
*/
|
|
260994
|
+
function announceZeroBasedIndicesWithExternalBlocking(sourceIndices, blockingIndices, numPerBlock, announceZeroBasedIndex, terminateBlock) {
|
|
260995
|
+
if (!sourceIndices.length || !blockingIndices.length)
|
|
260996
|
+
return;
|
|
260997
|
+
const blockingZeroCount = blockingIndices.filter((i) => i === 0).length;
|
|
260998
|
+
if (sourceIndices.length + blockingZeroCount !== blockingIndices.length)
|
|
260999
|
+
return; // invalid input
|
|
261000
|
+
let iSource = 0;
|
|
261001
|
+
let numBlocking = blockingIndices.length;
|
|
261002
|
+
if (numPerBlock > 1) {
|
|
261003
|
+
numBlocking -= blockingIndices.length % numPerBlock;
|
|
261004
|
+
for (let iBlocking = 0; iBlocking < numBlocking && iSource < sourceIndices.length; iBlocking++) {
|
|
261005
|
+
const p = blockingIndices[iBlocking];
|
|
261006
|
+
if (p !== 0) // skip padding
|
|
261007
|
+
announceZeroBasedIndex(sourceIndices[iSource++]);
|
|
261008
|
+
if (terminateBlock && ((iBlocking + 1) % numPerBlock) === 0)
|
|
261009
|
+
terminateBlock();
|
|
261010
|
+
}
|
|
261011
|
+
}
|
|
261012
|
+
else {
|
|
261013
|
+
for (let iBlocking = 0; iBlocking < numBlocking && iSource < sourceIndices.length; iBlocking++) {
|
|
261014
|
+
const p = blockingIndices[iBlocking];
|
|
261015
|
+
if (p !== 0) // skip terminator
|
|
261016
|
+
announceZeroBasedIndex(sourceIndices[iSource++]);
|
|
261017
|
+
if (terminateBlock) {
|
|
261018
|
+
if (p === 0) {
|
|
261019
|
+
if (iBlocking + 1 === numBlocking || blockingIndices[iBlocking + 1] !== 0) // skip extra terminators
|
|
261020
|
+
terminateBlock();
|
|
261021
|
+
}
|
|
261022
|
+
else {
|
|
261023
|
+
if (iBlocking + 1 === numBlocking) // missing last terminator
|
|
261024
|
+
terminateBlock();
|
|
261025
|
+
}
|
|
261026
|
+
}
|
|
261027
|
+
}
|
|
261028
|
+
}
|
|
261029
|
+
}
|
|
261030
|
+
SerializationHelpers.announceZeroBasedIndicesWithExternalBlocking = announceZeroBasedIndicesWithExternalBlocking;
|
|
260812
261031
|
/** Helper class for preparing geometry data for import. */
|
|
260813
261032
|
class Import {
|
|
260814
261033
|
/** copy knots, with options to control destination type and extraneous knot removal */
|
|
@@ -262363,12 +262582,14 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
262363
262582
|
uFractionToRadians(u) {
|
|
262364
262583
|
return u * Math.PI * 2.0;
|
|
262365
262584
|
}
|
|
262585
|
+
/** Constructor CAPTURES inputs */
|
|
262366
262586
|
constructor(localToWorld, latitudeSweep, capped) {
|
|
262367
262587
|
super(capped);
|
|
262368
262588
|
/** String name for schema properties */
|
|
262369
262589
|
this.solidPrimitiveType = "sphere";
|
|
262370
262590
|
this._localToWorld = localToWorld;
|
|
262371
262591
|
this._latitudeSweep = latitudeSweep ? latitudeSweep : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_1__.AngleSweep.createFullLatitude();
|
|
262592
|
+
this._latitudeSweep.capLatitudeInPlace();
|
|
262372
262593
|
}
|
|
262373
262594
|
/** return a deep clone */
|
|
262374
262595
|
clone() {
|
|
@@ -262407,11 +262628,11 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
262407
262628
|
/** Create from center and radius, with optional restricted latitudes. */
|
|
262408
262629
|
static createCenterRadius(center, radius, latitudeSweep) {
|
|
262409
262630
|
const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createOriginAndMatrix(center, _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_3__.Matrix3d.createUniformScale(radius));
|
|
262410
|
-
return new Sphere(localToWorld, latitudeSweep ? latitudeSweep : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_1__.AngleSweep.createFullLatitude(), false);
|
|
262631
|
+
return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_1__.AngleSweep.createFullLatitude(), false);
|
|
262411
262632
|
}
|
|
262412
262633
|
/** Create an ellipsoid which is a unit sphere mapped to position by an (arbitrary, possibly skewed and scaled) transform. */
|
|
262413
262634
|
static createEllipsoid(localToWorld, latitudeSweep, capped) {
|
|
262414
|
-
return new Sphere(localToWorld, latitudeSweep, capped);
|
|
262635
|
+
return new Sphere(localToWorld.clone(), latitudeSweep.clone(), capped);
|
|
262415
262636
|
}
|
|
262416
262637
|
/** Create a sphere from the typical parameters of the Dgn file */
|
|
262417
262638
|
static createDgnSphere(center, vectorX, vectorZ, radiusXY, radiusZ, latitudeSweep, capped) {
|
|
@@ -290008,7 +290229,7 @@ class TestContext {
|
|
|
290008
290229
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
290009
290230
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
290010
290231
|
await core_frontend_1.NoRenderApp.startup({
|
|
290011
|
-
applicationVersion: "4.7.0-dev.
|
|
290232
|
+
applicationVersion: "4.7.0-dev.11",
|
|
290012
290233
|
applicationId: this.settings.gprid,
|
|
290013
290234
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
|
|
290014
290235
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -291930,12 +292151,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
291930
292151
|
/** @packageDocumentation
|
|
291931
292152
|
* @module RPC
|
|
291932
292153
|
*/
|
|
291933
|
-
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
291934
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
291935
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
291936
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
291937
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
291938
|
-
};
|
|
291939
292154
|
|
|
291940
292155
|
|
|
291941
292156
|
/**
|
|
@@ -291950,6 +292165,7 @@ class PresentationRpcInterface extends _itwin_core_common__WEBPACK_IMPORTED_MODU
|
|
|
291950
292165
|
async getNodesCount(_token, _options) {
|
|
291951
292166
|
return this.forward(arguments);
|
|
291952
292167
|
}
|
|
292168
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
291953
292169
|
async getPagedNodes(_token, _options) {
|
|
291954
292170
|
return this.forward(arguments);
|
|
291955
292171
|
}
|
|
@@ -291958,10 +292174,12 @@ class PresentationRpcInterface extends _itwin_core_common__WEBPACK_IMPORTED_MODU
|
|
|
291958
292174
|
return this.forward(arguments);
|
|
291959
292175
|
}
|
|
291960
292176
|
// TODO: add paged version of this (#387280)
|
|
292177
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
291961
292178
|
async getNodePaths(_token, _options) {
|
|
291962
292179
|
return this.forward(arguments);
|
|
291963
292180
|
}
|
|
291964
292181
|
// TODO: add paged version of this (#387280)
|
|
292182
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
291965
292183
|
async getFilteredNodePaths(_token, _options) {
|
|
291966
292184
|
return this.forward(arguments);
|
|
291967
292185
|
}
|
|
@@ -292012,45 +292230,6 @@ class PresentationRpcInterface extends _itwin_core_common__WEBPACK_IMPORTED_MODU
|
|
|
292012
292230
|
PresentationRpcInterface.interfaceName = "PresentationRpcInterface"; // eslint-disable-line @typescript-eslint/naming-convention
|
|
292013
292231
|
/** The semantic version of the interface. */
|
|
292014
292232
|
PresentationRpcInterface.interfaceVersion = "4.1.0";
|
|
292015
|
-
__decorate([
|
|
292016
|
-
_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcOperation.setPolicy({ allowResponseCompression: true })
|
|
292017
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
292018
|
-
], PresentationRpcInterface.prototype, "getPagedNodes", null);
|
|
292019
|
-
__decorate([
|
|
292020
|
-
_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcOperation.setPolicy({ allowResponseCompression: true })
|
|
292021
|
-
], PresentationRpcInterface.prototype, "getNodesDescriptor", null);
|
|
292022
|
-
__decorate([
|
|
292023
|
-
_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcOperation.setPolicy({ allowResponseCompression: true })
|
|
292024
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
292025
|
-
], PresentationRpcInterface.prototype, "getNodePaths", null);
|
|
292026
|
-
__decorate([
|
|
292027
|
-
_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcOperation.setPolicy({ allowResponseCompression: true })
|
|
292028
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
292029
|
-
], PresentationRpcInterface.prototype, "getFilteredNodePaths", null);
|
|
292030
|
-
__decorate([
|
|
292031
|
-
_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcOperation.setPolicy({ allowResponseCompression: true })
|
|
292032
|
-
], PresentationRpcInterface.prototype, "getContentSources", null);
|
|
292033
|
-
__decorate([
|
|
292034
|
-
_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcOperation.setPolicy({ allowResponseCompression: true })
|
|
292035
|
-
], PresentationRpcInterface.prototype, "getContentDescriptor", null);
|
|
292036
|
-
__decorate([
|
|
292037
|
-
_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcOperation.setPolicy({ allowResponseCompression: true })
|
|
292038
|
-
], PresentationRpcInterface.prototype, "getPagedContent", null);
|
|
292039
|
-
__decorate([
|
|
292040
|
-
_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcOperation.setPolicy({ allowResponseCompression: true })
|
|
292041
|
-
], PresentationRpcInterface.prototype, "getPagedContentSet", null);
|
|
292042
|
-
__decorate([
|
|
292043
|
-
_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcOperation.setPolicy({ allowResponseCompression: true })
|
|
292044
|
-
], PresentationRpcInterface.prototype, "getElementProperties", null);
|
|
292045
|
-
__decorate([
|
|
292046
|
-
_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcOperation.setPolicy({ allowResponseCompression: true })
|
|
292047
|
-
], PresentationRpcInterface.prototype, "getPagedDistinctValues", null);
|
|
292048
|
-
__decorate([
|
|
292049
|
-
_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcOperation.setPolicy({ allowResponseCompression: true })
|
|
292050
|
-
], PresentationRpcInterface.prototype, "getPagedDisplayLabelDefinitions", null);
|
|
292051
|
-
__decorate([
|
|
292052
|
-
_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcOperation.setPolicy({ allowResponseCompression: true })
|
|
292053
|
-
], PresentationRpcInterface.prototype, "computeSelection", null);
|
|
292054
292233
|
/** @internal */
|
|
292055
292234
|
var PresentationIpcEvents;
|
|
292056
292235
|
(function (PresentationIpcEvents) {
|
|
@@ -314045,7 +314224,7 @@ function __disposeResources(env) {
|
|
|
314045
314224
|
/***/ ((module) => {
|
|
314046
314225
|
|
|
314047
314226
|
"use strict";
|
|
314048
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.7.0-dev.
|
|
314227
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.7.0-dev.11","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.7.0-dev.11","@itwin/core-bentley":"workspace:^4.7.0-dev.11","@itwin/core-common":"workspace:^4.7.0-dev.11","@itwin/core-geometry":"workspace:^4.7.0-dev.11","@itwin/core-orbitgt":"workspace:^4.7.0-dev.11","@itwin/core-quantity":"workspace:^4.7.0-dev.11"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"^4.0.2","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^10.0.6","@types/sinon":"^17.0.2","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","cpx2":"^3.0.0","eslint":"^8.56.0","glob":"^10.3.12","mocha":"^10.2.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^17.0.1","source-map-loader":"^4.0.0","typescript":"~5.3.3","typemoq":"^2.1.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.2.2","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","meshoptimizer":"~0.20.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
|
|
314049
314228
|
|
|
314050
314229
|
/***/ }),
|
|
314051
314230
|
|