@itwin/rpcinterface-full-stack-tests 4.10.0-dev.18 → 4.10.0-dev.20
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 +410 -288
- 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 +13 -13
|
@@ -39398,29 +39398,107 @@ function copyIdSetToUint32Set(dst, src) {
|
|
|
39398
39398
|
dst.addId(id);
|
|
39399
39399
|
}
|
|
39400
39400
|
}
|
|
39401
|
+
function propsMatchDefaults(props) {
|
|
39402
|
+
return !props.rgb && !props.lineRgb
|
|
39403
|
+
&& undefined === props.weight && undefined === props.linePixels
|
|
39404
|
+
&& undefined === props.transparency && undefined === props.lineTransparency
|
|
39405
|
+
&& !props.ignoresMaterial && !props.nonLocatable && !props.emphasized;
|
|
39406
|
+
}
|
|
39407
|
+
function equalRgb(a, b) {
|
|
39408
|
+
if (a === b) {
|
|
39409
|
+
return true;
|
|
39410
|
+
}
|
|
39411
|
+
else if (!a || !b) {
|
|
39412
|
+
return false;
|
|
39413
|
+
}
|
|
39414
|
+
else {
|
|
39415
|
+
return a.equals(b);
|
|
39416
|
+
}
|
|
39417
|
+
}
|
|
39418
|
+
function equalLineRgb(a, b) {
|
|
39419
|
+
if (a === b) {
|
|
39420
|
+
return true;
|
|
39421
|
+
}
|
|
39422
|
+
else if (a instanceof _RgbColor__WEBPACK_IMPORTED_MODULE_3__.RgbColor && b instanceof _RgbColor__WEBPACK_IMPORTED_MODULE_3__.RgbColor) {
|
|
39423
|
+
return equalRgb(a, b);
|
|
39424
|
+
}
|
|
39425
|
+
else {
|
|
39426
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(a === undefined || a === false);
|
|
39427
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(b === undefined || b === false);
|
|
39428
|
+
return false;
|
|
39429
|
+
}
|
|
39430
|
+
}
|
|
39431
|
+
function equalTransparency(a, b) {
|
|
39432
|
+
if (a === b) {
|
|
39433
|
+
return true;
|
|
39434
|
+
}
|
|
39435
|
+
else if (undefined === a || undefined === b) {
|
|
39436
|
+
return false;
|
|
39437
|
+
}
|
|
39438
|
+
else {
|
|
39439
|
+
return Math.floor(a * 0xff) === Math.floor(b * 0xff);
|
|
39440
|
+
}
|
|
39441
|
+
}
|
|
39442
|
+
function equalLineTransparency(a, b) {
|
|
39443
|
+
if (a === b) {
|
|
39444
|
+
return true;
|
|
39445
|
+
}
|
|
39446
|
+
else if (typeof a === "number" && typeof b === "number") {
|
|
39447
|
+
return equalTransparency(a, b);
|
|
39448
|
+
}
|
|
39449
|
+
else {
|
|
39450
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(a === undefined || a === false);
|
|
39451
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(b === undefined || b === false);
|
|
39452
|
+
return false;
|
|
39453
|
+
}
|
|
39454
|
+
}
|
|
39455
|
+
function transparencyFromJSON(transp) {
|
|
39456
|
+
if (undefined === transp) {
|
|
39457
|
+
return undefined;
|
|
39458
|
+
}
|
|
39459
|
+
transp = Math.max(0, Math.min(transp, 1));
|
|
39460
|
+
// Fix up rounding errors...
|
|
39461
|
+
const smallDelta = 0.0001;
|
|
39462
|
+
if (1.0 - transp < smallDelta) {
|
|
39463
|
+
transp = 1.0;
|
|
39464
|
+
}
|
|
39465
|
+
else if (transp < smallDelta) {
|
|
39466
|
+
transp = 0.0;
|
|
39467
|
+
}
|
|
39468
|
+
return transp;
|
|
39469
|
+
}
|
|
39401
39470
|
/** Defines overrides for selected aspects of a [[Feature]]'s symbology.
|
|
39402
39471
|
* Any member defined in the appearance overrides that aspect of symbology for all [[Feature]]s to which the appearance is applied.
|
|
39472
|
+
*
|
|
39473
|
+
* The [[rgb]] and [[transparency]] overrides, if defined, apply to all geometry by default.
|
|
39474
|
+
* However, the color and transparency of "linear" geometry can optionally be controlled independently from the rest of the geometry via [[lineRgb]] and [[lineTransparency]].
|
|
39475
|
+
* Linear geometry consists of any of the following:
|
|
39476
|
+
* - Curves and line strings;
|
|
39477
|
+
* - Points and point strings; and
|
|
39478
|
+
* - The outlines of planar regions.
|
|
39479
|
+
* The edges of 3d surfaces like spheres are not considered linear geometry.
|
|
39480
|
+
*
|
|
39403
39481
|
* @see [[FeatureOverrides]] to customize the appearance of multiple features.
|
|
39404
39482
|
* @public
|
|
39405
39483
|
*/
|
|
39406
39484
|
class FeatureAppearance {
|
|
39407
39485
|
static fromJSON(props) {
|
|
39408
|
-
if (
|
|
39486
|
+
if (!props || propsMatchDefaults(props)) {
|
|
39409
39487
|
return this.defaults;
|
|
39410
|
-
|
|
39411
|
-
|
|
39488
|
+
}
|
|
39489
|
+
return new FeatureAppearance(props);
|
|
39412
39490
|
}
|
|
39413
39491
|
/** Create a FeatureAppearance that overrides only the RGB color.
|
|
39414
39492
|
* @note The transparency component of the ColorDef is ignored.
|
|
39415
39493
|
*/
|
|
39416
39494
|
static fromRgb(color) {
|
|
39417
|
-
return
|
|
39495
|
+
return new FeatureAppearance({ rgb: _RgbColor__WEBPACK_IMPORTED_MODULE_3__.RgbColor.fromColorDef(color) });
|
|
39418
39496
|
}
|
|
39419
39497
|
/** Create a FeatureAppearance that overrides the RGB and transparency.
|
|
39420
39498
|
* The appearance's transparency is derived from the transparency component of the ColorDef.
|
|
39421
39499
|
*/
|
|
39422
39500
|
static fromRgba(color, viewDependentTransparency = false) {
|
|
39423
|
-
return
|
|
39501
|
+
return new FeatureAppearance({
|
|
39424
39502
|
rgb: _RgbColor__WEBPACK_IMPORTED_MODULE_3__.RgbColor.fromColorDef(color),
|
|
39425
39503
|
transparency: color.colors.t / 255,
|
|
39426
39504
|
viewDependentTransparency: viewDependentTransparency ? true : undefined,
|
|
@@ -39428,7 +39506,7 @@ class FeatureAppearance {
|
|
|
39428
39506
|
}
|
|
39429
39507
|
/** Create a FeatureAppearance that overrides only the transparency */
|
|
39430
39508
|
static fromTransparency(transparencyValue, viewDependent = false) {
|
|
39431
|
-
return
|
|
39509
|
+
return new FeatureAppearance({
|
|
39432
39510
|
transparency: transparencyValue,
|
|
39433
39511
|
viewDependentTransparency: viewDependent ? true : undefined,
|
|
39434
39512
|
});
|
|
@@ -39451,25 +39529,44 @@ class FeatureAppearance {
|
|
|
39451
39529
|
get overridesTransparency() { return undefined !== this.transparency; }
|
|
39452
39530
|
get overridesLinePixels() { return undefined !== this.linePixels; }
|
|
39453
39531
|
get overridesWeight() { return undefined !== this.weight; }
|
|
39532
|
+
/** Get the color that will be applied to linear geometry, or undefined if not overridden.
|
|
39533
|
+
* This is the same as [[rgb]] if [[lineRgb]] is `undefined`.
|
|
39534
|
+
*/
|
|
39535
|
+
getLineRgb() {
|
|
39536
|
+
return false !== this.lineRgb ? (this.lineRgb ?? this.rgb) : undefined;
|
|
39537
|
+
}
|
|
39538
|
+
/** Get the transparency that will be applied to linear geometry, or undefined if not overridden.
|
|
39539
|
+
* This is the same as [[transparency]] if [[lineTransparency]] is `undefined`.
|
|
39540
|
+
*/
|
|
39541
|
+
getLineTransparency() {
|
|
39542
|
+
return false !== this.lineTransparency ? (this.lineTransparency ?? this.transparency) : undefined;
|
|
39543
|
+
}
|
|
39454
39544
|
get overridesSymbology() {
|
|
39455
39545
|
return this.overridesRgb || this.overridesTransparency || this.overridesWeight || this.overridesLinePixels || !!this.ignoresMaterial
|
|
39456
|
-
|| this.emphasized || this.overridesNonLocatable
|
|
39546
|
+
|| this.emphasized || this.overridesNonLocatable
|
|
39547
|
+
|| undefined !== this.getLineRgb() || undefined !== this.getLineTransparency();
|
|
39457
39548
|
}
|
|
39458
39549
|
get overridesNonLocatable() { return undefined !== this.nonLocatable; }
|
|
39459
|
-
get isFullyTransparent() {
|
|
39550
|
+
get isFullyTransparent() {
|
|
39551
|
+
const surf = this.transparency ?? 0;
|
|
39552
|
+
const line = this.getLineTransparency() ?? 0;
|
|
39553
|
+
return surf >= 1 && line >= 1;
|
|
39554
|
+
}
|
|
39460
39555
|
/** Returns true if any aspect of the appearance is overridden (i.e., if any member is not undefined). */
|
|
39461
39556
|
get anyOverridden() { return this.overridesSymbology || this.overridesNonLocatable; }
|
|
39462
39557
|
equals(other) {
|
|
39463
39558
|
if (this === other)
|
|
39464
39559
|
return true;
|
|
39465
|
-
return this.
|
|
39560
|
+
return equalRgb(this.rgb, other.rgb)
|
|
39466
39561
|
&& this.weight === other.weight
|
|
39467
|
-
&& this.
|
|
39562
|
+
&& equalTransparency(this.transparency, other.transparency)
|
|
39468
39563
|
&& this.linePixels === other.linePixels
|
|
39469
39564
|
&& this.ignoresMaterial === other.ignoresMaterial
|
|
39470
39565
|
&& this.nonLocatable === other.nonLocatable
|
|
39471
39566
|
&& this.emphasized === other.emphasized
|
|
39472
|
-
&& this.viewDependentTransparency === other.viewDependentTransparency
|
|
39567
|
+
&& this.viewDependentTransparency === other.viewDependentTransparency
|
|
39568
|
+
&& equalLineTransparency(this.lineTransparency, other.lineTransparency)
|
|
39569
|
+
&& equalLineRgb(this.lineRgb, other.lineRgb);
|
|
39473
39570
|
}
|
|
39474
39571
|
toJSON() {
|
|
39475
39572
|
const props = {};
|
|
@@ -39490,6 +39587,13 @@ class FeatureAppearance {
|
|
|
39490
39587
|
props.nonLocatable = true;
|
|
39491
39588
|
if (true === this.emphasized)
|
|
39492
39589
|
props.emphasized = true;
|
|
39590
|
+
if (undefined !== this.lineTransparency)
|
|
39591
|
+
props.lineTransparency = this.lineTransparency;
|
|
39592
|
+
if (this.lineRgb) {
|
|
39593
|
+
props.lineRgb = this.lineRgb;
|
|
39594
|
+
if (this.viewDependentTransparency)
|
|
39595
|
+
props.viewDependentTransparency = true;
|
|
39596
|
+
}
|
|
39493
39597
|
return props;
|
|
39494
39598
|
}
|
|
39495
39599
|
/** Convert this appearance to JSON, and override any properties explicitly specified by `changedProps` in the result.
|
|
@@ -39536,47 +39640,30 @@ class FeatureAppearance {
|
|
|
39536
39640
|
props.nonLocatable = true;
|
|
39537
39641
|
if (undefined === props.emphasized && this.emphasized)
|
|
39538
39642
|
props.emphasized = true;
|
|
39539
|
-
if (
|
|
39643
|
+
if (!props.lineRgb)
|
|
39644
|
+
props.lineRgb = this.lineRgb;
|
|
39645
|
+
if (undefined === props.lineTransparency)
|
|
39646
|
+
props.lineTransparency = this.lineTransparency;
|
|
39647
|
+
if (this.viewDependentTransparency && (undefined !== props.transparency || undefined !== props.lineTransparency))
|
|
39540
39648
|
props.viewDependentTransparency = true;
|
|
39541
39649
|
return FeatureAppearance.fromJSON(props);
|
|
39542
39650
|
}
|
|
39543
39651
|
constructor(props) {
|
|
39544
39652
|
this.rgb = undefined !== props.rgb ? _RgbColor__WEBPACK_IMPORTED_MODULE_3__.RgbColor.fromJSON(props.rgb) : undefined;
|
|
39653
|
+
this.lineRgb = typeof props.lineRgb === "object" ? _RgbColor__WEBPACK_IMPORTED_MODULE_3__.RgbColor.fromJSON(props.lineRgb) : (false === props.lineRgb ? false : undefined);
|
|
39654
|
+
this.transparency = transparencyFromJSON(props.transparency);
|
|
39655
|
+
this.lineTransparency = typeof props.lineTransparency === "number" ? transparencyFromJSON(props.lineTransparency) : (false === props.lineTransparency ? false : undefined);
|
|
39545
39656
|
this.weight = props.weight;
|
|
39546
|
-
this.transparency = props.transparency;
|
|
39547
39657
|
this.linePixels = props.linePixels;
|
|
39548
39658
|
this.ignoresMaterial = props.ignoresMaterial;
|
|
39549
39659
|
this.nonLocatable = props.nonLocatable;
|
|
39550
39660
|
this.emphasized = props.emphasized;
|
|
39551
|
-
if (undefined !== this.weight)
|
|
39661
|
+
if (undefined !== this.weight) {
|
|
39552
39662
|
this.weight = Math.max(1, Math.min(this.weight, 32));
|
|
39553
|
-
|
|
39554
|
-
|
|
39555
|
-
|
|
39556
|
-
|
|
39557
|
-
// Fix up rounding errors...
|
|
39558
|
-
const smallDelta = 0.0001;
|
|
39559
|
-
if (1.0 - this.transparency < smallDelta)
|
|
39560
|
-
this.transparency = 1.0;
|
|
39561
|
-
else if (this.transparency < smallDelta)
|
|
39562
|
-
this.transparency = 0.0;
|
|
39563
|
-
}
|
|
39564
|
-
}
|
|
39565
|
-
rgbIsEqual(rgb) {
|
|
39566
|
-
if (undefined === this.rgb)
|
|
39567
|
-
return undefined === rgb;
|
|
39568
|
-
else if (undefined === rgb)
|
|
39569
|
-
return false;
|
|
39570
|
-
else
|
|
39571
|
-
return this.rgb.equals(rgb);
|
|
39572
|
-
}
|
|
39573
|
-
transparencyIsEqual(transp) {
|
|
39574
|
-
if (undefined === this.transparency)
|
|
39575
|
-
return undefined === transp;
|
|
39576
|
-
else if (undefined === transp)
|
|
39577
|
-
return false;
|
|
39578
|
-
else
|
|
39579
|
-
return Math.floor(this.transparency * 0xff) === Math.floor(transp * 0xff);
|
|
39663
|
+
}
|
|
39664
|
+
if (props.viewDependentTransparency && (undefined !== this.transparency || undefined !== this.getLineTransparency())) {
|
|
39665
|
+
this.viewDependentTransparency = true;
|
|
39666
|
+
}
|
|
39580
39667
|
}
|
|
39581
39668
|
}
|
|
39582
39669
|
/** An appearance that overrides nothing. */
|
|
@@ -116193,8 +116280,8 @@ class RenderSystem {
|
|
|
116193
116280
|
*/
|
|
116194
116281
|
createSkyBox(_params) { return undefined; }
|
|
116195
116282
|
/** Create a RenderGraphic consisting of a list of Graphics, with optional transform and symbology overrides applied to the list */
|
|
116196
|
-
createBranch(branch, transform) {
|
|
116197
|
-
return this.createGraphicBranch(branch, transform);
|
|
116283
|
+
createBranch(branch, transform, options) {
|
|
116284
|
+
return this.createGraphicBranch(branch, transform, options);
|
|
116198
116285
|
}
|
|
116199
116286
|
/** Create a node in the scene graph corresponding to a transform node in the scene's schedule script.
|
|
116200
116287
|
* Nodes under this branch will only be drawn if they belong to the specified transform node.
|
|
@@ -118175,6 +118262,7 @@ class BranchState {
|
|
|
118175
118262
|
get realityModelDisplaySettings() { return this._opts.realityModelDisplaySettings; }
|
|
118176
118263
|
get viewAttachmentId() { return this._opts.viewAttachmentId; }
|
|
118177
118264
|
get groupNodeId() { return this._opts.groupNodeId; }
|
|
118265
|
+
get disableClipStyle() { return this._opts.disableClipStyle; }
|
|
118178
118266
|
get symbologyOverrides() {
|
|
118179
118267
|
return this._opts.symbologyOverrides;
|
|
118180
118268
|
}
|
|
@@ -118207,6 +118295,7 @@ class BranchState {
|
|
|
118207
118295
|
realityModelDisplaySettings: branch.branch.realityModelDisplaySettings ?? prev.realityModelDisplaySettings,
|
|
118208
118296
|
viewAttachmentId: branch.viewAttachmentId ?? prev.viewAttachmentId,
|
|
118209
118297
|
groupNodeId: branch.branch.groupNodeId ?? prev.groupNodeId,
|
|
118298
|
+
disableClipStyle: branch.disableClipStyle ?? prev.disableClipStyle,
|
|
118210
118299
|
});
|
|
118211
118300
|
}
|
|
118212
118301
|
getFeatureAppearance(overrides, elemLo, elemHi, subcatLo, subcatHi, geomClass, modelLo, modelHi, type, animationNodeId) {
|
|
@@ -118259,6 +118348,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
118259
118348
|
/* harmony import */ var _RenderCommands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./RenderCommands */ "../../core/frontend/lib/esm/render/webgl/RenderCommands.js");
|
|
118260
118349
|
/* harmony import */ var _Sync__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Sync */ "../../core/frontend/lib/esm/render/webgl/Sync.js");
|
|
118261
118350
|
/* harmony import */ var _ClipStack__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ClipStack */ "../../core/frontend/lib/esm/render/webgl/ClipStack.js");
|
|
118351
|
+
/* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
|
|
118262
118352
|
/*---------------------------------------------------------------------------------------------
|
|
118263
118353
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
118264
118354
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -118274,6 +118364,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
118274
118364
|
|
|
118275
118365
|
|
|
118276
118366
|
|
|
118367
|
+
|
|
118277
118368
|
function equalXYZs(a, b) {
|
|
118278
118369
|
if (a === b)
|
|
118279
118370
|
return true;
|
|
@@ -118330,6 +118421,7 @@ class BranchUniforms {
|
|
|
118330
118421
|
pushBranch(branch) {
|
|
118331
118422
|
(0,_Sync__WEBPACK_IMPORTED_MODULE_6__.desync)(this);
|
|
118332
118423
|
this._stack.pushBranch(branch);
|
|
118424
|
+
this.setClipStyle(this.top.disableClipStyle);
|
|
118333
118425
|
if (this.top.clipVolume)
|
|
118334
118426
|
this.clipStack.push(this.top.clipVolume);
|
|
118335
118427
|
if (branch.branch.realityModelDisplaySettings)
|
|
@@ -118348,6 +118440,7 @@ class BranchUniforms {
|
|
|
118348
118440
|
if (this.top.clipVolume)
|
|
118349
118441
|
this.clipStack.pop();
|
|
118350
118442
|
this._stack.pop();
|
|
118443
|
+
this.setClipStyle(this.top.disableClipStyle);
|
|
118351
118444
|
}
|
|
118352
118445
|
pushViewClip() {
|
|
118353
118446
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!this._viewClipEnabled);
|
|
@@ -118457,6 +118550,16 @@ class BranchUniforms {
|
|
|
118457
118550
|
}
|
|
118458
118551
|
return true;
|
|
118459
118552
|
}
|
|
118553
|
+
// set the clip style based on disableClipStyle
|
|
118554
|
+
setClipStyle(disableClipStyle) {
|
|
118555
|
+
const vp = _IModelApp__WEBPACK_IMPORTED_MODULE_8__.IModelApp.viewManager.selectedView;
|
|
118556
|
+
if (vp) {
|
|
118557
|
+
const style = vp.view.displayStyle.settings.clipStyle;
|
|
118558
|
+
this.clipStack.insideColor.alpha = disableClipStyle ? 0 : (style.insideColor ? 1 : 0);
|
|
118559
|
+
this.clipStack.outsideColor.alpha = disableClipStyle ? 0 : (style.outsideColor ? 1 : 0);
|
|
118560
|
+
this.clipStack.intersectionStyle.alpha = disableClipStyle ? 0 : (style.intersectionStyle ? style.intersectionStyle.width : 0);
|
|
118561
|
+
}
|
|
118562
|
+
}
|
|
118460
118563
|
}
|
|
118461
118564
|
|
|
118462
118565
|
|
|
@@ -120833,7 +120936,7 @@ class EdgeSettings {
|
|
|
120833
120936
|
if (!this.isOverridden(vf))
|
|
120834
120937
|
return 0 /* OvrFlags.None */;
|
|
120835
120938
|
// Alpha always overridden - transparent edges only supported in wireframe mode.
|
|
120836
|
-
let flags = this.getColor(vf) ? 6 /* OvrFlags.Rgba */ : 4 /* OvrFlags.Alpha
|
|
120939
|
+
let flags = this.getColor(vf) ? (6 /* OvrFlags.Rgba */ | 1 /* OvrFlags.LineRgb */ | 8 /* OvrFlags.LineAlpha */) : (4 /* OvrFlags.Alpha */ | 8 /* OvrFlags.LineAlpha */);
|
|
120837
120940
|
if (undefined !== this.getLineCode(pass, vf))
|
|
120838
120941
|
flags |= 64 /* OvrFlags.LineCode */;
|
|
120839
120942
|
if (undefined !== this.getWeight(pass, vf))
|
|
@@ -120959,7 +121062,7 @@ class FeatureOverrides {
|
|
|
120959
121062
|
/** For tests. */
|
|
120960
121063
|
get lutData() { return this._lut?.dataBytes; }
|
|
120961
121064
|
get byteLength() { return undefined !== this._lut ? this._lut.bytesUsed : 0; }
|
|
120962
|
-
get isUniform() { return
|
|
121065
|
+
get isUniform() { return 3 === this._lutParams[0] && 1 === this._lutParams[1]; }
|
|
120963
121066
|
updateUniformSymbologyFlags() {
|
|
120964
121067
|
this._uniformSymbologyFlags = 0 /* EmphasisFlags.None */;
|
|
120965
121068
|
if (!this.isUniform || !this._lut)
|
|
@@ -120985,7 +121088,7 @@ class FeatureOverrides {
|
|
|
120985
121088
|
}
|
|
120986
121089
|
_initialize(map, ovrs, pickExcludes, hilite, flashed) {
|
|
120987
121090
|
const nFeatures = map.numFeatures;
|
|
120988
|
-
const dims = computeWidthAndHeight(nFeatures,
|
|
121091
|
+
const dims = computeWidthAndHeight(nFeatures, 3);
|
|
120989
121092
|
const width = dims.width;
|
|
120990
121093
|
const height = dims.height;
|
|
120991
121094
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(width * height >= nFeatures);
|
|
@@ -121007,6 +121110,25 @@ class FeatureOverrides {
|
|
|
121007
121110
|
}
|
|
121008
121111
|
lut.update(updater);
|
|
121009
121112
|
}
|
|
121113
|
+
setTransparency(transparency, viewDependentTransparency, data, transparencyByteIndex, curFlags) {
|
|
121114
|
+
// transparency in range [0, 1]...convert to byte and invert so 0=transparent...
|
|
121115
|
+
let alpha = 1.0 - transparency;
|
|
121116
|
+
alpha = Math.floor(0xff * alpha + 0.5);
|
|
121117
|
+
if ((0xff - alpha) < _common_internal_render_DisplayParams__WEBPACK_IMPORTED_MODULE_8__.DisplayParams.minTransparency)
|
|
121118
|
+
alpha = 0xff;
|
|
121119
|
+
data.setByteAtIndex(transparencyByteIndex, alpha);
|
|
121120
|
+
if (0xff === alpha) {
|
|
121121
|
+
this._anyOpaque = true;
|
|
121122
|
+
}
|
|
121123
|
+
else {
|
|
121124
|
+
this._anyTranslucent = true;
|
|
121125
|
+
if (!viewDependentTransparency) {
|
|
121126
|
+
curFlags |= 1024 /* OvrFlags.ViewIndependentTransparency */;
|
|
121127
|
+
this._anyViewIndependentTranslucent = true;
|
|
121128
|
+
}
|
|
121129
|
+
}
|
|
121130
|
+
return curFlags;
|
|
121131
|
+
}
|
|
121010
121132
|
buildLookupTable(data, map, ovr, pickExclude, flashedIdParts, hilites) {
|
|
121011
121133
|
const allowHilite = true !== this._options.noHilite;
|
|
121012
121134
|
const allowFlash = true !== this._options.noFlash;
|
|
@@ -121016,7 +121138,7 @@ class FeatureOverrides {
|
|
|
121016
121138
|
this._anyOpaque = this._anyTranslucent = this._anyViewIndependentTranslucent = this._anyHilited = false;
|
|
121017
121139
|
let nHidden = 0;
|
|
121018
121140
|
let nOverridden = 0;
|
|
121019
|
-
// NB: We currently use
|
|
121141
|
+
// NB: We currently use 3 RGBA values per feature as follows:
|
|
121020
121142
|
// [0]
|
|
121021
121143
|
// RG = override flags (see OvrFlags enum)
|
|
121022
121144
|
// B = line code
|
|
@@ -121024,9 +121146,12 @@ class FeatureOverrides {
|
|
|
121024
121146
|
// [1]
|
|
121025
121147
|
// RGB = rgb
|
|
121026
121148
|
// A = alpha
|
|
121149
|
+
// [2]
|
|
121150
|
+
// RGB = line rgb
|
|
121151
|
+
// A = line alpha
|
|
121027
121152
|
for (const feature of map.iterable(scratchPackedFeature)) {
|
|
121028
121153
|
const i = feature.index;
|
|
121029
|
-
const dataIndex = i * 4 *
|
|
121154
|
+
const dataIndex = i * 4 * 3;
|
|
121030
121155
|
if (prevModelId.lower !== feature.modelId.lower || prevModelId.upper !== feature.modelId.upper) {
|
|
121031
121156
|
prevModelId.lower = feature.modelId.lower;
|
|
121032
121157
|
prevModelId.upper = feature.modelId.upper;
|
|
@@ -121039,7 +121164,7 @@ class FeatureOverrides {
|
|
|
121039
121164
|
// (The latter is how we clip the classified model using the classifiers).
|
|
121040
121165
|
if (undefined === app) {
|
|
121041
121166
|
// The feature is not visible. We don't care about any of the other overrides, because we're not going to render it.
|
|
121042
|
-
data.setOvrFlagsAtIndex(dataIndex,
|
|
121167
|
+
data.setOvrFlagsAtIndex(dataIndex, 4096 /* OvrFlags.Visibility */);
|
|
121043
121168
|
nHidden++;
|
|
121044
121169
|
nOverridden++;
|
|
121045
121170
|
continue;
|
|
@@ -121061,23 +121186,20 @@ class FeatureOverrides {
|
|
|
121061
121186
|
data.setByteAtIndex(dataIndex + 6, rgb.b);
|
|
121062
121187
|
}
|
|
121063
121188
|
if (undefined !== app.transparency) {
|
|
121064
|
-
// transparency in range [0, 1]...convert to byte and invert so 0=transparent...
|
|
121065
121189
|
flags |= 4 /* OvrFlags.Alpha */;
|
|
121066
|
-
|
|
121067
|
-
|
|
121068
|
-
|
|
121069
|
-
|
|
121070
|
-
|
|
121071
|
-
|
|
121072
|
-
|
|
121073
|
-
|
|
121074
|
-
|
|
121075
|
-
|
|
121076
|
-
|
|
121077
|
-
|
|
121078
|
-
|
|
121079
|
-
}
|
|
121080
|
-
}
|
|
121190
|
+
flags = this.setTransparency(app.transparency, app.viewDependentTransparency, data, dataIndex + 7, flags);
|
|
121191
|
+
}
|
|
121192
|
+
const lineRgb = app.getLineRgb();
|
|
121193
|
+
if (lineRgb) {
|
|
121194
|
+
flags |= 1 /* OvrFlags.LineRgb */;
|
|
121195
|
+
data.setByteAtIndex(dataIndex + 8, lineRgb.r);
|
|
121196
|
+
data.setByteAtIndex(dataIndex + 9, lineRgb.g);
|
|
121197
|
+
data.setByteAtIndex(dataIndex + 10, lineRgb.b);
|
|
121198
|
+
}
|
|
121199
|
+
const lineTransp = app.getLineTransparency();
|
|
121200
|
+
if (undefined !== lineTransp) {
|
|
121201
|
+
flags |= 8 /* OvrFlags.LineAlpha */;
|
|
121202
|
+
flags = this.setTransparency(lineTransp, app.viewDependentTransparency, data, dataIndex + 11, flags);
|
|
121081
121203
|
}
|
|
121082
121204
|
if (app.overridesWeight && app.weight) {
|
|
121083
121205
|
flags |= 128 /* OvrFlags.Weight */;
|
|
@@ -121092,7 +121214,7 @@ class FeatureOverrides {
|
|
|
121092
121214
|
data.setByteAtIndex(dataIndex + 2, lineCode);
|
|
121093
121215
|
}
|
|
121094
121216
|
if (app.ignoresMaterial)
|
|
121095
|
-
flags |=
|
|
121217
|
+
flags |= 8192 /* OvrFlags.IgnoreMaterial */;
|
|
121096
121218
|
if (allowFlash && undefined !== flashedIdParts && feature.elementId.lower === flashedIdParts.lower && feature.elementId.upper === flashedIdParts.upper)
|
|
121097
121219
|
flags |= 16 /* OvrFlags.Flashed */;
|
|
121098
121220
|
if (pickExclude?.hasPair(feature.elementId)) {
|
|
@@ -121117,9 +121239,9 @@ class FeatureOverrides {
|
|
|
121117
121239
|
const intersect = "intersection" === hilites.modelSubCategoryMode;
|
|
121118
121240
|
this._anyOverridden = this._anyHilited = false;
|
|
121119
121241
|
for (const feature of map.iterable(scratchPackedFeature)) {
|
|
121120
|
-
const dataIndex = feature.index * 4 *
|
|
121242
|
+
const dataIndex = feature.index * 4 * 3;
|
|
121121
121243
|
const oldFlags = data.getOvrFlagsAtIndex(dataIndex);
|
|
121122
|
-
if (0 /* OvrFlags.None */ !== (oldFlags &
|
|
121244
|
+
if (0 /* OvrFlags.None */ !== (oldFlags & 4096 /* OvrFlags.Visibility */)) {
|
|
121123
121245
|
// If it's invisible, none of the other flags matter. We can't flash it and don't want to hilite it.
|
|
121124
121246
|
this._anyOverridden = true;
|
|
121125
121247
|
continue;
|
|
@@ -121153,9 +121275,9 @@ class FeatureOverrides {
|
|
|
121153
121275
|
this._anyOverridden = false;
|
|
121154
121276
|
const elemId = { lower: 0, upper: 0 };
|
|
121155
121277
|
for (let i = 0; i < map.numFeatures; i++) {
|
|
121156
|
-
const dataIndex = i * 4 *
|
|
121278
|
+
const dataIndex = i * 4 * 3;
|
|
121157
121279
|
const oldFlags = data.getOvrFlagsAtIndex(dataIndex);
|
|
121158
|
-
if (0 /* OvrFlags.None */ !== (oldFlags &
|
|
121280
|
+
if (0 /* OvrFlags.None */ !== (oldFlags & 4096 /* OvrFlags.Visibility */)) {
|
|
121159
121281
|
// If it's invisible, none of the other flags matter and we can't flash it.
|
|
121160
121282
|
this._anyOverridden = true;
|
|
121161
121283
|
continue;
|
|
@@ -122640,6 +122762,7 @@ class Branch extends Graphic {
|
|
|
122640
122762
|
this.iModel = opts.iModel;
|
|
122641
122763
|
this.frustum = opts.frustum;
|
|
122642
122764
|
this.viewAttachmentId = opts.viewAttachmentId;
|
|
122765
|
+
this.disableClipStyle = opts.disableClipStyle;
|
|
122643
122766
|
this.transformFromExternalIModel = opts.transformFromIModel;
|
|
122644
122767
|
if (opts.hline)
|
|
122645
122768
|
this.edgeSettings = _EdgeSettings__WEBPACK_IMPORTED_MODULE_6__.EdgeSettings.create(opts.hline);
|
|
@@ -126467,7 +126590,7 @@ class RealityMeshGeometry extends _CachedGeometry__WEBPACK_IMPORTED_MODULE_7__.I
|
|
|
126467
126590
|
const primitive = _Primitive__WEBPACK_IMPORTED_MODULE_10__.Primitive.create(mesh);
|
|
126468
126591
|
branch.add(system.createBatch(primitive, featureTable, mesh.getRange(), { tileId }));
|
|
126469
126592
|
}
|
|
126470
|
-
return system.createBranch(branch, realityMesh._transform ? realityMesh._transform : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity());
|
|
126593
|
+
return system.createBranch(branch, realityMesh._transform ? realityMesh._transform : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity(), { disableClipStyle: params.disableClipStyle });
|
|
126471
126594
|
}
|
|
126472
126595
|
collectStatistics(stats) {
|
|
126473
126596
|
this._isTerrain ? stats.addTerrain(this._realityMeshParams.bytesUsed) : stats.addRealityMesh(this._realityMeshParams.bytesUsed);
|
|
@@ -140725,10 +140848,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
140725
140848
|
/** @internal */
|
|
140726
140849
|
function addOvrFlagConstants(builder) {
|
|
140727
140850
|
// NB: These are the bit positions of each flag in OvrFlags enum - not the flag values
|
|
140728
|
-
builder.addBitFlagConstant("
|
|
140851
|
+
builder.addBitFlagConstant("kOvrBit_LineRgb", 0);
|
|
140729
140852
|
builder.addBitFlagConstant("kOvrBit_Rgb", 1);
|
|
140730
140853
|
builder.addBitFlagConstant("kOvrBit_Alpha", 2);
|
|
140731
|
-
builder.addBitFlagConstant("
|
|
140854
|
+
builder.addBitFlagConstant("kOvrBit_LineAlpha", 3);
|
|
140732
140855
|
builder.addBitFlagConstant("kOvrBit_Flashed", 4);
|
|
140733
140856
|
builder.addBitFlagConstant("kOvrBit_NonLocatable", 5);
|
|
140734
140857
|
builder.addBitFlagConstant("kOvrBit_LineCode", 6);
|
|
@@ -140738,6 +140861,8 @@ function addOvrFlagConstants(builder) {
|
|
|
140738
140861
|
builder.addBitFlagConstant("kOvrBit_Emphasized", 1);
|
|
140739
140862
|
builder.addBitFlagConstant("kOvrBit_ViewIndependentTransparency", 2);
|
|
140740
140863
|
builder.addBitFlagConstant("kOvrBit_InvisibleDuringPick", 3);
|
|
140864
|
+
builder.addBitFlagConstant("kOvrBit_Visibility", 4);
|
|
140865
|
+
builder.addBitFlagConstant("kOvrBit_IgnoreMaterial", 5);
|
|
140741
140866
|
}
|
|
140742
140867
|
const computeLUTFeatureIndex = `g_featureAndMaterialIndex.xyz`;
|
|
140743
140868
|
const computeInstanceFeatureIndex = `g_isAreaPattern ? u_patternFeatureId : a_featureId`;
|
|
@@ -140783,9 +140908,9 @@ vec4 getFirstFeatureRgba() {
|
|
|
140783
140908
|
}
|
|
140784
140909
|
`;
|
|
140785
140910
|
const getSecondFeatureRgba = `
|
|
140786
|
-
vec4 getSecondFeatureRgba() {
|
|
140911
|
+
vec4 getSecondFeatureRgba(bool isLinear) {
|
|
140787
140912
|
vec2 coord = feature_texCoord;
|
|
140788
|
-
coord.x += g_feature_stepX;
|
|
140913
|
+
coord.x += g_feature_stepX * (isLinear ? 2.0 : 1.0);
|
|
140789
140914
|
return TEXTURE(u_featureLUT, coord);
|
|
140790
140915
|
}
|
|
140791
140916
|
`;
|
|
@@ -140903,7 +141028,7 @@ function addCommon(builder, mode, opts, wantGlobalOvrFlags = true) {
|
|
|
140903
141028
|
});
|
|
140904
141029
|
});
|
|
140905
141030
|
}
|
|
140906
|
-
(0,_LookupTable__WEBPACK_IMPORTED_MODULE_5__.addLookupTable)(vert, "feature", "
|
|
141031
|
+
(0,_LookupTable__WEBPACK_IMPORTED_MODULE_5__.addLookupTable)(vert, "feature", "3.0");
|
|
140907
141032
|
vert.addGlobal("feature_texCoord", 3 /* VariableType.Vec2 */);
|
|
140908
141033
|
vert.addFunction(computeFeatureTextureCoords);
|
|
140909
141034
|
vert.addFunction(getFirstFeatureRgba);
|
|
@@ -141098,6 +141223,7 @@ const checkForEarlySurfaceDiscardWithFeatureID = `
|
|
|
141098
141223
|
function addRenderOrderConstants(builder) {
|
|
141099
141224
|
builder.addConstant("kRenderOrder_BlankingRegion", 2 /* VariableType.Float */, 2 /* RenderOrder.BlankingRegion */.toFixed(1));
|
|
141100
141225
|
builder.addConstant("kRenderOrder_Linear", 2 /* VariableType.Float */, 5 /* RenderOrder.Linear */.toFixed(1));
|
|
141226
|
+
builder.addConstant("kRenderOrder_PlanarLinear", 2 /* VariableType.Float */, 13 /* RenderOrder.PlanarLinear */.toFixed(1));
|
|
141101
141227
|
builder.addConstant("kRenderOrder_Edge", 2 /* VariableType.Float */, 6 /* RenderOrder.Edge */.toFixed(1));
|
|
141102
141228
|
builder.addConstant("kRenderOrder_PlanarEdge", 2 /* VariableType.Float */, 14 /* RenderOrder.PlanarEdge */.toFixed(1));
|
|
141103
141229
|
builder.addConstant("kRenderOrder_Silhouette", 2 /* VariableType.Float */, 7 /* RenderOrder.Silhouette */.toFixed(1));
|
|
@@ -141233,20 +141359,21 @@ const computeFeatureOverrides = `
|
|
|
141233
141359
|
v_feature_emphasis = kEmphFlag_Hilite * extractNthBit(emphFlags, kOvrBit_Hilited) + kEmphFlag_Emphasize * extractNthBit(emphFlags, kOvrBit_Emphasized);
|
|
141234
141360
|
|
|
141235
141361
|
float flags = value.x * 256.0;
|
|
141236
|
-
if (0.0 == flags)
|
|
141362
|
+
if (0.0 == flags && 0.0 == emphFlags)
|
|
141237
141363
|
return; // nothing overridden for this feature
|
|
141238
141364
|
|
|
141239
141365
|
bool nonLocatable = (u_shaderFlags[kShaderBit_IgnoreNonLocatable] ? nthFeatureBitSet(flags, kOvrBit_NonLocatable) : false);
|
|
141240
141366
|
v_feature_emphasis += kEmphFlag_NonLocatable * float(nthFeatureBitSet(flags, kOvrBit_NonLocatable));
|
|
141241
|
-
bool invisible = nthFeatureBitSet(
|
|
141367
|
+
bool invisible = nthFeatureBitSet(emphFlags, kOvrBit_Visibility);
|
|
141242
141368
|
feature_invisible = invisible || nonLocatable;
|
|
141243
141369
|
if (feature_invisible)
|
|
141244
141370
|
return;
|
|
141245
141371
|
|
|
141246
|
-
bool
|
|
141247
|
-
bool
|
|
141372
|
+
bool isLinear = u_renderOrder == kRenderOrder_Linear || u_renderOrder == kRenderOrder_PlanarLinear || u_renderOrder == kRenderOrder_PlanarEdge;
|
|
141373
|
+
bool rgbOverridden = isLinear ? nthFeatureBitSet(flags, kOvrBit_LineRgb) : nthFeatureBitSet(flags, kOvrBit_Rgb);
|
|
141374
|
+
bool alphaOverridden = isLinear ? nthFeatureBitSet(flags, kOvrBit_LineAlpha) : nthFeatureBitSet(flags, kOvrBit_Alpha);
|
|
141248
141375
|
if (alphaOverridden || rgbOverridden) {
|
|
141249
|
-
vec4 rgba = getSecondFeatureRgba();
|
|
141376
|
+
vec4 rgba = getSecondFeatureRgba(isLinear);
|
|
141250
141377
|
if (rgbOverridden)
|
|
141251
141378
|
feature_rgb = rgba.rgb;
|
|
141252
141379
|
|
|
@@ -141261,7 +141388,7 @@ const computeFeatureOverrides = `
|
|
|
141261
141388
|
nthFeatureBitSet(flags, kOvrBit_LineCode),
|
|
141262
141389
|
value.z * 256.0);
|
|
141263
141390
|
|
|
141264
|
-
feature_ignore_material = nthFeatureBitSet(
|
|
141391
|
+
feature_ignore_material = nthFeatureBitSet(emphFlags, kOvrBit_IgnoreMaterial);
|
|
141265
141392
|
use_material = use_material && !feature_ignore_material;
|
|
141266
141393
|
|
|
141267
141394
|
v_feature_emphasis += kEmphFlag_Flash * extractNthFeatureBit(flags, kOvrBit_Flashed);
|
|
@@ -141349,6 +141476,8 @@ function addFeatureSymbology(builder, feat, opts) {
|
|
|
141349
141476
|
vert.addGlobal("feature_viewIndependentTransparency", 0 /* VariableType.Boolean */, "false");
|
|
141350
141477
|
addEmphasisFlags(vert);
|
|
141351
141478
|
vert.addGlobal("use_material", 0 /* VariableType.Boolean */, "true");
|
|
141479
|
+
addRenderOrder(vert);
|
|
141480
|
+
addRenderOrderConstants(vert);
|
|
141352
141481
|
vert.set(3 /* VertexShaderComponent.ComputeFeatureOverrides */, computeFeatureOverrides);
|
|
141353
141482
|
vert.set(7 /* VertexShaderComponent.ApplyFeatureColor */, applyFeatureColor);
|
|
141354
141483
|
addApplyFlash(builder.frag);
|
|
@@ -163671,7 +163800,7 @@ class MapTile extends _internal__WEBPACK_IMPORTED_MODULE_7__.RealityTile {
|
|
|
163671
163800
|
return undefined;
|
|
163672
163801
|
const textures = this.getDrapeTextures();
|
|
163673
163802
|
const { baseColor, baseTransparent, layerClassifiers } = this.mapTree;
|
|
163674
|
-
const graphic = _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.renderSystem.createRealityMeshGraphic({ realityMesh: geometry, projection: this.getProjection(), tileRectangle: this.rectangle, featureTable: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.PackedFeatureTable.pack(this.mapLoader.featureTable), tileId: this.contentId, baseColor, baseTransparent, textures, layerClassifiers }, true);
|
|
163803
|
+
const graphic = _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.renderSystem.createRealityMeshGraphic({ realityMesh: geometry, projection: this.getProjection(), tileRectangle: this.rectangle, featureTable: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.PackedFeatureTable.pack(this.mapLoader.featureTable), tileId: this.contentId, baseColor, baseTransparent, textures, layerClassifiers, disableClipStyle: true }, true);
|
|
163675
163804
|
// If there are no layer classifiers then we can save this graphic for re-use. If layer classifiers exist they are regenerated based on view and we must collate them with the imagery.
|
|
163676
163805
|
if (this.imageryIsReady && 0 === this.mapTree.layerClassifiers.size)
|
|
163677
163806
|
this._graphic = graphic;
|
|
@@ -193558,19 +193687,19 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
193558
193687
|
}
|
|
193559
193688
|
/**
|
|
193560
193689
|
* Create an elliptical arc from three points on the ellipse: two points on an axis and one in between.
|
|
193561
|
-
* @param
|
|
193562
|
-
* @param
|
|
193563
|
-
* @param
|
|
193564
|
-
* @param sweep angular sweep, measured from `
|
|
193565
|
-
* For a half-ellipse from `
|
|
193690
|
+
* @param start start of arc, on an axis
|
|
193691
|
+
* @param middle point on arc somewhere between `start` and `end`
|
|
193692
|
+
* @param end point on arc directly opposite `start`
|
|
193693
|
+
* @param sweep angular sweep, measured from `start` in the direction of `middle`.
|
|
193694
|
+
* For a half-ellipse from `start` to `end` passing through `middle`, pass `AngleSweep.createStartEndDegrees(0,180)`.
|
|
193566
193695
|
* Default value is full sweep to create the entire ellipse.
|
|
193567
193696
|
* @param result optional preallocated result
|
|
193568
193697
|
* @returns elliptical arc, or undefined if construction impossible.
|
|
193569
193698
|
*/
|
|
193570
|
-
static createStartMiddleEnd(
|
|
193571
|
-
const center = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Point3d.createAdd2Scaled(
|
|
193572
|
-
const vector0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.createStartEnd(center,
|
|
193573
|
-
const vector1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.createStartEnd(center,
|
|
193699
|
+
static createStartMiddleEnd(start, middle, end, sweep, result) {
|
|
193700
|
+
const center = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Point3d.createAdd2Scaled(start, 0.5, end, 0.5);
|
|
193701
|
+
const vector0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.createStartEnd(center, start);
|
|
193702
|
+
const vector1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.createStartEnd(center, middle);
|
|
193574
193703
|
const v0DotV1 = vector0.dotProduct(vector1);
|
|
193575
193704
|
const v0Len2 = vector0.magnitudeSquared();
|
|
193576
193705
|
if (Math.abs(v0DotV1) >= v0Len2)
|
|
@@ -193578,7 +193707,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
193578
193707
|
const normal = vector0.crossProduct(vector1);
|
|
193579
193708
|
const vector90 = normal.unitCrossProductWithDefault(vector0, 0, 0, 0);
|
|
193580
193709
|
const v1DotV90 = vector1.dotProduct(vector90);
|
|
193581
|
-
//
|
|
193710
|
+
// solve the standard ellipse equation for the unknown axis length, given local coords of middle (v0.v1/||v0||, v90.v1)
|
|
193582
193711
|
const v90Len = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.safeDivideFraction(v0Len2 * v1DotV90, Math.sqrt(v0Len2 * v0Len2 - v0DotV1 * v0DotV1), 0);
|
|
193583
193712
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.isSmallMetricDistanceSquared(v90Len))
|
|
193584
193713
|
return undefined;
|
|
@@ -193587,33 +193716,55 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
193587
193716
|
}
|
|
193588
193717
|
/**
|
|
193589
193718
|
* Create a circular arc defined by start point, tangent at start point, and end point.
|
|
193590
|
-
*
|
|
193719
|
+
* * The circular arc is swept from `start` to `end` in the direction of `tangentAtStart`.
|
|
193720
|
+
* * If `tangentAtStart` is parallel to the line segment from `start` to `end`, return the line segment.
|
|
193591
193721
|
*/
|
|
193592
193722
|
static createCircularStartTangentEnd(start, tangentAtStart, end, result) {
|
|
193593
|
-
//
|
|
193594
|
-
|
|
193595
|
-
|
|
193596
|
-
|
|
193597
|
-
|
|
193598
|
-
|
|
193599
|
-
|
|
193600
|
-
|
|
193601
|
-
|
|
193602
|
-
|
|
193603
|
-
|
|
193604
|
-
|
|
193605
|
-
|
|
193606
|
-
|
|
193607
|
-
|
|
193608
|
-
|
|
193609
|
-
|
|
193610
|
-
const
|
|
193611
|
-
const sweep = _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_2__.AngleSweep.
|
|
193723
|
+
// see itwinjs-core\core\geometry\internaldocs\Arc3d.md to clarify below algorithm
|
|
193724
|
+
const startToEnd = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.createStartEnd(start, end);
|
|
193725
|
+
const frame = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_3__.Matrix3d.createRigidFromColumns(tangentAtStart, startToEnd, _Geometry__WEBPACK_IMPORTED_MODULE_5__.AxisOrder.XYZ);
|
|
193726
|
+
if (frame !== undefined) {
|
|
193727
|
+
const vv = startToEnd.dotProduct(startToEnd);
|
|
193728
|
+
const vw = frame.dotColumnY(startToEnd);
|
|
193729
|
+
const radius = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.conditionalDivideCoordinate(vv, 2 * vw);
|
|
193730
|
+
if (radius !== undefined) {
|
|
193731
|
+
const vector0 = frame.columnY();
|
|
193732
|
+
vector0.scaleInPlace(-radius); // center to start
|
|
193733
|
+
const vector90 = frame.columnX();
|
|
193734
|
+
vector90.scaleInPlace(radius);
|
|
193735
|
+
const centerToEnd = vector0.plus(startToEnd);
|
|
193736
|
+
const sweepAngle = vector0.angleTo(centerToEnd);
|
|
193737
|
+
let sweepRadians = sweepAngle.radians; // always positive and less than PI
|
|
193738
|
+
if (tangentAtStart.dotProduct(centerToEnd) < 0.0) // sweepRadians is the wrong way
|
|
193739
|
+
sweepRadians = 2.0 * Math.PI - sweepRadians;
|
|
193740
|
+
const center = start.plusScaled(vector0, -1.0);
|
|
193741
|
+
const sweep = _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_2__.AngleSweep.createStartEndRadians(0.0, sweepRadians);
|
|
193612
193742
|
return Arc3d.create(center, vector0, vector90, sweep, result);
|
|
193613
193743
|
}
|
|
193614
193744
|
}
|
|
193615
193745
|
return _LineSegment3d__WEBPACK_IMPORTED_MODULE_6__.LineSegment3d.create(start, end);
|
|
193616
193746
|
}
|
|
193747
|
+
/**
|
|
193748
|
+
* Create a circular arc from start point, tangent at start, radius, optional plane normal, arc sweep.
|
|
193749
|
+
* * The vector from start point to center is in the direction of upVector crossed with tangentA.
|
|
193750
|
+
* @param start start point.
|
|
193751
|
+
* @param tangentAtStart vector in tangent direction at the start.
|
|
193752
|
+
* @param radius signed radius.
|
|
193753
|
+
* @param upVector optional out-of-plane vector. Defaults to positive Z.
|
|
193754
|
+
* @param sweep angular range. If single `Angle` is given, start angle is at 0 degrees (the start point).
|
|
193755
|
+
*/
|
|
193756
|
+
static createCircularStartTangentRadius(start, tangentAtStart, radius, upVector, sweep) {
|
|
193757
|
+
if (upVector === undefined)
|
|
193758
|
+
upVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.unitZ();
|
|
193759
|
+
const vector0 = upVector.unitCrossProduct(tangentAtStart);
|
|
193760
|
+
if (vector0 === undefined)
|
|
193761
|
+
return undefined;
|
|
193762
|
+
const center = start.plusScaled(vector0, radius);
|
|
193763
|
+
// reverse the A-to-center vector and bring it up to scale
|
|
193764
|
+
vector0.scaleInPlace(-radius);
|
|
193765
|
+
const vector90 = tangentAtStart.scaleToLength(Math.abs(radius)); // cannot fail; prior unitCrossProduct would have failed first
|
|
193766
|
+
return Arc3d.create(center, vector0, vector90, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_2__.AngleSweep.create(sweep));
|
|
193767
|
+
}
|
|
193617
193768
|
/**
|
|
193618
193769
|
* Create a circular arc defined by start and end points and radius.
|
|
193619
193770
|
* @param start start point of the arc
|
|
@@ -194028,7 +194179,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
194028
194179
|
circularRadius() {
|
|
194029
194180
|
return this.isCircular ? this._matrix.columnXMagnitude() : undefined;
|
|
194030
194181
|
}
|
|
194031
|
-
/** Return the larger of the two defining vectors. */
|
|
194182
|
+
/** Return the larger length of the two defining vectors. */
|
|
194032
194183
|
maxVectorLength() {
|
|
194033
194184
|
return Math.max(this._matrix.columnXMagnitude(), this._matrix.columnYMagnitude());
|
|
194034
194185
|
}
|
|
@@ -194236,12 +194387,12 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
194236
194387
|
};
|
|
194237
194388
|
}
|
|
194238
194389
|
/** Test if this arc is almost equal to another GeometryQuery object */
|
|
194239
|
-
isAlmostEqual(otherGeometry) {
|
|
194390
|
+
isAlmostEqual(otherGeometry, distanceTol = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.smallMetricDistance, radianTol = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.smallAngleRadians) {
|
|
194240
194391
|
if (otherGeometry instanceof Arc3d) {
|
|
194241
194392
|
const other = otherGeometry;
|
|
194242
|
-
return this._center.isAlmostEqual(other._center)
|
|
194243
|
-
&& this._matrix.isAlmostEqual(other._matrix)
|
|
194244
|
-
&& this._sweep.isAlmostEqualAllowPeriodShift(other._sweep);
|
|
194393
|
+
return this._center.isAlmostEqual(other._center, distanceTol)
|
|
194394
|
+
&& this._matrix.isAlmostEqual(other._matrix, distanceTol)
|
|
194395
|
+
&& this._sweep.isAlmostEqualAllowPeriodShift(other._sweep, radianTol);
|
|
194245
194396
|
}
|
|
194246
194397
|
return false;
|
|
194247
194398
|
}
|
|
@@ -194347,7 +194498,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
194347
194498
|
* * `point` is the `point1` input.
|
|
194348
194499
|
* * both fractions are zero
|
|
194349
194500
|
* * `arc` is undefined.
|
|
194350
|
-
* @param point0 first point of path
|
|
194501
|
+
* @param point0 first point of path (the point before the point of inflection)
|
|
194351
194502
|
* @param point1 second point of path (the point of inflection)
|
|
194352
194503
|
* @param point2 third point of path (the point after the point of inflection)
|
|
194353
194504
|
* @param radius arc radius
|
|
@@ -196226,28 +196377,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
196226
196377
|
/* harmony export */ });
|
|
196227
196378
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
196228
196379
|
/* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
|
|
196229
|
-
/* harmony import */ var
|
|
196230
|
-
/* harmony import */ var
|
|
196380
|
+
/* harmony import */ var _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/AngleSweep */ "../../core/geometry/lib/esm/geometry3d/AngleSweep.js");
|
|
196381
|
+
/* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
|
|
196231
196382
|
/* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
|
|
196232
|
-
/* harmony import */ var
|
|
196233
|
-
/* harmony import */ var
|
|
196383
|
+
/* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
|
|
196384
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
196234
196385
|
/* harmony import */ var _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../geometry3d/PolylineOps */ "../../core/geometry/lib/esm/geometry3d/PolylineOps.js");
|
|
196235
196386
|
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
196236
196387
|
/* harmony import */ var _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../geometry3d/Segment1d */ "../../core/geometry/lib/esm/geometry3d/Segment1d.js");
|
|
196237
196388
|
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
196238
196389
|
/* harmony import */ var _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../numerics/Polynomials */ "../../core/geometry/lib/esm/numerics/Polynomials.js");
|
|
196239
|
-
/* harmony import */ var
|
|
196240
|
-
/* harmony import */ var
|
|
196390
|
+
/* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
|
|
196391
|
+
/* harmony import */ var _solid_Cone__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../solid/Cone */ "../../core/geometry/lib/esm/solid/Cone.js");
|
|
196241
196392
|
/* harmony import */ var _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../solid/RuledSweep */ "../../core/geometry/lib/esm/solid/RuledSweep.js");
|
|
196242
|
-
/* harmony import */ var
|
|
196243
|
-
/* harmony import */ var
|
|
196244
|
-
/* harmony import */ var
|
|
196245
|
-
/* harmony import */ var
|
|
196246
|
-
/* harmony import */ var
|
|
196393
|
+
/* harmony import */ var _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../solid/TorusPipe */ "../../core/geometry/lib/esm/solid/TorusPipe.js");
|
|
196394
|
+
/* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
196395
|
+
/* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
196396
|
+
/* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
|
|
196397
|
+
/* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
|
|
196247
196398
|
/* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
196248
|
-
/* harmony import */ var
|
|
196249
|
-
/* harmony import */ var
|
|
196250
|
-
/* harmony import */ var
|
|
196399
|
+
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
196400
|
+
/* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
196401
|
+
/* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
|
|
196251
196402
|
/* harmony import */ var _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./spiral/IntegratedSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/IntegratedSpiral3d.js");
|
|
196252
196403
|
/*---------------------------------------------------------------------------------------------
|
|
196253
196404
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
@@ -196308,33 +196459,16 @@ class CurveFactory {
|
|
|
196308
196459
|
}
|
|
196309
196460
|
}
|
|
196310
196461
|
/**
|
|
196311
|
-
* Create a circular arc
|
|
196312
|
-
*
|
|
196313
|
-
*
|
|
196314
|
-
* @param pointB
|
|
196462
|
+
* Create a circular arc defined by start point, tangent at start point, and end point.
|
|
196463
|
+
* * The circular arc is swept from start to end toward direction of the `tangentAtStart`.
|
|
196464
|
+
* * If tangent is parallel to line segment from start to end, return `undefined`.
|
|
196315
196465
|
*/
|
|
196316
|
-
static createArcPointTangentPoint(
|
|
196317
|
-
const
|
|
196318
|
-
|
|
196319
|
-
|
|
196320
|
-
|
|
196321
|
-
|
|
196322
|
-
const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideCoordinate(vv, 2 * vw);
|
|
196323
|
-
if (alpha !== undefined) {
|
|
196324
|
-
const vector0 = frame.columnY();
|
|
196325
|
-
vector0.scaleInPlace(-alpha);
|
|
196326
|
-
const vector90 = frame.columnX();
|
|
196327
|
-
vector90.scaleInPlace(alpha);
|
|
196328
|
-
const centerToEnd = vector0.plus(vectorV);
|
|
196329
|
-
const sweepAngle = vector0.angleTo(centerToEnd);
|
|
196330
|
-
let sweepRadians = sweepAngle.radians; // That's always positive and less than PI.
|
|
196331
|
-
if (tangentA.dotProduct(centerToEnd) < 0.0) // ah, sweepRadians is the wrong way
|
|
196332
|
-
sweepRadians = 2.0 * Math.PI - sweepRadians;
|
|
196333
|
-
const center = pointA.plusScaled(vector0, -1.0);
|
|
196334
|
-
return _Arc3d__WEBPACK_IMPORTED_MODULE_4__.Arc3d.create(center, vector0, vector90, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_5__.AngleSweep.createStartEndRadians(0.0, sweepRadians));
|
|
196335
|
-
}
|
|
196336
|
-
}
|
|
196337
|
-
return undefined;
|
|
196466
|
+
static createArcPointTangentPoint(start, tangentAtStart, end) {
|
|
196467
|
+
const ret = _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.createCircularStartTangentEnd(start, tangentAtStart, end);
|
|
196468
|
+
if (ret instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d)
|
|
196469
|
+
return ret;
|
|
196470
|
+
else
|
|
196471
|
+
return undefined;
|
|
196338
196472
|
}
|
|
196339
196473
|
/**
|
|
196340
196474
|
* Construct a sequence of alternating lines and arcs with the arcs creating tangent transition between consecutive edges.
|
|
@@ -196348,8 +196482,8 @@ class CurveFactory {
|
|
|
196348
196482
|
*/
|
|
196349
196483
|
static createFilletsInLineString(points, radius, allowBackupAlongEdge = true) {
|
|
196350
196484
|
if (Array.isArray(points))
|
|
196351
|
-
return this.createFilletsInLineString(new
|
|
196352
|
-
if (points instanceof
|
|
196485
|
+
return this.createFilletsInLineString(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_3__.Point3dArrayCarrier(points), radius, allowBackupAlongEdge);
|
|
196486
|
+
if (points instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_4__.LineString3d)
|
|
196353
196487
|
return this.createFilletsInLineString(points.packedPoints, radius, allowBackupAlongEdge);
|
|
196354
196488
|
const n = points.length;
|
|
196355
196489
|
if (n <= 1)
|
|
@@ -196370,7 +196504,7 @@ class CurveFactory {
|
|
|
196370
196504
|
else if (Number.isFinite(radius))
|
|
196371
196505
|
thisRadius = radius;
|
|
196372
196506
|
if (thisRadius !== 0.0)
|
|
196373
|
-
blendArray.push(
|
|
196507
|
+
blendArray.push(_Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.createFilletArc(pointA, pointB, pointC, thisRadius));
|
|
196374
196508
|
else
|
|
196375
196509
|
blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointB.clone() });
|
|
196376
196510
|
pointA.setFromPoint3d(pointB);
|
|
@@ -196403,7 +196537,7 @@ class CurveFactory {
|
|
|
196403
196537
|
}
|
|
196404
196538
|
} */
|
|
196405
196539
|
}
|
|
196406
|
-
const path =
|
|
196540
|
+
const path = _Path__WEBPACK_IMPORTED_MODULE_5__.Path.create();
|
|
196407
196541
|
this.addPartialSegment(path, allowBackupAlongEdge, blendArray[0].point, blendArray[1].point, blendArray[0].fraction12, 1.0 - blendArray[1].fraction10);
|
|
196408
196542
|
// add each path and successor edge ...
|
|
196409
196543
|
for (let i = 1; i + 1 < points.length; i++) {
|
|
@@ -196426,21 +196560,21 @@ class CurveFactory {
|
|
|
196426
196560
|
const yMax = Math.max(y0, y1);
|
|
196427
196561
|
radius = Math.min(Math.abs(radius), 0.5 * (xMax - xMin), 0.5 * (yMax - yMin));
|
|
196428
196562
|
if (radius === 0.0)
|
|
196429
|
-
return
|
|
196563
|
+
return _Loop__WEBPACK_IMPORTED_MODULE_6__.Loop.createPolygon([_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMin, yMin, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMax, yMin, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMax, yMax, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMin, yMax, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMin, yMin, z)]);
|
|
196430
196564
|
else {
|
|
196431
|
-
const vectorU =
|
|
196432
|
-
const vectorV =
|
|
196565
|
+
const vectorU = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(radius, 0, 0);
|
|
196566
|
+
const vectorV = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(0, radius, 0);
|
|
196433
196567
|
const x0A = xMin + radius;
|
|
196434
196568
|
const y0A = yMin + radius;
|
|
196435
196569
|
const x1A = xMax - radius;
|
|
196436
196570
|
const y1A = yMax - radius;
|
|
196437
|
-
const centers = [
|
|
196438
|
-
const loop =
|
|
196571
|
+
const centers = [_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x1A, y1A, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x0A, y1A, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x0A, y0A, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x1A, y0A, z)];
|
|
196572
|
+
const loop = _Loop__WEBPACK_IMPORTED_MODULE_6__.Loop.create();
|
|
196439
196573
|
for (let i = 0; i < 4; i++) {
|
|
196440
196574
|
const center = centers[i];
|
|
196441
196575
|
const nextCenter = centers[(i + 1) % 4];
|
|
196442
|
-
const edgeVector =
|
|
196443
|
-
const arc =
|
|
196576
|
+
const edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(center, nextCenter);
|
|
196577
|
+
const arc = _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.create(center, vectorU, vectorV, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_8__.AngleSweep.createStartEndDegrees(0, 90));
|
|
196444
196578
|
loop.tryAddChild(arc);
|
|
196445
196579
|
const arcEnd = arc.endPoint();
|
|
196446
196580
|
if (!edgeVector.isAlmostZero)
|
|
@@ -196492,7 +196626,7 @@ class CurveFactory {
|
|
|
196492
196626
|
* @param fractionForIntermediateNormal fractional position for surface normal used to create the section plane.
|
|
196493
196627
|
*/
|
|
196494
196628
|
static assembleArcChainOnEllipsoid(ellipsoid, pathPoints, fractionForIntermediateNormal = 0.5) {
|
|
196495
|
-
const arcPath =
|
|
196629
|
+
const arcPath = _Path__WEBPACK_IMPORTED_MODULE_5__.Path.create();
|
|
196496
196630
|
for (let i = 0; i + 1 < pathPoints.length; i++) {
|
|
196497
196631
|
const arc = ellipsoid.sectionArcWithIntermediateNormal(pathPoints[i].toAngles(), fractionForIntermediateNormal, pathPoints[i + 1].toAngles());
|
|
196498
196632
|
arcPath.tryAddChild(arc);
|
|
@@ -196500,7 +196634,7 @@ class CurveFactory {
|
|
|
196500
196634
|
return arcPath;
|
|
196501
196635
|
}
|
|
196502
196636
|
static appendGeometryQueryArray(candidate, result) {
|
|
196503
|
-
if (candidate instanceof
|
|
196637
|
+
if (candidate instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_9__.GeometryQuery)
|
|
196504
196638
|
result.push(candidate);
|
|
196505
196639
|
else if (Array.isArray(candidate)) {
|
|
196506
196640
|
for (const p of candidate)
|
|
@@ -196514,17 +196648,17 @@ class CurveFactory {
|
|
|
196514
196648
|
*/
|
|
196515
196649
|
static createPipeSegments(centerline, pipeRadius) {
|
|
196516
196650
|
if (centerline instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_1__.LineSegment3d) {
|
|
196517
|
-
return
|
|
196651
|
+
return _solid_Cone__WEBPACK_IMPORTED_MODULE_10__.Cone.createAxisPoints(centerline.startPoint(), centerline.endPoint(), pipeRadius, pipeRadius, false);
|
|
196518
196652
|
}
|
|
196519
|
-
else if (centerline instanceof
|
|
196520
|
-
return
|
|
196653
|
+
else if (centerline instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
|
|
196654
|
+
return _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_11__.TorusPipe.createAlongArc(centerline, pipeRadius, false);
|
|
196521
196655
|
}
|
|
196522
|
-
else if (centerline instanceof
|
|
196523
|
-
const builder =
|
|
196656
|
+
else if (centerline instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__.CurvePrimitive) {
|
|
196657
|
+
const builder = _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_13__.PolyfaceBuilder.create();
|
|
196524
196658
|
builder.addMiteredPipes(centerline, pipeRadius);
|
|
196525
196659
|
return builder.claimPolyface();
|
|
196526
196660
|
}
|
|
196527
|
-
else if (centerline instanceof
|
|
196661
|
+
else if (centerline instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_14__.CurveChain) {
|
|
196528
196662
|
const result = [];
|
|
196529
196663
|
for (const p of centerline.children) {
|
|
196530
196664
|
const pipe = this.createPipeSegments(p, pipeRadius);
|
|
@@ -196550,33 +196684,33 @@ class CurveFactory {
|
|
|
196550
196684
|
const arcs = [];
|
|
196551
196685
|
if (centerline.length < 2)
|
|
196552
196686
|
return [];
|
|
196553
|
-
const vector0 =
|
|
196554
|
-
const vector90 =
|
|
196555
|
-
const vectorBC =
|
|
196556
|
-
const currentCenter =
|
|
196687
|
+
const vector0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
|
|
196688
|
+
const vector90 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
|
|
196689
|
+
const vectorBC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
|
|
196690
|
+
const currentCenter = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create();
|
|
196557
196691
|
centerline.vectorIndexIndex(0, 1, vectorBC);
|
|
196558
196692
|
centerline.getPoint3dAtUncheckedPointIndex(0, currentCenter);
|
|
196559
196693
|
let initialSection;
|
|
196560
|
-
if (sectionData instanceof
|
|
196694
|
+
if (sectionData instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
|
|
196561
196695
|
initialSection = sectionData.clone();
|
|
196562
196696
|
initialSection.center.setFrom(currentCenter);
|
|
196563
196697
|
vector0.setFrom(sectionData.vector0);
|
|
196564
196698
|
vector90.setFrom(sectionData.vector90);
|
|
196565
196699
|
}
|
|
196566
|
-
else if (typeof sectionData === "number" ||
|
|
196700
|
+
else if (typeof sectionData === "number" || _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.isXAndY(sectionData)) {
|
|
196567
196701
|
const length0 = (typeof sectionData === "number") ? sectionData : sectionData.x;
|
|
196568
196702
|
const length90 = (typeof sectionData === "number") ? sectionData : sectionData.y;
|
|
196569
|
-
const baseFrame =
|
|
196703
|
+
const baseFrame = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_15__.Matrix3d.createRigidHeadsUp(vectorBC, _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.ZXY);
|
|
196570
196704
|
baseFrame.columnX(vector0).scaleInPlace(length0);
|
|
196571
196705
|
baseFrame.columnY(vector90).scaleInPlace(length90);
|
|
196572
|
-
initialSection =
|
|
196706
|
+
initialSection = _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.create(currentCenter, vector0, vector90, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_8__.AngleSweep.create360());
|
|
196573
196707
|
}
|
|
196574
196708
|
else {
|
|
196575
196709
|
return [];
|
|
196576
196710
|
}
|
|
196577
196711
|
arcs.push(initialSection);
|
|
196578
|
-
const vectorAB =
|
|
196579
|
-
const bisector =
|
|
196712
|
+
const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
|
|
196713
|
+
const bisector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
|
|
196580
196714
|
for (let i = 1; i < centerline.length; i++) {
|
|
196581
196715
|
vectorAB.setFromVector3d(vectorBC);
|
|
196582
196716
|
centerline.getPoint3dAtUncheckedPointIndex(i, currentCenter);
|
|
@@ -196593,7 +196727,7 @@ class CurveFactory {
|
|
|
196593
196727
|
// vector0 and vector90 are obtained by sweeping the corresponding vectors of the start ellipse to the split plane.
|
|
196594
196728
|
moveVectorToPlane(vector0, vectorAB, bisector, vector0);
|
|
196595
196729
|
moveVectorToPlane(vector90, vectorAB, bisector, vector90);
|
|
196596
|
-
arcs.push(
|
|
196730
|
+
arcs.push(_Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.create(currentCenter, vector0, vector90, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_8__.AngleSweep.create360()));
|
|
196597
196731
|
}
|
|
196598
196732
|
}
|
|
196599
196733
|
return arcs;
|
|
@@ -196621,7 +196755,7 @@ class CurveFactory {
|
|
|
196621
196755
|
// If successful, push the target plane and swept section to the output arrays and return the swept section.
|
|
196622
196756
|
// If unsuccessful, leave the output arrays alone and return the input section.
|
|
196623
196757
|
const doSweepToPlane = function (edgePlane0, edgePlane1, targetPlane, section) {
|
|
196624
|
-
const sweepVector =
|
|
196758
|
+
const sweepVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(edgePlane0.getOriginRef(), edgePlane1.getOriginRef());
|
|
196625
196759
|
const transform = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createFlattenAlongVectorToPlane(sweepVector, targetPlane.getOriginRef(), targetPlane.getNormalRef());
|
|
196626
196760
|
if (transform === undefined)
|
|
196627
196761
|
return section;
|
|
@@ -196641,7 +196775,7 @@ class CurveFactory {
|
|
|
196641
196775
|
if (ruledSweep) {
|
|
196642
196776
|
sectionData.ruledSweep = ruledSweep;
|
|
196643
196777
|
if (MiteredSweepOutputSelect.AlsoMesh === options.outputSelect) {
|
|
196644
|
-
const builder =
|
|
196778
|
+
const builder = _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_13__.PolyfaceBuilder.create(options.strokeOptions);
|
|
196645
196779
|
builder.addRuledSweep(ruledSweep);
|
|
196646
196780
|
sectionData.mesh = builder.claimPolyface();
|
|
196647
196781
|
}
|
|
@@ -196652,26 +196786,16 @@ class CurveFactory {
|
|
|
196652
196786
|
return undefined;
|
|
196653
196787
|
}
|
|
196654
196788
|
/**
|
|
196655
|
-
* Create a circular arc from start point, tangent at start, radius, optional plane normal, arc sweep
|
|
196789
|
+
* Create a circular arc from start point, tangent at start, radius, optional plane normal, arc sweep.
|
|
196656
196790
|
* * The vector from start point to center is in the direction of upVector crossed with tangentA.
|
|
196657
|
-
* @param
|
|
196658
|
-
* @param
|
|
196791
|
+
* @param start start point.
|
|
196792
|
+
* @param tangentAtStart vector in tangent direction at the start.
|
|
196659
196793
|
* @param radius signed radius.
|
|
196660
|
-
* @param upVector optional out-of-plane vector.
|
|
196661
|
-
* @param sweep angular range.
|
|
196662
|
-
*
|
|
196794
|
+
* @param upVector optional out-of-plane vector. Defaults to positive Z.
|
|
196795
|
+
* @param sweep angular range. If single `Angle` is given, start angle is at 0 degrees (the start point).
|
|
196663
196796
|
*/
|
|
196664
|
-
static createArcPointTangentRadius(
|
|
196665
|
-
|
|
196666
|
-
upVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.unitZ();
|
|
196667
|
-
const vector0 = upVector.unitCrossProduct(tangentA);
|
|
196668
|
-
if (vector0 === undefined)
|
|
196669
|
-
return undefined;
|
|
196670
|
-
const center = pointA.plusScaled(vector0, radius);
|
|
196671
|
-
// reverse the A-to-center vector and bring it up to scale ...
|
|
196672
|
-
vector0.scaleInPlace(-radius);
|
|
196673
|
-
const vector90 = tangentA.scaleToLength(Math.abs(radius)); // (Cannot fail -- prior unitCrossProduct would have failed first)
|
|
196674
|
-
return _Arc3d__WEBPACK_IMPORTED_MODULE_4__.Arc3d.create(center, vector0, vector90, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_5__.AngleSweep.create(sweep));
|
|
196797
|
+
static createArcPointTangentRadius(start, tangentAtStart, radius, upVector, sweep) {
|
|
196798
|
+
return _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.createCircularStartTangentRadius(start, tangentAtStart, radius, upVector, sweep);
|
|
196675
196799
|
}
|
|
196676
196800
|
/**
|
|
196677
196801
|
* Compute 2 spirals (all in XY) for a symmetric line-to-line transition.
|
|
@@ -196684,30 +196808,30 @@ class CurveFactory {
|
|
|
196684
196808
|
* @return array with the computed spirals, or undefined if failure.
|
|
196685
196809
|
*/
|
|
196686
196810
|
static createLineSpiralSpiralLine(spiralType, startPoint, shoulderPoint, targetPoint) {
|
|
196687
|
-
const vectorAB =
|
|
196688
|
-
const vectorBC0 =
|
|
196811
|
+
const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(startPoint, shoulderPoint);
|
|
196812
|
+
const vectorBC0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(shoulderPoint, targetPoint);
|
|
196689
196813
|
const referenceLength = vectorAB.magnitude();
|
|
196690
196814
|
const radiansAB = Math.atan2(vectorAB.y, vectorAB.x);
|
|
196691
196815
|
const lineTurnRadians = vectorAB.angleToXY(vectorBC0);
|
|
196692
196816
|
const spiralTurnRadians = 0.5 * lineTurnRadians.radians;
|
|
196693
196817
|
const radiansBC = radiansAB + lineTurnRadians.radians;
|
|
196694
|
-
const axesA =
|
|
196818
|
+
const axesA = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_15__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.createRadians(radiansAB));
|
|
196695
196819
|
const frameA = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createRefs(startPoint.clone(), axesA);
|
|
196696
196820
|
// We know how much it has to turn, and but not the length or end radius.
|
|
196697
196821
|
// make a spiral of referenceLength and scale it back to the junction line
|
|
196698
196822
|
const spiralARefLength = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_20__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0.0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.createRadians(0), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.createRadians(spiralTurnRadians), referenceLength, undefined, frameA);
|
|
196699
196823
|
if (spiralARefLength) {
|
|
196700
196824
|
const midPlanePerpendicularRadians = radiansAB + spiralTurnRadians;
|
|
196701
|
-
const midPlanePerpendicularVector =
|
|
196825
|
+
const midPlanePerpendicularVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createPolar(1.0, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.createRadians(midPlanePerpendicularRadians));
|
|
196702
196826
|
const altitudeB = midPlanePerpendicularVector.dotProductStartEnd(startPoint, shoulderPoint);
|
|
196703
196827
|
const altitudeSpiralEnd = midPlanePerpendicularVector.dotProductStartEnd(startPoint, spiralARefLength.endPoint());
|
|
196704
196828
|
const scaleFactor = altitudeB / altitudeSpiralEnd;
|
|
196705
196829
|
const spiralA = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_20__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0.0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.createRadians(0), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.createRadians(spiralTurnRadians), referenceLength * scaleFactor, undefined, frameA);
|
|
196706
196830
|
const distanceAB = vectorAB.magnitude();
|
|
196707
|
-
const vectorBC =
|
|
196831
|
+
const vectorBC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(shoulderPoint, targetPoint);
|
|
196708
196832
|
vectorBC.scaleToLength(distanceAB, vectorBC);
|
|
196709
196833
|
const pointC = shoulderPoint.plus(vectorBC);
|
|
196710
|
-
const axesC =
|
|
196834
|
+
const axesC = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_15__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.createRadians(radiansBC + Math.PI));
|
|
196711
196835
|
const frameC = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createRefs(pointC, axesC);
|
|
196712
196836
|
const spiralC = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_20__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, -spiralA.radius01.x1, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.zero(), undefined, spiralA.curveLength(), _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_21__.Segment1d.create(1, 0), frameC);
|
|
196713
196837
|
return [spiralA, spiralC];
|
|
@@ -196725,8 +196849,8 @@ class CurveFactory {
|
|
|
196725
196849
|
* @return array with the computed spirals, or undefined if failure.
|
|
196726
196850
|
*/
|
|
196727
196851
|
static createLineSpiralSpiralLineWithSpiralLength(spiralType, pointA, pointB, pointC, spiralLength) {
|
|
196728
|
-
const vectorAB =
|
|
196729
|
-
const vectorBC =
|
|
196852
|
+
const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(pointA, pointB);
|
|
196853
|
+
const vectorBC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(pointB, pointC);
|
|
196730
196854
|
const radiansAB = Math.atan2(vectorAB.y, vectorAB.x);
|
|
196731
196855
|
const lineTurnAngle = vectorAB.angleToXY(vectorBC);
|
|
196732
196856
|
const spiralTurnRadians = 0.5 * lineTurnAngle.radians;
|
|
@@ -196743,11 +196867,11 @@ class CurveFactory {
|
|
|
196743
196867
|
const xFractionAB = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(distanceAB - distanceBE - localEndPoint.x, distanceAB);
|
|
196744
196868
|
const xFractionCB = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(distanceCB - distanceBE - localEndPoint.x, distanceCB);
|
|
196745
196869
|
if (xFractionAB !== undefined && xFractionCB !== undefined) {
|
|
196746
|
-
const axesA =
|
|
196870
|
+
const axesA = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_15__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.createRadians(radiansAB));
|
|
196747
196871
|
const frameAOrigin = pointA.interpolate(xFractionAB, pointB);
|
|
196748
196872
|
const frameA = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createRefs(frameAOrigin, axesA);
|
|
196749
196873
|
const spiralAB = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_20__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.zero(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.createRadians(spiralTurnRadians), spiralLength, undefined, frameA);
|
|
196750
|
-
const axesB =
|
|
196874
|
+
const axesB = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_15__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.createRadians(radiansCB));
|
|
196751
196875
|
const frameBOrigin = pointC.interpolate(xFractionCB, pointB);
|
|
196752
196876
|
const frameB = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createRefs(frameBOrigin, axesB);
|
|
196753
196877
|
const spiralBC = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_20__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.zero(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.createRadians(-spiralTurnRadians), spiralLength, undefined, frameB);
|
|
@@ -196767,9 +196891,9 @@ class CurveFactory {
|
|
|
196767
196891
|
* @return array with the computed spirals, or undefined if failure.
|
|
196768
196892
|
*/
|
|
196769
196893
|
static createLineSpiralArcSpiralLine(spiralType, pointA, pointB, pointC, lengthA, lengthB, arcRadius) {
|
|
196770
|
-
const vectorAB =
|
|
196894
|
+
const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(pointA, pointB);
|
|
196771
196895
|
vectorAB.z = 0;
|
|
196772
|
-
const vectorCB =
|
|
196896
|
+
const vectorCB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(pointC, pointB);
|
|
196773
196897
|
vectorCB.z = 0;
|
|
196774
196898
|
const unitAB = vectorAB.normalize();
|
|
196775
196899
|
const unitCB = vectorCB.normalize();
|
|
@@ -196792,14 +196916,14 @@ class CurveFactory {
|
|
|
196792
196916
|
const sB = spiralEndB.origin.x - radiusB * spiralEndB.direction.y;
|
|
196793
196917
|
const tB = spiralEndB.origin.y + radiusB * spiralEndB.direction.x;
|
|
196794
196918
|
// Those local coordinates are rotated to unitAB and unitBC ...
|
|
196795
|
-
const vectorA =
|
|
196796
|
-
const vectorB =
|
|
196919
|
+
const vectorA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createAdd2Scaled(unitAB, sA, unitPerpAB, tA);
|
|
196920
|
+
const vectorB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createAdd2Scaled(unitCB, sB, unitPerpCB, tB);
|
|
196797
196921
|
const uv = _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_22__.Vector2d.create();
|
|
196798
196922
|
if (_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_23__.SmallSystem.linearSystem2d(unitAB.x, -unitCB.x, unitAB.y, -unitCB.y, vectorB.x - vectorA.x, vectorB.y - vectorA.y, uv)) {
|
|
196799
196923
|
const tangencyAB = pointB.plusScaled(unitAB, uv.x);
|
|
196800
196924
|
const tangencyCB = pointB.plusScaled(unitCB, uv.y);
|
|
196801
|
-
const frameA = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createOriginAndMatrixColumns(tangencyAB, unitAB, unitPerpAB,
|
|
196802
|
-
const frameB = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createOriginAndMatrixColumns(tangencyCB, unitCB, unitPerpCB,
|
|
196925
|
+
const frameA = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createOriginAndMatrixColumns(tangencyAB, unitAB, unitPerpAB, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.unitZ());
|
|
196926
|
+
const frameB = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createOriginAndMatrixColumns(tangencyCB, unitCB, unitPerpCB, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.unitZ());
|
|
196803
196927
|
spiralA.tryTransformInPlace(frameA);
|
|
196804
196928
|
spiralB.tryTransformInPlace(frameB);
|
|
196805
196929
|
const rayA1 = spiralA.fractionToPointAndUnitTangent(1.0);
|
|
@@ -206017,7 +206141,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
206017
206141
|
*/
|
|
206018
206142
|
getPointCurveClosestApproachXYNewton(curveP, pointQ) {
|
|
206019
206143
|
if (!(curveP instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_4__.Arc3d) && !(curveP instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d)) {
|
|
206020
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
206144
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "getPointCurveClosestApproachXYNewton only supports Arc3d and LineSegment");
|
|
206021
206145
|
return undefined;
|
|
206022
206146
|
}
|
|
206023
206147
|
const seeds = [0.2, 0.4, 0.6, 0.8]; // HEURISTIC: arcs have up to 4 perpendiculars; lines have only 1
|
|
@@ -206292,7 +206416,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
206292
206416
|
if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_11__.CurveChainWithDistanceIndex))
|
|
206293
206417
|
return;
|
|
206294
206418
|
if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_11__.CurveChainWithDistanceIndex) {
|
|
206295
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
206419
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "call handleCurveChainWithDistanceIndex(geomA) instead");
|
|
206296
206420
|
return;
|
|
206297
206421
|
}
|
|
206298
206422
|
const index0 = this._results.length;
|
|
@@ -207269,7 +207393,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
207269
207393
|
if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_14__.CurveChainWithDistanceIndex))
|
|
207270
207394
|
return;
|
|
207271
207395
|
if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_14__.CurveChainWithDistanceIndex) {
|
|
207272
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
207396
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "call handleCurveChainWithDistanceIndex(geomA) instead");
|
|
207273
207397
|
return;
|
|
207274
207398
|
}
|
|
207275
207399
|
const index0 = this._results.length;
|
|
@@ -208114,7 +208238,7 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
208114
208238
|
if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex))
|
|
208115
208239
|
return;
|
|
208116
208240
|
if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex) {
|
|
208117
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
208241
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "call handleCurveChainWithDistanceIndex(geomA) instead");
|
|
208118
208242
|
return;
|
|
208119
208243
|
}
|
|
208120
208244
|
const index0 = this._results.length;
|
|
@@ -208807,7 +208931,7 @@ class AdaptiveSubdivisionQ1IntervalErrorProcessor extends QuadrantFractionsProce
|
|
|
208807
208931
|
/** Remember the initial value of the fraction f to be perturbed. */
|
|
208808
208932
|
announceQuadrantBegin(q, reversed) {
|
|
208809
208933
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(q.quadrant === 1);
|
|
208810
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!reversed); // ASSUME
|
|
208934
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!reversed); // ASSUME [bracket0, bracket1] and q.fractions have the same ordering
|
|
208811
208935
|
// the first fraction might be an extra point for computing the first 3-pt arc.
|
|
208812
208936
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(q.fractions.length === 4 || (q.fractions.length === 3 && q.interpolateStartTangent));
|
|
208813
208937
|
this._error0 = this._error1 = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.largeCoordinateResult;
|
|
@@ -208913,7 +209037,7 @@ class AdaptiveSubdivisionQ1ErrorProcessor extends QuadrantFractionsProcessor {
|
|
|
208913
209037
|
const interpolateStartTangent = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isAlmostEqualEitherNumber(f0, this._fractionRangeQ1.low, this._fractionRangeQ1.high, 0);
|
|
208914
209038
|
const interpolateEndTangent = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isAlmostEqualEitherNumber(f1, this._fractionRangeQ1.low, this._fractionRangeQ1.high, 0);
|
|
208915
209039
|
if (!interpolateStartTangent && undefined === fPrev)
|
|
208916
|
-
fPrev = this.getPreviousFraction(f0); // createLastArc
|
|
209040
|
+
fPrev = this.getPreviousFraction(f0); // createLastArc doesn't supply fPrev to announceArc
|
|
208917
209041
|
const fractions = (undefined === fPrev) ? [f0, f, f1] : [fPrev, f0, f, f1];
|
|
208918
209042
|
const q1 = [QuadrantFractions.create(1, fractions, interpolateStartTangent, interpolateEndTangent)];
|
|
208919
209043
|
const processor = AdaptiveSubdivisionQ1IntervalErrorProcessor.create(this.fullEllipseXY, f0, f, f1);
|
|
@@ -209231,12 +209355,13 @@ class EllipticalArcApproximationContext {
|
|
|
209231
209355
|
arc.sweep.setStartEndRadians(startAngle.radians, arc.sweep.endRadians);
|
|
209232
209356
|
return arc; // returned arc starts at arcStart, ends at arcEnd
|
|
209233
209357
|
};
|
|
209234
|
-
const createFirstArc = (f0, f1
|
|
209358
|
+
const createFirstArc = (f0, f1) => {
|
|
209235
209359
|
// This arc starts at the first sample f0 and ends at f1.
|
|
209360
|
+
// This arc interpolates point and tangent at f0, but only point at f1.
|
|
209236
209361
|
ellipticalArc.fractionToPointAndDerivative(f0, ray);
|
|
209237
209362
|
ellipticalArc.fractionToPoint(f1, pt1);
|
|
209238
|
-
if (
|
|
209239
|
-
ray.direction.scaleInPlace(-1);
|
|
209363
|
+
if (f0 > f1)
|
|
209364
|
+
ray.direction.scaleInPlace(-1); // computed arc is retrograde
|
|
209240
209365
|
const arc = arcBetween2Samples(ray, pt1, false);
|
|
209241
209366
|
if (arc)
|
|
209242
209367
|
processor.announceArc(arc, undefined, f0, f1);
|
|
@@ -209252,12 +209377,14 @@ class EllipticalArcApproximationContext {
|
|
|
209252
209377
|
if (arc)
|
|
209253
209378
|
processor.announceArc(arc, fPrev, f1, f2);
|
|
209254
209379
|
};
|
|
209255
|
-
const createLastArc = (f0, f1
|
|
209256
|
-
// This arc starts at f0 and ends at the last sample f1.
|
|
209380
|
+
const createLastArc = (f0, f1) => {
|
|
209381
|
+
// This arc starts at f0 and ends at the last sample f1.
|
|
209382
|
+
// This arc interpolates point and tangent at f1, but only point at f0.
|
|
209257
209383
|
ellipticalArc.fractionToPoint(f0, pt0);
|
|
209258
209384
|
ellipticalArc.fractionToPointAndDerivative(f1, ray);
|
|
209259
|
-
if (
|
|
209260
|
-
ray.direction.scaleInPlace(-1);
|
|
209385
|
+
if (f1 > f0)
|
|
209386
|
+
ray.direction.scaleInPlace(-1); // computed arc is retrograde
|
|
209387
|
+
// compute last arc from f1 to f0, then reverse
|
|
209261
209388
|
const arc = arcBetween2Samples(ray, pt0, true);
|
|
209262
209389
|
if (arc)
|
|
209263
209390
|
processor.announceArc(arc, undefined, f0, f1);
|
|
@@ -209287,13 +209414,13 @@ class EllipticalArcApproximationContext {
|
|
|
209287
209414
|
if (!processor.announceQuadrantBegin(q, reversed))
|
|
209288
209415
|
continue;
|
|
209289
209416
|
if (q.interpolateStartTangent)
|
|
209290
|
-
createFirstArc(q.fractions[0], q.fractions[1]
|
|
209417
|
+
createFirstArc(q.fractions[0], q.fractions[1]);
|
|
209291
209418
|
// the first inner arc approximates the ellipse over [f[1],f[2]]; the last inner arc, over [f[n-3],f[n-2]]
|
|
209292
209419
|
for (let i = 0; i + 2 < n - 1; ++i)
|
|
209293
209420
|
createInnerArc(q.fractions[i], q.fractions[i + 1], q.fractions[i + 2]);
|
|
209294
209421
|
if (n > 2) { // the final arc approximates [f[n-2],f[n-1]]
|
|
209295
209422
|
if (q.interpolateEndTangent)
|
|
209296
|
-
createLastArc(q.fractions[n - 2], q.fractions[n - 1]
|
|
209423
|
+
createLastArc(q.fractions[n - 2], q.fractions[n - 1]);
|
|
209297
209424
|
else
|
|
209298
209425
|
createInnerArc(q.fractions[n - 3], q.fractions[n - 2], q.fractions[n - 1]);
|
|
209299
209426
|
}
|
|
@@ -214475,28 +214602,31 @@ class AngleSweep {
|
|
|
214475
214602
|
}
|
|
214476
214603
|
/**
|
|
214477
214604
|
* Convert an AngleSweep to a JSON object.
|
|
214478
|
-
* @return {*}
|
|
214605
|
+
* @return {*} [startAngleInDegrees, endAngleInDegrees]
|
|
214479
214606
|
*/
|
|
214480
214607
|
toJSON() {
|
|
214481
214608
|
return [this.startDegrees, this.endDegrees];
|
|
214482
214609
|
}
|
|
214483
214610
|
/**
|
|
214484
|
-
* Test if
|
|
214485
|
-
* * Period shifts are allowed.
|
|
214611
|
+
* Test if two angle sweeps match within the given tolerance.
|
|
214612
|
+
* * Period shifts are allowed, but orientations must be the same.
|
|
214613
|
+
* @param other sweep to compare to this instance
|
|
214614
|
+
* @param radianTol optional radian tolerance, default value `Geometry.smallAngleRadians`
|
|
214486
214615
|
*/
|
|
214487
|
-
isAlmostEqualAllowPeriodShift(other) {
|
|
214488
|
-
|
|
214489
|
-
|
|
214490
|
-
|
|
214491
|
-
&& _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansAllowPeriodShift(this._radians1 - this._radians0, other._radians1 - other._radians0);
|
|
214616
|
+
isAlmostEqualAllowPeriodShift(other, radianTol = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallAngleRadians) {
|
|
214617
|
+
return this.isCCW === other.isCCW // this rules out equating opposite sweeps like [0,-100] and [0,260]
|
|
214618
|
+
&& _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansAllowPeriodShift(this._radians0, other._radians0, radianTol)
|
|
214619
|
+
&& _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansAllowPeriodShift(this._radians1 - this._radians0, other._radians1 - other._radians0, radianTol);
|
|
214492
214620
|
}
|
|
214493
214621
|
/**
|
|
214494
|
-
* Test if
|
|
214622
|
+
* Test if two angle sweeps match within the given tolerance.
|
|
214495
214623
|
* * Period shifts are not allowed.
|
|
214624
|
+
* @param other sweep to compare to this instance
|
|
214625
|
+
* @param radianTol optional radian tolerance, default value `Geometry.smallAngleRadians`
|
|
214496
214626
|
*/
|
|
214497
|
-
isAlmostEqualNoPeriodShift(other) {
|
|
214498
|
-
return _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansNoPeriodShift(this._radians0, other._radians0)
|
|
214499
|
-
&& _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansNoPeriodShift(this._radians1 - this._radians0, other._radians1 - other._radians0);
|
|
214627
|
+
isAlmostEqualNoPeriodShift(other, radianTol = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallAngleRadians) {
|
|
214628
|
+
return _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansNoPeriodShift(this._radians0, other._radians0, radianTol)
|
|
214629
|
+
&& _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansNoPeriodShift(this._radians1 - this._radians0, other._radians1 - other._radians0, radianTol);
|
|
214500
214630
|
}
|
|
214501
214631
|
/**
|
|
214502
214632
|
* Test if start and end angles match with radians tolerance.
|
|
@@ -229381,7 +229511,7 @@ class PolygonOps {
|
|
|
229381
229511
|
const areaOfNormalParallelogram = Math.abs(outwardUnitNormalOfPrevEdge.crossProductXY(outwardUnitNormalOfEdge));
|
|
229382
229512
|
const coord = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.conditionalDivideCoordinate(areaOfNormalParallelogram, projToPrevEdge.x * projToEdge.x, largestResult);
|
|
229383
229513
|
if (undefined === coord) {
|
|
229384
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
229514
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "unexpectedly small projection distance to an edge");
|
|
229385
229515
|
return undefined; // shouldn't happen due to chopping in computeEdgeDataXY: area/(dist*dist) <= 1/tol^2 = largestResult
|
|
229386
229516
|
}
|
|
229387
229517
|
coords[i] = coord;
|
|
@@ -229392,7 +229522,7 @@ class PolygonOps {
|
|
|
229392
229522
|
}
|
|
229393
229523
|
const scale = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.conditionalDivideCoordinate(1.0, coordSum);
|
|
229394
229524
|
if (undefined === scale) {
|
|
229395
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
229525
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "unexpected zero barycentric coordinate sum");
|
|
229396
229526
|
return undefined;
|
|
229397
229527
|
}
|
|
229398
229528
|
for (let i = 0; i < n; ++i)
|
|
@@ -234794,11 +234924,11 @@ class Map4d {
|
|
|
234794
234924
|
return this._matrix0.isAlmostEqual(other._matrix0) && this._matrix1.isAlmostEqual(other._matrix1);
|
|
234795
234925
|
}
|
|
234796
234926
|
/**
|
|
234797
|
-
* Create a map between
|
|
234798
|
-
* @param origin lower left of frustum
|
|
234799
|
-
* @param uVector Vector from
|
|
234800
|
-
* @param vVector Vector from
|
|
234801
|
-
* @param wVector Vector from
|
|
234927
|
+
* Create a world to NPC map that maps between world coordinates and the given frustum.
|
|
234928
|
+
* @param origin lower left rear of frustum
|
|
234929
|
+
* @param uVector Vector from origin to lower right rear.
|
|
234930
|
+
* @param vVector Vector from origin to upper left rear.
|
|
234931
|
+
* @param wVector Vector from origin to lower left front, i.e. origin towards eye.
|
|
234802
234932
|
* @param fraction front size divided by rear size.
|
|
234803
234933
|
*/
|
|
234804
234934
|
static createVectorFrustum(origin, uVector, vVector, wVector, fraction) {
|
|
@@ -234898,7 +235028,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
234898
235028
|
* * indices 8,9,10,11 are the "z row" They may be called the zx,zy,zz,zw entries
|
|
234899
235029
|
* * indices 12,13,14,15 are the "w row". They may be called the wx,wy,wz,ww entries
|
|
234900
235030
|
* * If "w row" contains numeric values 0,0,0,1, the Matrix4d is equivalent to a Transform with
|
|
234901
|
-
* * The upper
|
|
235031
|
+
* * The upper left 3x3 matrix (entries 0,1,2,4,5,6,8,9,10) are the 3x3 matrix part of the transform
|
|
234902
235032
|
* * The far right column entries xw,yw,zw are the "origin" (sometimes called "translation") part of the transform.
|
|
234903
235033
|
* @public
|
|
234904
235034
|
*/
|
|
@@ -235051,7 +235181,7 @@ class Matrix4d {
|
|
|
235051
235181
|
return Matrix4d.createRowValues(scaleX, 0, 0, tx, 0, scaleY, 0, ty, 0, 0, scaleZ, tz, 0, 0, 0, 1, result);
|
|
235052
235182
|
}
|
|
235053
235183
|
/**
|
|
235054
|
-
* Create a mapping
|
|
235184
|
+
* Create a mapping that scales and translates (no rotation) from box A to box B
|
|
235055
235185
|
* @param lowA low point of box A
|
|
235056
235186
|
* @param highA high point of box A
|
|
235057
235187
|
* @param lowB low point of box B
|
|
@@ -235362,7 +235492,7 @@ class Matrix4d {
|
|
|
235362
235492
|
}
|
|
235363
235493
|
/** multiply each matrix * points[i]. This produces a weighted xyzw.
|
|
235364
235494
|
* Immediately renormalize back to xyz and replace the original point.
|
|
235365
|
-
* If zero weight appears in the result (i.e. input is on eyeplane)leave the mapped xyz untouched.
|
|
235495
|
+
* If zero weight appears in the result (i.e. input is on eyeplane) leave the mapped xyz untouched.
|
|
235366
235496
|
*/
|
|
235367
235497
|
multiplyPoint3dArrayQuietNormalize(points) {
|
|
235368
235498
|
points.forEach((point) => this.multiplyXYZWQuietRenormalize(point.x, point.y, point.z, 1.0, point));
|
|
@@ -235546,7 +235676,7 @@ class Matrix4d {
|
|
|
235546
235676
|
this._coffs[15] += a * vectorV.w;
|
|
235547
235677
|
}
|
|
235548
235678
|
/**
|
|
235549
|
-
*
|
|
235679
|
+
* Add (in place) scale*A*B*AT where
|
|
235550
235680
|
* * A is a pure translation with final column [x,y,z,1]
|
|
235551
235681
|
* * B is the given `matrixB`
|
|
235552
235682
|
* * AT is the transpose of A.
|
|
@@ -235591,12 +235721,9 @@ class Matrix4d {
|
|
|
235591
235721
|
* * A is a pure translation with final column [x,y,z,1]
|
|
235592
235722
|
* * this is this matrix.
|
|
235593
235723
|
* * AT is the transpose of A.
|
|
235594
|
-
* * scale is a multiplier.
|
|
235595
|
-
* @param matrixB the middle matrix.
|
|
235596
235724
|
* @param ax x part of translation
|
|
235597
235725
|
* @param ay y part of translation
|
|
235598
235726
|
* @param az z part of translation
|
|
235599
|
-
* @param scale scale factor for entire product
|
|
235600
235727
|
*/
|
|
235601
235728
|
multiplyTranslationSandwichInPlace(ax, ay, az) {
|
|
235602
235729
|
const bx = this._coffs[3];
|
|
@@ -240469,7 +240596,7 @@ class AnalyticRoots {
|
|
|
240469
240596
|
// EDL April 5, 2020 replace classic GraphicsGems solver by RWDNickalls.
|
|
240470
240597
|
// Don't know if improveRoots is needed.
|
|
240471
240598
|
// Breaks in AnalyticRoots.test.ts checkQuartic suggest it indeed converts many e-16 errors to zero.
|
|
240472
|
-
//
|
|
240599
|
+
// e-13 cases are unaffected
|
|
240473
240600
|
this.improveRoots(c, 3, results, false);
|
|
240474
240601
|
}
|
|
240475
240602
|
else {
|
|
@@ -240480,6 +240607,7 @@ class AnalyticRoots {
|
|
|
240480
240607
|
}
|
|
240481
240608
|
/** Compute roots of quartic `c[0] + c[1] * x + c[2] * x^2 + c[3] * x^3 + c[4] * x^4` */
|
|
240482
240609
|
static appendQuarticRoots(c, results) {
|
|
240610
|
+
// for details, see core\geometry\internaldocs\quarticRoots.md
|
|
240483
240611
|
const coffs = new Float64Array(4);
|
|
240484
240612
|
let u;
|
|
240485
240613
|
let v;
|
|
@@ -240510,7 +240638,7 @@ class AnalyticRoots {
|
|
|
240510
240638
|
this.addConstant(origin, results); // apply origin
|
|
240511
240639
|
return;
|
|
240512
240640
|
}
|
|
240513
|
-
else { // solve the resolvent cubic
|
|
240641
|
+
else { // solve the resolvent cubic
|
|
240514
240642
|
coffs[0] = 0.5 * r * p - 0.125 * q * q;
|
|
240515
240643
|
coffs[1] = -r;
|
|
240516
240644
|
coffs[2] = -0.5 * p;
|
|
@@ -240547,7 +240675,6 @@ class AnalyticRoots {
|
|
|
240547
240675
|
coffs[2] = 1;
|
|
240548
240676
|
this.appendQuadraticRoots(coffs, results);
|
|
240549
240677
|
}
|
|
240550
|
-
// substitute
|
|
240551
240678
|
this.addConstant(origin, results); // apply origin
|
|
240552
240679
|
results.sort();
|
|
240553
240680
|
this.improveRoots(c, 4, results, true);
|
|
@@ -240680,7 +240807,7 @@ class TrigPolynomial {
|
|
|
240680
240807
|
/**
|
|
240681
240808
|
* Solve a polynomial created from trigonometric condition using Trig.S, Trig.C, Trig.W.
|
|
240682
240809
|
* * Polynomial is of degree 4:
|
|
240683
|
-
* `coff[0] + coff[1] * t + coff[2] * t^2 + coff[3] * t^3 + coff[4] * t^4`
|
|
240810
|
+
* `p(t) = coff[0] + coff[1] * t + coff[2] * t^2 + coff[3] * t^3 + coff[4] * t^4`
|
|
240684
240811
|
* * Solution logic includes inferring angular roots corresponding zero leading coefficients
|
|
240685
240812
|
* (roots at infinity).
|
|
240686
240813
|
* @param coff coefficients.
|
|
@@ -240708,16 +240835,14 @@ class TrigPolynomial {
|
|
|
240708
240835
|
degree--;
|
|
240709
240836
|
const roots = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_5__.GrowableFloat64Array();
|
|
240710
240837
|
if (degree === -1) {
|
|
240711
|
-
//
|
|
240838
|
+
// do nothing
|
|
240712
240839
|
}
|
|
240713
240840
|
else {
|
|
240714
240841
|
if (degree === 0) {
|
|
240715
|
-
// p(t) is a nonzero constant
|
|
240716
|
-
// No roots, but not degenerate.
|
|
240842
|
+
// p(t) is a nonzero constant; no roots but not degenerate.
|
|
240717
240843
|
}
|
|
240718
240844
|
else if (degree === 1) {
|
|
240719
|
-
// p(t) = coff[
|
|
240720
|
-
roots.push(-coff[0] / coff[1]);
|
|
240845
|
+
roots.push(-coff[0] / coff[1]); // p(t) = coff[0] + coff[1] * t
|
|
240721
240846
|
}
|
|
240722
240847
|
else if (degree === 2) {
|
|
240723
240848
|
AnalyticRoots.appendQuadraticRoots(coff, roots);
|
|
@@ -240732,17 +240857,15 @@ class TrigPolynomial {
|
|
|
240732
240857
|
// TODO: WORK WITH BEZIER SOLVER
|
|
240733
240858
|
}
|
|
240734
240859
|
if (roots.length > 0) {
|
|
240735
|
-
// Each solution t represents an angle with
|
|
240736
|
-
// Math.Cos(theta) = C(t)/W(t) and sin(theta) = S(t)/W(t)
|
|
240860
|
+
// Each solution t represents an angle with Math.Cos(theta) = C(t)/W(t) and sin(theta) = S(t)/W(t)
|
|
240737
240861
|
// Division by W has no effect on atan2 calculations, so we just compute S(t),C(t)
|
|
240738
240862
|
for (let i = 0; i < roots.length; i++) {
|
|
240739
240863
|
const ss = PowerPolynomial.evaluate(this.S, roots.atUncheckedIndex(i));
|
|
240740
240864
|
const cc = PowerPolynomial.evaluate(this.C, roots.atUncheckedIndex(i));
|
|
240741
240865
|
radians.push(Math.atan2(ss, cc));
|
|
240742
240866
|
}
|
|
240743
|
-
//
|
|
240744
|
-
//
|
|
240745
|
-
// for (int i = degree; i < nominalDegree; i++)
|
|
240867
|
+
// each leading zero at the front of the coefficient array corresponds to a root at -PI/2.
|
|
240868
|
+
// only make one entry because we don't report multiplicity.
|
|
240746
240869
|
if (degree < nominalDegree)
|
|
240747
240870
|
radians.push(-0.5 * Math.PI);
|
|
240748
240871
|
}
|
|
@@ -240765,8 +240888,7 @@ class TrigPolynomial {
|
|
|
240765
240888
|
const coffs = new Float64Array(5);
|
|
240766
240889
|
PowerPolynomial.zero(coffs);
|
|
240767
240890
|
let degree;
|
|
240768
|
-
// see
|
|
240769
|
-
// on how coffs (coefficient array) is built.
|
|
240891
|
+
// see core\geometry\internaldocs\unitCircleEllipseIntersection.md for derivation of these coefficients
|
|
240770
240892
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(axx, axy, ayy) > TrigPolynomial._coefficientRelTol * _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(ax, ay, a)) {
|
|
240771
240893
|
PowerPolynomial.accumulate(coffs, this.CW, ax);
|
|
240772
240894
|
PowerPolynomial.accumulate(coffs, this.SW, ay);
|
|
@@ -240810,6 +240932,7 @@ class TrigPolynomial {
|
|
|
240810
240932
|
*/
|
|
240811
240933
|
static solveUnitCircleEllipseIntersection(cx, cy, ux, uy, vx, vy, ellipseRadians, circleRadians) {
|
|
240812
240934
|
circleRadians.length = 0;
|
|
240935
|
+
// see core\geometry\internaldocs\unitCircleEllipseIntersection.md for derivation of these coefficients:
|
|
240813
240936
|
const acc = ux * ux + uy * uy;
|
|
240814
240937
|
const acs = 2.0 * (ux * vx + uy * vy);
|
|
240815
240938
|
const ass = vx * vx + vy * vy;
|
|
@@ -240843,8 +240966,7 @@ class TrigPolynomial {
|
|
|
240843
240966
|
*/
|
|
240844
240967
|
static solveUnitCircleHomogeneousEllipseIntersection(cx, cy, cw, ux, uy, uw, vx, vy, vw, ellipseRadians, circleRadians) {
|
|
240845
240968
|
circleRadians.length = 0;
|
|
240846
|
-
// see
|
|
240847
|
-
// on how below variables are derived.
|
|
240969
|
+
// see core\geometry\internaldocs\unitCircleEllipseIntersection.md for derivation of these coefficients:
|
|
240848
240970
|
const acc = ux * ux + uy * uy - uw * uw;
|
|
240849
240971
|
const acs = 2.0 * (ux * vx + uy * vy - uw * vw);
|
|
240850
240972
|
const ass = vx * vx + vy * vy - vw * vw;
|
|
@@ -240864,8 +240986,7 @@ class TrigPolynomial {
|
|
|
240864
240986
|
}
|
|
240865
240987
|
// tolerance for small angle decision.
|
|
240866
240988
|
TrigPolynomial._smallAngle = 1.0e-11;
|
|
240867
|
-
// see
|
|
240868
|
-
// on how below variables are derived.
|
|
240989
|
+
// see core\geometry\internaldocs\unitCircleEllipseIntersection.md for derivation of these coefficients.
|
|
240869
240990
|
/** Standard Basis coefficients for the numerator of the y-coordinate y(t) = S(t)/W(t) in the rational semicircle parameterization. */
|
|
240870
240991
|
TrigPolynomial.S = Float64Array.from([0.0, 2.0, -2.0]);
|
|
240871
240992
|
/** Standard Basis coefficients for the numerator of the x-coordinate x(t) = C(t)/W(t) in the rational semicircle parameterization. */
|
|
@@ -247354,7 +247475,7 @@ class PolyfaceClip {
|
|
|
247354
247475
|
this.addRegion(builder, child);
|
|
247355
247476
|
}
|
|
247356
247477
|
else {
|
|
247357
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
247478
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "unexpected region encountered");
|
|
247358
247479
|
}
|
|
247359
247480
|
}
|
|
247360
247481
|
}
|
|
@@ -293797,6 +293918,7 @@ class Parser {
|
|
|
293797
293918
|
* @param inString A string that contains text represent a quantity.
|
|
293798
293919
|
* @param format Defines the likely format of inString. Primary unit serves as a default unit if no unit label found in string.
|
|
293799
293920
|
* @param unitsConversions dictionary of conversions used to convert from unit used in inString to output quantity
|
|
293921
|
+
* @deprecated in 4.10. Check [[Parser.parseQuantityString]] for replacements.
|
|
293800
293922
|
*/
|
|
293801
293923
|
static parseToQuantityValue(inString, format, unitsConversions) {
|
|
293802
293924
|
// TODO: This method is not able to do bearing and azimuth formatting and is overlapping with parseQuantityString.
|
|
@@ -295438,7 +295560,7 @@ class TestContext {
|
|
|
295438
295560
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
295439
295561
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
295440
295562
|
await core_frontend_1.NoRenderApp.startup({
|
|
295441
|
-
applicationVersion: "4.10.0-dev.
|
|
295563
|
+
applicationVersion: "4.10.0-dev.20",
|
|
295442
295564
|
applicationId: this.settings.gprid,
|
|
295443
295565
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
|
|
295444
295566
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -320307,7 +320429,7 @@ function __disposeResources(env) {
|
|
|
320307
320429
|
/***/ ((module) => {
|
|
320308
320430
|
|
|
320309
320431
|
"use strict";
|
|
320310
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.10.0-dev.
|
|
320432
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.10.0-dev.20","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.10.0-dev.20","@itwin/core-bentley":"workspace:^4.10.0-dev.20","@itwin/core-common":"workspace:^4.10.0-dev.20","@itwin/core-geometry":"workspace:^4.10.0-dev.20","@itwin/core-orbitgt":"workspace:^4.10.0-dev.20","@itwin/core-quantity":"workspace:^4.10.0-dev.20"},"//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.2","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.2.4","@itwin/object-storage-core":"^2.2.5","@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"}}');
|
|
320311
320433
|
|
|
320312
320434
|
/***/ }),
|
|
320313
320435
|
|