@itwin/ecschema-rpcinterface-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.
@@ -33142,29 +33142,107 @@ function copyIdSetToUint32Set(dst, src) {
33142
33142
  dst.addId(id);
33143
33143
  }
33144
33144
  }
33145
+ function propsMatchDefaults(props) {
33146
+ return !props.rgb && !props.lineRgb
33147
+ && undefined === props.weight && undefined === props.linePixels
33148
+ && undefined === props.transparency && undefined === props.lineTransparency
33149
+ && !props.ignoresMaterial && !props.nonLocatable && !props.emphasized;
33150
+ }
33151
+ function equalRgb(a, b) {
33152
+ if (a === b) {
33153
+ return true;
33154
+ }
33155
+ else if (!a || !b) {
33156
+ return false;
33157
+ }
33158
+ else {
33159
+ return a.equals(b);
33160
+ }
33161
+ }
33162
+ function equalLineRgb(a, b) {
33163
+ if (a === b) {
33164
+ return true;
33165
+ }
33166
+ else if (a instanceof _RgbColor__WEBPACK_IMPORTED_MODULE_3__.RgbColor && b instanceof _RgbColor__WEBPACK_IMPORTED_MODULE_3__.RgbColor) {
33167
+ return equalRgb(a, b);
33168
+ }
33169
+ else {
33170
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(a === undefined || a === false);
33171
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(b === undefined || b === false);
33172
+ return false;
33173
+ }
33174
+ }
33175
+ function equalTransparency(a, b) {
33176
+ if (a === b) {
33177
+ return true;
33178
+ }
33179
+ else if (undefined === a || undefined === b) {
33180
+ return false;
33181
+ }
33182
+ else {
33183
+ return Math.floor(a * 0xff) === Math.floor(b * 0xff);
33184
+ }
33185
+ }
33186
+ function equalLineTransparency(a, b) {
33187
+ if (a === b) {
33188
+ return true;
33189
+ }
33190
+ else if (typeof a === "number" && typeof b === "number") {
33191
+ return equalTransparency(a, b);
33192
+ }
33193
+ else {
33194
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(a === undefined || a === false);
33195
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(b === undefined || b === false);
33196
+ return false;
33197
+ }
33198
+ }
33199
+ function transparencyFromJSON(transp) {
33200
+ if (undefined === transp) {
33201
+ return undefined;
33202
+ }
33203
+ transp = Math.max(0, Math.min(transp, 1));
33204
+ // Fix up rounding errors...
33205
+ const smallDelta = 0.0001;
33206
+ if (1.0 - transp < smallDelta) {
33207
+ transp = 1.0;
33208
+ }
33209
+ else if (transp < smallDelta) {
33210
+ transp = 0.0;
33211
+ }
33212
+ return transp;
33213
+ }
33145
33214
  /** Defines overrides for selected aspects of a [[Feature]]'s symbology.
33146
33215
  * Any member defined in the appearance overrides that aspect of symbology for all [[Feature]]s to which the appearance is applied.
33216
+ *
33217
+ * The [[rgb]] and [[transparency]] overrides, if defined, apply to all geometry by default.
33218
+ * However, the color and transparency of "linear" geometry can optionally be controlled independently from the rest of the geometry via [[lineRgb]] and [[lineTransparency]].
33219
+ * Linear geometry consists of any of the following:
33220
+ * - Curves and line strings;
33221
+ * - Points and point strings; and
33222
+ * - The outlines of planar regions.
33223
+ * The edges of 3d surfaces like spheres are not considered linear geometry.
33224
+ *
33147
33225
  * @see [[FeatureOverrides]] to customize the appearance of multiple features.
33148
33226
  * @public
33149
33227
  */
33150
33228
  class FeatureAppearance {
33151
33229
  static fromJSON(props) {
33152
- if (undefined === props || (undefined === props.rgb && undefined === props.weight && undefined === props.transparency && undefined === props.linePixels && !props.ignoresMaterial && !props.nonLocatable && !props.emphasized))
33230
+ if (!props || propsMatchDefaults(props)) {
33153
33231
  return this.defaults;
33154
- else
33155
- return new FeatureAppearance(props);
33232
+ }
33233
+ return new FeatureAppearance(props);
33156
33234
  }
33157
33235
  /** Create a FeatureAppearance that overrides only the RGB color.
33158
33236
  * @note The transparency component of the ColorDef is ignored.
33159
33237
  */
33160
33238
  static fromRgb(color) {
33161
- return this.fromJSON({ rgb: _RgbColor__WEBPACK_IMPORTED_MODULE_3__.RgbColor.fromColorDef(color) });
33239
+ return new FeatureAppearance({ rgb: _RgbColor__WEBPACK_IMPORTED_MODULE_3__.RgbColor.fromColorDef(color) });
33162
33240
  }
33163
33241
  /** Create a FeatureAppearance that overrides the RGB and transparency.
33164
33242
  * The appearance's transparency is derived from the transparency component of the ColorDef.
33165
33243
  */
33166
33244
  static fromRgba(color, viewDependentTransparency = false) {
33167
- return this.fromJSON({
33245
+ return new FeatureAppearance({
33168
33246
  rgb: _RgbColor__WEBPACK_IMPORTED_MODULE_3__.RgbColor.fromColorDef(color),
33169
33247
  transparency: color.colors.t / 255,
33170
33248
  viewDependentTransparency: viewDependentTransparency ? true : undefined,
@@ -33172,7 +33250,7 @@ class FeatureAppearance {
33172
33250
  }
33173
33251
  /** Create a FeatureAppearance that overrides only the transparency */
33174
33252
  static fromTransparency(transparencyValue, viewDependent = false) {
33175
- return this.fromJSON({
33253
+ return new FeatureAppearance({
33176
33254
  transparency: transparencyValue,
33177
33255
  viewDependentTransparency: viewDependent ? true : undefined,
33178
33256
  });
@@ -33195,25 +33273,44 @@ class FeatureAppearance {
33195
33273
  get overridesTransparency() { return undefined !== this.transparency; }
33196
33274
  get overridesLinePixels() { return undefined !== this.linePixels; }
33197
33275
  get overridesWeight() { return undefined !== this.weight; }
33276
+ /** Get the color that will be applied to linear geometry, or undefined if not overridden.
33277
+ * This is the same as [[rgb]] if [[lineRgb]] is `undefined`.
33278
+ */
33279
+ getLineRgb() {
33280
+ return false !== this.lineRgb ? (this.lineRgb ?? this.rgb) : undefined;
33281
+ }
33282
+ /** Get the transparency that will be applied to linear geometry, or undefined if not overridden.
33283
+ * This is the same as [[transparency]] if [[lineTransparency]] is `undefined`.
33284
+ */
33285
+ getLineTransparency() {
33286
+ return false !== this.lineTransparency ? (this.lineTransparency ?? this.transparency) : undefined;
33287
+ }
33198
33288
  get overridesSymbology() {
33199
33289
  return this.overridesRgb || this.overridesTransparency || this.overridesWeight || this.overridesLinePixels || !!this.ignoresMaterial
33200
- || this.emphasized || this.overridesNonLocatable;
33290
+ || this.emphasized || this.overridesNonLocatable
33291
+ || undefined !== this.getLineRgb() || undefined !== this.getLineTransparency();
33201
33292
  }
33202
33293
  get overridesNonLocatable() { return undefined !== this.nonLocatable; }
33203
- get isFullyTransparent() { return undefined !== this.transparency && this.transparency >= 1.0; }
33294
+ get isFullyTransparent() {
33295
+ const surf = this.transparency ?? 0;
33296
+ const line = this.getLineTransparency() ?? 0;
33297
+ return surf >= 1 && line >= 1;
33298
+ }
33204
33299
  /** Returns true if any aspect of the appearance is overridden (i.e., if any member is not undefined). */
33205
33300
  get anyOverridden() { return this.overridesSymbology || this.overridesNonLocatable; }
33206
33301
  equals(other) {
33207
33302
  if (this === other)
33208
33303
  return true;
33209
- return this.rgbIsEqual(other.rgb)
33304
+ return equalRgb(this.rgb, other.rgb)
33210
33305
  && this.weight === other.weight
33211
- && this.transparencyIsEqual(other.transparency)
33306
+ && equalTransparency(this.transparency, other.transparency)
33212
33307
  && this.linePixels === other.linePixels
33213
33308
  && this.ignoresMaterial === other.ignoresMaterial
33214
33309
  && this.nonLocatable === other.nonLocatable
33215
33310
  && this.emphasized === other.emphasized
33216
- && this.viewDependentTransparency === other.viewDependentTransparency;
33311
+ && this.viewDependentTransparency === other.viewDependentTransparency
33312
+ && equalLineTransparency(this.lineTransparency, other.lineTransparency)
33313
+ && equalLineRgb(this.lineRgb, other.lineRgb);
33217
33314
  }
33218
33315
  toJSON() {
33219
33316
  const props = {};
@@ -33234,6 +33331,13 @@ class FeatureAppearance {
33234
33331
  props.nonLocatable = true;
33235
33332
  if (true === this.emphasized)
33236
33333
  props.emphasized = true;
33334
+ if (undefined !== this.lineTransparency)
33335
+ props.lineTransparency = this.lineTransparency;
33336
+ if (this.lineRgb) {
33337
+ props.lineRgb = this.lineRgb;
33338
+ if (this.viewDependentTransparency)
33339
+ props.viewDependentTransparency = true;
33340
+ }
33237
33341
  return props;
33238
33342
  }
33239
33343
  /** Convert this appearance to JSON, and override any properties explicitly specified by `changedProps` in the result.
@@ -33280,47 +33384,30 @@ class FeatureAppearance {
33280
33384
  props.nonLocatable = true;
33281
33385
  if (undefined === props.emphasized && this.emphasized)
33282
33386
  props.emphasized = true;
33283
- if (undefined !== props.transparency && this.viewDependentTransparency)
33387
+ if (!props.lineRgb)
33388
+ props.lineRgb = this.lineRgb;
33389
+ if (undefined === props.lineTransparency)
33390
+ props.lineTransparency = this.lineTransparency;
33391
+ if (this.viewDependentTransparency && (undefined !== props.transparency || undefined !== props.lineTransparency))
33284
33392
  props.viewDependentTransparency = true;
33285
33393
  return FeatureAppearance.fromJSON(props);
33286
33394
  }
33287
33395
  constructor(props) {
33288
33396
  this.rgb = undefined !== props.rgb ? _RgbColor__WEBPACK_IMPORTED_MODULE_3__.RgbColor.fromJSON(props.rgb) : undefined;
33397
+ this.lineRgb = typeof props.lineRgb === "object" ? _RgbColor__WEBPACK_IMPORTED_MODULE_3__.RgbColor.fromJSON(props.lineRgb) : (false === props.lineRgb ? false : undefined);
33398
+ this.transparency = transparencyFromJSON(props.transparency);
33399
+ this.lineTransparency = typeof props.lineTransparency === "number" ? transparencyFromJSON(props.lineTransparency) : (false === props.lineTransparency ? false : undefined);
33289
33400
  this.weight = props.weight;
33290
- this.transparency = props.transparency;
33291
33401
  this.linePixels = props.linePixels;
33292
33402
  this.ignoresMaterial = props.ignoresMaterial;
33293
33403
  this.nonLocatable = props.nonLocatable;
33294
33404
  this.emphasized = props.emphasized;
33295
- if (undefined !== this.weight)
33405
+ if (undefined !== this.weight) {
33296
33406
  this.weight = Math.max(1, Math.min(this.weight, 32));
33297
- if (undefined !== this.transparency) {
33298
- if (props.viewDependentTransparency)
33299
- this.viewDependentTransparency = true;
33300
- this.transparency = Math.max(0, Math.min(this.transparency, 1));
33301
- // Fix up rounding errors...
33302
- const smallDelta = 0.0001;
33303
- if (1.0 - this.transparency < smallDelta)
33304
- this.transparency = 1.0;
33305
- else if (this.transparency < smallDelta)
33306
- this.transparency = 0.0;
33307
- }
33308
- }
33309
- rgbIsEqual(rgb) {
33310
- if (undefined === this.rgb)
33311
- return undefined === rgb;
33312
- else if (undefined === rgb)
33313
- return false;
33314
- else
33315
- return this.rgb.equals(rgb);
33316
- }
33317
- transparencyIsEqual(transp) {
33318
- if (undefined === this.transparency)
33319
- return undefined === transp;
33320
- else if (undefined === transp)
33321
- return false;
33322
- else
33323
- return Math.floor(this.transparency * 0xff) === Math.floor(transp * 0xff);
33407
+ }
33408
+ if (props.viewDependentTransparency && (undefined !== this.transparency || undefined !== this.getLineTransparency())) {
33409
+ this.viewDependentTransparency = true;
33410
+ }
33324
33411
  }
33325
33412
  }
33326
33413
  /** An appearance that overrides nothing. */
@@ -110109,8 +110196,8 @@ class RenderSystem {
110109
110196
  */
110110
110197
  createSkyBox(_params) { return undefined; }
110111
110198
  /** Create a RenderGraphic consisting of a list of Graphics, with optional transform and symbology overrides applied to the list */
110112
- createBranch(branch, transform) {
110113
- return this.createGraphicBranch(branch, transform);
110199
+ createBranch(branch, transform, options) {
110200
+ return this.createGraphicBranch(branch, transform, options);
110114
110201
  }
110115
110202
  /** Create a node in the scene graph corresponding to a transform node in the scene's schedule script.
110116
110203
  * Nodes under this branch will only be drawn if they belong to the specified transform node.
@@ -112091,6 +112178,7 @@ class BranchState {
112091
112178
  get realityModelDisplaySettings() { return this._opts.realityModelDisplaySettings; }
112092
112179
  get viewAttachmentId() { return this._opts.viewAttachmentId; }
112093
112180
  get groupNodeId() { return this._opts.groupNodeId; }
112181
+ get disableClipStyle() { return this._opts.disableClipStyle; }
112094
112182
  get symbologyOverrides() {
112095
112183
  return this._opts.symbologyOverrides;
112096
112184
  }
@@ -112123,6 +112211,7 @@ class BranchState {
112123
112211
  realityModelDisplaySettings: branch.branch.realityModelDisplaySettings ?? prev.realityModelDisplaySettings,
112124
112212
  viewAttachmentId: branch.viewAttachmentId ?? prev.viewAttachmentId,
112125
112213
  groupNodeId: branch.branch.groupNodeId ?? prev.groupNodeId,
112214
+ disableClipStyle: branch.disableClipStyle ?? prev.disableClipStyle,
112126
112215
  });
112127
112216
  }
112128
112217
  getFeatureAppearance(overrides, elemLo, elemHi, subcatLo, subcatHi, geomClass, modelLo, modelHi, type, animationNodeId) {
@@ -112175,6 +112264,7 @@ __webpack_require__.r(__webpack_exports__);
112175
112264
  /* harmony import */ var _RenderCommands__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./RenderCommands */ "../../core/frontend/lib/esm/render/webgl/RenderCommands.js");
112176
112265
  /* harmony import */ var _Sync__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Sync */ "../../core/frontend/lib/esm/render/webgl/Sync.js");
112177
112266
  /* harmony import */ var _ClipStack__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ClipStack */ "../../core/frontend/lib/esm/render/webgl/ClipStack.js");
112267
+ /* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
112178
112268
  /*---------------------------------------------------------------------------------------------
112179
112269
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
112180
112270
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -112190,6 +112280,7 @@ __webpack_require__.r(__webpack_exports__);
112190
112280
 
112191
112281
 
112192
112282
 
112283
+
112193
112284
  function equalXYZs(a, b) {
112194
112285
  if (a === b)
112195
112286
  return true;
@@ -112246,6 +112337,7 @@ class BranchUniforms {
112246
112337
  pushBranch(branch) {
112247
112338
  (0,_Sync__WEBPACK_IMPORTED_MODULE_6__.desync)(this);
112248
112339
  this._stack.pushBranch(branch);
112340
+ this.setClipStyle(this.top.disableClipStyle);
112249
112341
  if (this.top.clipVolume)
112250
112342
  this.clipStack.push(this.top.clipVolume);
112251
112343
  if (branch.branch.realityModelDisplaySettings)
@@ -112264,6 +112356,7 @@ class BranchUniforms {
112264
112356
  if (this.top.clipVolume)
112265
112357
  this.clipStack.pop();
112266
112358
  this._stack.pop();
112359
+ this.setClipStyle(this.top.disableClipStyle);
112267
112360
  }
112268
112361
  pushViewClip() {
112269
112362
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!this._viewClipEnabled);
@@ -112373,6 +112466,16 @@ class BranchUniforms {
112373
112466
  }
112374
112467
  return true;
112375
112468
  }
112469
+ // set the clip style based on disableClipStyle
112470
+ setClipStyle(disableClipStyle) {
112471
+ const vp = _IModelApp__WEBPACK_IMPORTED_MODULE_8__.IModelApp.viewManager.selectedView;
112472
+ if (vp) {
112473
+ const style = vp.view.displayStyle.settings.clipStyle;
112474
+ this.clipStack.insideColor.alpha = disableClipStyle ? 0 : (style.insideColor ? 1 : 0);
112475
+ this.clipStack.outsideColor.alpha = disableClipStyle ? 0 : (style.outsideColor ? 1 : 0);
112476
+ this.clipStack.intersectionStyle.alpha = disableClipStyle ? 0 : (style.intersectionStyle ? style.intersectionStyle.width : 0);
112477
+ }
112478
+ }
112376
112479
  }
112377
112480
 
112378
112481
 
@@ -114749,7 +114852,7 @@ class EdgeSettings {
114749
114852
  if (!this.isOverridden(vf))
114750
114853
  return 0 /* OvrFlags.None */;
114751
114854
  // Alpha always overridden - transparent edges only supported in wireframe mode.
114752
- let flags = this.getColor(vf) ? 6 /* OvrFlags.Rgba */ : 4 /* OvrFlags.Alpha */;
114855
+ let flags = this.getColor(vf) ? (6 /* OvrFlags.Rgba */ | 1 /* OvrFlags.LineRgb */ | 8 /* OvrFlags.LineAlpha */) : (4 /* OvrFlags.Alpha */ | 8 /* OvrFlags.LineAlpha */);
114753
114856
  if (undefined !== this.getLineCode(pass, vf))
114754
114857
  flags |= 64 /* OvrFlags.LineCode */;
114755
114858
  if (undefined !== this.getWeight(pass, vf))
@@ -114875,7 +114978,7 @@ class FeatureOverrides {
114875
114978
  /** For tests. */
114876
114979
  get lutData() { return this._lut?.dataBytes; }
114877
114980
  get byteLength() { return undefined !== this._lut ? this._lut.bytesUsed : 0; }
114878
- get isUniform() { return 2 === this._lutParams[0] && 1 === this._lutParams[1]; }
114981
+ get isUniform() { return 3 === this._lutParams[0] && 1 === this._lutParams[1]; }
114879
114982
  updateUniformSymbologyFlags() {
114880
114983
  this._uniformSymbologyFlags = 0 /* EmphasisFlags.None */;
114881
114984
  if (!this.isUniform || !this._lut)
@@ -114901,7 +115004,7 @@ class FeatureOverrides {
114901
115004
  }
114902
115005
  _initialize(map, ovrs, pickExcludes, hilite, flashed) {
114903
115006
  const nFeatures = map.numFeatures;
114904
- const dims = computeWidthAndHeight(nFeatures, 2);
115007
+ const dims = computeWidthAndHeight(nFeatures, 3);
114905
115008
  const width = dims.width;
114906
115009
  const height = dims.height;
114907
115010
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(width * height >= nFeatures);
@@ -114923,6 +115026,25 @@ class FeatureOverrides {
114923
115026
  }
114924
115027
  lut.update(updater);
114925
115028
  }
115029
+ setTransparency(transparency, viewDependentTransparency, data, transparencyByteIndex, curFlags) {
115030
+ // transparency in range [0, 1]...convert to byte and invert so 0=transparent...
115031
+ let alpha = 1.0 - transparency;
115032
+ alpha = Math.floor(0xff * alpha + 0.5);
115033
+ if ((0xff - alpha) < _common_internal_render_DisplayParams__WEBPACK_IMPORTED_MODULE_8__.DisplayParams.minTransparency)
115034
+ alpha = 0xff;
115035
+ data.setByteAtIndex(transparencyByteIndex, alpha);
115036
+ if (0xff === alpha) {
115037
+ this._anyOpaque = true;
115038
+ }
115039
+ else {
115040
+ this._anyTranslucent = true;
115041
+ if (!viewDependentTransparency) {
115042
+ curFlags |= 1024 /* OvrFlags.ViewIndependentTransparency */;
115043
+ this._anyViewIndependentTranslucent = true;
115044
+ }
115045
+ }
115046
+ return curFlags;
115047
+ }
114926
115048
  buildLookupTable(data, map, ovr, pickExclude, flashedIdParts, hilites) {
114927
115049
  const allowHilite = true !== this._options.noHilite;
114928
115050
  const allowFlash = true !== this._options.noFlash;
@@ -114932,7 +115054,7 @@ class FeatureOverrides {
114932
115054
  this._anyOpaque = this._anyTranslucent = this._anyViewIndependentTranslucent = this._anyHilited = false;
114933
115055
  let nHidden = 0;
114934
115056
  let nOverridden = 0;
114935
- // NB: We currently use 2 RGBA values per feature as follows:
115057
+ // NB: We currently use 3 RGBA values per feature as follows:
114936
115058
  // [0]
114937
115059
  // RG = override flags (see OvrFlags enum)
114938
115060
  // B = line code
@@ -114940,9 +115062,12 @@ class FeatureOverrides {
114940
115062
  // [1]
114941
115063
  // RGB = rgb
114942
115064
  // A = alpha
115065
+ // [2]
115066
+ // RGB = line rgb
115067
+ // A = line alpha
114943
115068
  for (const feature of map.iterable(scratchPackedFeature)) {
114944
115069
  const i = feature.index;
114945
- const dataIndex = i * 4 * 2;
115070
+ const dataIndex = i * 4 * 3;
114946
115071
  if (prevModelId.lower !== feature.modelId.lower || prevModelId.upper !== feature.modelId.upper) {
114947
115072
  prevModelId.lower = feature.modelId.lower;
114948
115073
  prevModelId.upper = feature.modelId.upper;
@@ -114955,7 +115080,7 @@ class FeatureOverrides {
114955
115080
  // (The latter is how we clip the classified model using the classifiers).
114956
115081
  if (undefined === app) {
114957
115082
  // The feature is not visible. We don't care about any of the other overrides, because we're not going to render it.
114958
- data.setOvrFlagsAtIndex(dataIndex, 1 /* OvrFlags.Visibility */);
115083
+ data.setOvrFlagsAtIndex(dataIndex, 4096 /* OvrFlags.Visibility */);
114959
115084
  nHidden++;
114960
115085
  nOverridden++;
114961
115086
  continue;
@@ -114977,23 +115102,20 @@ class FeatureOverrides {
114977
115102
  data.setByteAtIndex(dataIndex + 6, rgb.b);
114978
115103
  }
114979
115104
  if (undefined !== app.transparency) {
114980
- // transparency in range [0, 1]...convert to byte and invert so 0=transparent...
114981
115105
  flags |= 4 /* OvrFlags.Alpha */;
114982
- let alpha = 1.0 - app.transparency;
114983
- alpha = Math.floor(0xff * alpha + 0.5);
114984
- if ((0xff - alpha) < _common_internal_render_DisplayParams__WEBPACK_IMPORTED_MODULE_8__.DisplayParams.minTransparency)
114985
- alpha = 0xff;
114986
- data.setByteAtIndex(dataIndex + 7, alpha);
114987
- if (0xff === alpha) {
114988
- this._anyOpaque = true;
114989
- }
114990
- else {
114991
- this._anyTranslucent = true;
114992
- if (!app.viewDependentTransparency) {
114993
- flags |= 1024 /* OvrFlags.ViewIndependentTransparency */;
114994
- this._anyViewIndependentTranslucent = true;
114995
- }
114996
- }
115106
+ flags = this.setTransparency(app.transparency, app.viewDependentTransparency, data, dataIndex + 7, flags);
115107
+ }
115108
+ const lineRgb = app.getLineRgb();
115109
+ if (lineRgb) {
115110
+ flags |= 1 /* OvrFlags.LineRgb */;
115111
+ data.setByteAtIndex(dataIndex + 8, lineRgb.r);
115112
+ data.setByteAtIndex(dataIndex + 9, lineRgb.g);
115113
+ data.setByteAtIndex(dataIndex + 10, lineRgb.b);
115114
+ }
115115
+ const lineTransp = app.getLineTransparency();
115116
+ if (undefined !== lineTransp) {
115117
+ flags |= 8 /* OvrFlags.LineAlpha */;
115118
+ flags = this.setTransparency(lineTransp, app.viewDependentTransparency, data, dataIndex + 11, flags);
114997
115119
  }
114998
115120
  if (app.overridesWeight && app.weight) {
114999
115121
  flags |= 128 /* OvrFlags.Weight */;
@@ -115008,7 +115130,7 @@ class FeatureOverrides {
115008
115130
  data.setByteAtIndex(dataIndex + 2, lineCode);
115009
115131
  }
115010
115132
  if (app.ignoresMaterial)
115011
- flags |= 8 /* OvrFlags.IgnoreMaterial */;
115133
+ flags |= 8192 /* OvrFlags.IgnoreMaterial */;
115012
115134
  if (allowFlash && undefined !== flashedIdParts && feature.elementId.lower === flashedIdParts.lower && feature.elementId.upper === flashedIdParts.upper)
115013
115135
  flags |= 16 /* OvrFlags.Flashed */;
115014
115136
  if (pickExclude?.hasPair(feature.elementId)) {
@@ -115033,9 +115155,9 @@ class FeatureOverrides {
115033
115155
  const intersect = "intersection" === hilites.modelSubCategoryMode;
115034
115156
  this._anyOverridden = this._anyHilited = false;
115035
115157
  for (const feature of map.iterable(scratchPackedFeature)) {
115036
- const dataIndex = feature.index * 4 * 2;
115158
+ const dataIndex = feature.index * 4 * 3;
115037
115159
  const oldFlags = data.getOvrFlagsAtIndex(dataIndex);
115038
- if (0 /* OvrFlags.None */ !== (oldFlags & 1 /* OvrFlags.Visibility */)) {
115160
+ if (0 /* OvrFlags.None */ !== (oldFlags & 4096 /* OvrFlags.Visibility */)) {
115039
115161
  // If it's invisible, none of the other flags matter. We can't flash it and don't want to hilite it.
115040
115162
  this._anyOverridden = true;
115041
115163
  continue;
@@ -115069,9 +115191,9 @@ class FeatureOverrides {
115069
115191
  this._anyOverridden = false;
115070
115192
  const elemId = { lower: 0, upper: 0 };
115071
115193
  for (let i = 0; i < map.numFeatures; i++) {
115072
- const dataIndex = i * 4 * 2;
115194
+ const dataIndex = i * 4 * 3;
115073
115195
  const oldFlags = data.getOvrFlagsAtIndex(dataIndex);
115074
- if (0 /* OvrFlags.None */ !== (oldFlags & 1 /* OvrFlags.Visibility */)) {
115196
+ if (0 /* OvrFlags.None */ !== (oldFlags & 4096 /* OvrFlags.Visibility */)) {
115075
115197
  // If it's invisible, none of the other flags matter and we can't flash it.
115076
115198
  this._anyOverridden = true;
115077
115199
  continue;
@@ -116556,6 +116678,7 @@ class Branch extends Graphic {
116556
116678
  this.iModel = opts.iModel;
116557
116679
  this.frustum = opts.frustum;
116558
116680
  this.viewAttachmentId = opts.viewAttachmentId;
116681
+ this.disableClipStyle = opts.disableClipStyle;
116559
116682
  this.transformFromExternalIModel = opts.transformFromIModel;
116560
116683
  if (opts.hline)
116561
116684
  this.edgeSettings = _EdgeSettings__WEBPACK_IMPORTED_MODULE_6__.EdgeSettings.create(opts.hline);
@@ -120383,7 +120506,7 @@ class RealityMeshGeometry extends _CachedGeometry__WEBPACK_IMPORTED_MODULE_7__.I
120383
120506
  const primitive = _Primitive__WEBPACK_IMPORTED_MODULE_10__.Primitive.create(mesh);
120384
120507
  branch.add(system.createBatch(primitive, featureTable, mesh.getRange(), { tileId }));
120385
120508
  }
120386
- return system.createBranch(branch, realityMesh._transform ? realityMesh._transform : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity());
120509
+ return system.createBranch(branch, realityMesh._transform ? realityMesh._transform : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity(), { disableClipStyle: params.disableClipStyle });
120387
120510
  }
120388
120511
  collectStatistics(stats) {
120389
120512
  this._isTerrain ? stats.addTerrain(this._realityMeshParams.bytesUsed) : stats.addRealityMesh(this._realityMeshParams.bytesUsed);
@@ -134641,10 +134764,10 @@ __webpack_require__.r(__webpack_exports__);
134641
134764
  /** @internal */
134642
134765
  function addOvrFlagConstants(builder) {
134643
134766
  // NB: These are the bit positions of each flag in OvrFlags enum - not the flag values
134644
- builder.addBitFlagConstant("kOvrBit_Visibility", 0);
134767
+ builder.addBitFlagConstant("kOvrBit_LineRgb", 0);
134645
134768
  builder.addBitFlagConstant("kOvrBit_Rgb", 1);
134646
134769
  builder.addBitFlagConstant("kOvrBit_Alpha", 2);
134647
- builder.addBitFlagConstant("kOvrBit_IgnoreMaterial", 3);
134770
+ builder.addBitFlagConstant("kOvrBit_LineAlpha", 3);
134648
134771
  builder.addBitFlagConstant("kOvrBit_Flashed", 4);
134649
134772
  builder.addBitFlagConstant("kOvrBit_NonLocatable", 5);
134650
134773
  builder.addBitFlagConstant("kOvrBit_LineCode", 6);
@@ -134654,6 +134777,8 @@ function addOvrFlagConstants(builder) {
134654
134777
  builder.addBitFlagConstant("kOvrBit_Emphasized", 1);
134655
134778
  builder.addBitFlagConstant("kOvrBit_ViewIndependentTransparency", 2);
134656
134779
  builder.addBitFlagConstant("kOvrBit_InvisibleDuringPick", 3);
134780
+ builder.addBitFlagConstant("kOvrBit_Visibility", 4);
134781
+ builder.addBitFlagConstant("kOvrBit_IgnoreMaterial", 5);
134657
134782
  }
134658
134783
  const computeLUTFeatureIndex = `g_featureAndMaterialIndex.xyz`;
134659
134784
  const computeInstanceFeatureIndex = `g_isAreaPattern ? u_patternFeatureId : a_featureId`;
@@ -134699,9 +134824,9 @@ vec4 getFirstFeatureRgba() {
134699
134824
  }
134700
134825
  `;
134701
134826
  const getSecondFeatureRgba = `
134702
- vec4 getSecondFeatureRgba() {
134827
+ vec4 getSecondFeatureRgba(bool isLinear) {
134703
134828
  vec2 coord = feature_texCoord;
134704
- coord.x += g_feature_stepX;
134829
+ coord.x += g_feature_stepX * (isLinear ? 2.0 : 1.0);
134705
134830
  return TEXTURE(u_featureLUT, coord);
134706
134831
  }
134707
134832
  `;
@@ -134819,7 +134944,7 @@ function addCommon(builder, mode, opts, wantGlobalOvrFlags = true) {
134819
134944
  });
134820
134945
  });
134821
134946
  }
134822
- (0,_LookupTable__WEBPACK_IMPORTED_MODULE_5__.addLookupTable)(vert, "feature", "2.0");
134947
+ (0,_LookupTable__WEBPACK_IMPORTED_MODULE_5__.addLookupTable)(vert, "feature", "3.0");
134823
134948
  vert.addGlobal("feature_texCoord", 3 /* VariableType.Vec2 */);
134824
134949
  vert.addFunction(computeFeatureTextureCoords);
134825
134950
  vert.addFunction(getFirstFeatureRgba);
@@ -135014,6 +135139,7 @@ const checkForEarlySurfaceDiscardWithFeatureID = `
135014
135139
  function addRenderOrderConstants(builder) {
135015
135140
  builder.addConstant("kRenderOrder_BlankingRegion", 2 /* VariableType.Float */, 2 /* RenderOrder.BlankingRegion */.toFixed(1));
135016
135141
  builder.addConstant("kRenderOrder_Linear", 2 /* VariableType.Float */, 5 /* RenderOrder.Linear */.toFixed(1));
135142
+ builder.addConstant("kRenderOrder_PlanarLinear", 2 /* VariableType.Float */, 13 /* RenderOrder.PlanarLinear */.toFixed(1));
135017
135143
  builder.addConstant("kRenderOrder_Edge", 2 /* VariableType.Float */, 6 /* RenderOrder.Edge */.toFixed(1));
135018
135144
  builder.addConstant("kRenderOrder_PlanarEdge", 2 /* VariableType.Float */, 14 /* RenderOrder.PlanarEdge */.toFixed(1));
135019
135145
  builder.addConstant("kRenderOrder_Silhouette", 2 /* VariableType.Float */, 7 /* RenderOrder.Silhouette */.toFixed(1));
@@ -135149,20 +135275,21 @@ const computeFeatureOverrides = `
135149
135275
  v_feature_emphasis = kEmphFlag_Hilite * extractNthBit(emphFlags, kOvrBit_Hilited) + kEmphFlag_Emphasize * extractNthBit(emphFlags, kOvrBit_Emphasized);
135150
135276
 
135151
135277
  float flags = value.x * 256.0;
135152
- if (0.0 == flags)
135278
+ if (0.0 == flags && 0.0 == emphFlags)
135153
135279
  return; // nothing overridden for this feature
135154
135280
 
135155
135281
  bool nonLocatable = (u_shaderFlags[kShaderBit_IgnoreNonLocatable] ? nthFeatureBitSet(flags, kOvrBit_NonLocatable) : false);
135156
135282
  v_feature_emphasis += kEmphFlag_NonLocatable * float(nthFeatureBitSet(flags, kOvrBit_NonLocatable));
135157
- bool invisible = nthFeatureBitSet(flags, kOvrBit_Visibility);
135283
+ bool invisible = nthFeatureBitSet(emphFlags, kOvrBit_Visibility);
135158
135284
  feature_invisible = invisible || nonLocatable;
135159
135285
  if (feature_invisible)
135160
135286
  return;
135161
135287
 
135162
- bool rgbOverridden = nthFeatureBitSet(flags, kOvrBit_Rgb);
135163
- bool alphaOverridden = nthFeatureBitSet(flags, kOvrBit_Alpha);
135288
+ bool isLinear = u_renderOrder == kRenderOrder_Linear || u_renderOrder == kRenderOrder_PlanarLinear || u_renderOrder == kRenderOrder_PlanarEdge;
135289
+ bool rgbOverridden = isLinear ? nthFeatureBitSet(flags, kOvrBit_LineRgb) : nthFeatureBitSet(flags, kOvrBit_Rgb);
135290
+ bool alphaOverridden = isLinear ? nthFeatureBitSet(flags, kOvrBit_LineAlpha) : nthFeatureBitSet(flags, kOvrBit_Alpha);
135164
135291
  if (alphaOverridden || rgbOverridden) {
135165
- vec4 rgba = getSecondFeatureRgba();
135292
+ vec4 rgba = getSecondFeatureRgba(isLinear);
135166
135293
  if (rgbOverridden)
135167
135294
  feature_rgb = rgba.rgb;
135168
135295
 
@@ -135177,7 +135304,7 @@ const computeFeatureOverrides = `
135177
135304
  nthFeatureBitSet(flags, kOvrBit_LineCode),
135178
135305
  value.z * 256.0);
135179
135306
 
135180
- feature_ignore_material = nthFeatureBitSet(flags, kOvrBit_IgnoreMaterial);
135307
+ feature_ignore_material = nthFeatureBitSet(emphFlags, kOvrBit_IgnoreMaterial);
135181
135308
  use_material = use_material && !feature_ignore_material;
135182
135309
 
135183
135310
  v_feature_emphasis += kEmphFlag_Flash * extractNthFeatureBit(flags, kOvrBit_Flashed);
@@ -135265,6 +135392,8 @@ function addFeatureSymbology(builder, feat, opts) {
135265
135392
  vert.addGlobal("feature_viewIndependentTransparency", 0 /* VariableType.Boolean */, "false");
135266
135393
  addEmphasisFlags(vert);
135267
135394
  vert.addGlobal("use_material", 0 /* VariableType.Boolean */, "true");
135395
+ addRenderOrder(vert);
135396
+ addRenderOrderConstants(vert);
135268
135397
  vert.set(3 /* VertexShaderComponent.ComputeFeatureOverrides */, computeFeatureOverrides);
135269
135398
  vert.set(7 /* VertexShaderComponent.ApplyFeatureColor */, applyFeatureColor);
135270
135399
  addApplyFlash(builder.frag);
@@ -157587,7 +157716,7 @@ class MapTile extends _internal__WEBPACK_IMPORTED_MODULE_7__.RealityTile {
157587
157716
  return undefined;
157588
157717
  const textures = this.getDrapeTextures();
157589
157718
  const { baseColor, baseTransparent, layerClassifiers } = this.mapTree;
157590
- 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);
157719
+ 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);
157591
157720
  // 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.
157592
157721
  if (this.imageryIsReady && 0 === this.mapTree.layerClassifiers.size)
157593
157722
  this._graphic = graphic;
@@ -187474,19 +187603,19 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
187474
187603
  }
187475
187604
  /**
187476
187605
  * Create an elliptical arc from three points on the ellipse: two points on an axis and one in between.
187477
- * @param point0 start of arc, on an axis
187478
- * @param point1 point on arc somewhere between `point0` and `point2`
187479
- * @param point2 point on arc directly opposite `point0`
187480
- * @param sweep angular sweep, measured from `point0` in the direction of `point1`.
187481
- * For a half-ellipse from `point0` to `point2` passing through `point1`, pass `AngleSweep.createStartEndDegrees(0,180)`.
187606
+ * @param start start of arc, on an axis
187607
+ * @param middle point on arc somewhere between `start` and `end`
187608
+ * @param end point on arc directly opposite `start`
187609
+ * @param sweep angular sweep, measured from `start` in the direction of `middle`.
187610
+ * For a half-ellipse from `start` to `end` passing through `middle`, pass `AngleSweep.createStartEndDegrees(0,180)`.
187482
187611
  * Default value is full sweep to create the entire ellipse.
187483
187612
  * @param result optional preallocated result
187484
187613
  * @returns elliptical arc, or undefined if construction impossible.
187485
187614
  */
187486
- static createStartMiddleEnd(point0, point1, point2, sweep, result) {
187487
- const center = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Point3d.createAdd2Scaled(point0, 0.5, point2, 0.5);
187488
- const vector0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.createStartEnd(center, point0);
187489
- const vector1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.createStartEnd(center, point1);
187615
+ static createStartMiddleEnd(start, middle, end, sweep, result) {
187616
+ const center = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Point3d.createAdd2Scaled(start, 0.5, end, 0.5);
187617
+ const vector0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.createStartEnd(center, start);
187618
+ const vector1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.createStartEnd(center, middle);
187490
187619
  const v0DotV1 = vector0.dotProduct(vector1);
187491
187620
  const v0Len2 = vector0.magnitudeSquared();
187492
187621
  if (Math.abs(v0DotV1) >= v0Len2)
@@ -187494,7 +187623,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
187494
187623
  const normal = vector0.crossProduct(vector1);
187495
187624
  const vector90 = normal.unitCrossProductWithDefault(vector0, 0, 0, 0);
187496
187625
  const v1DotV90 = vector1.dotProduct(vector90);
187497
- // Solve the standard ellipse equation for the unknown axis length, given local coords of point1 (v0.v1/||v0||, v90.v1)
187626
+ // solve the standard ellipse equation for the unknown axis length, given local coords of middle (v0.v1/||v0||, v90.v1)
187498
187627
  const v90Len = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.safeDivideFraction(v0Len2 * v1DotV90, Math.sqrt(v0Len2 * v0Len2 - v0DotV1 * v0DotV1), 0);
187499
187628
  if (_Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.isSmallMetricDistanceSquared(v90Len))
187500
187629
  return undefined;
@@ -187503,33 +187632,55 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
187503
187632
  }
187504
187633
  /**
187505
187634
  * Create a circular arc defined by start point, tangent at start point, and end point.
187506
- * If tangent is parallel to line segment from start to end, return the line segment.
187635
+ * * The circular arc is swept from `start` to `end` in the direction of `tangentAtStart`.
187636
+ * * If `tangentAtStart` is parallel to the line segment from `start` to `end`, return the line segment.
187507
187637
  */
187508
187638
  static createCircularStartTangentEnd(start, tangentAtStart, end, result) {
187509
- // To find the circle passing through start and end with tangentAtStart at start:
187510
- // - find line 1: the perpendicular bisector of the line from start to end.
187511
- // - find line 2: the perpendicular to the tangentAtStart.
187512
- // - intersection of the two lines would be the circle center.
187513
- const vector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.createStartEnd(start, end);
187514
- const normal = tangentAtStart.crossProduct(vector).normalize();
187515
- if (normal) {
187516
- const vectorPerp = normal.crossProduct(vector);
187517
- const tangentPerp = normal.crossProduct(tangentAtStart);
187518
- const midPoint = start.plusScaled(vector, 0.5);
187519
- const lineSeg1 = _LineSegment3d__WEBPACK_IMPORTED_MODULE_6__.LineSegment3d.create(start, start.plusScaled(tangentPerp, 1));
187520
- const lineSeg2 = _LineSegment3d__WEBPACK_IMPORTED_MODULE_6__.LineSegment3d.create(midPoint, midPoint.plusScaled(vectorPerp, 1));
187521
- const intersection = _LineSegment3d__WEBPACK_IMPORTED_MODULE_6__.LineSegment3d.closestApproach(lineSeg1, true, lineSeg2, true);
187522
- if (intersection) {
187523
- const center = intersection.detailA.point;
187524
- const vector0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.createStartEnd(center, start);
187525
- const vector90 = normal.crossProduct(vector0);
187526
- const endVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.createStartEnd(center, end);
187527
- const sweep = _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_2__.AngleSweep.create(vector0.signedAngleTo(endVector, normal));
187639
+ // see itwinjs-core\core\geometry\internaldocs\Arc3d.md to clarify below algorithm
187640
+ const startToEnd = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.createStartEnd(start, end);
187641
+ const frame = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_3__.Matrix3d.createRigidFromColumns(tangentAtStart, startToEnd, _Geometry__WEBPACK_IMPORTED_MODULE_5__.AxisOrder.XYZ);
187642
+ if (frame !== undefined) {
187643
+ const vv = startToEnd.dotProduct(startToEnd);
187644
+ const vw = frame.dotColumnY(startToEnd);
187645
+ const radius = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.conditionalDivideCoordinate(vv, 2 * vw);
187646
+ if (radius !== undefined) {
187647
+ const vector0 = frame.columnY();
187648
+ vector0.scaleInPlace(-radius); // center to start
187649
+ const vector90 = frame.columnX();
187650
+ vector90.scaleInPlace(radius);
187651
+ const centerToEnd = vector0.plus(startToEnd);
187652
+ const sweepAngle = vector0.angleTo(centerToEnd);
187653
+ let sweepRadians = sweepAngle.radians; // always positive and less than PI
187654
+ if (tangentAtStart.dotProduct(centerToEnd) < 0.0) // sweepRadians is the wrong way
187655
+ sweepRadians = 2.0 * Math.PI - sweepRadians;
187656
+ const center = start.plusScaled(vector0, -1.0);
187657
+ const sweep = _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_2__.AngleSweep.createStartEndRadians(0.0, sweepRadians);
187528
187658
  return Arc3d.create(center, vector0, vector90, sweep, result);
187529
187659
  }
187530
187660
  }
187531
187661
  return _LineSegment3d__WEBPACK_IMPORTED_MODULE_6__.LineSegment3d.create(start, end);
187532
187662
  }
187663
+ /**
187664
+ * Create a circular arc from start point, tangent at start, radius, optional plane normal, arc sweep.
187665
+ * * The vector from start point to center is in the direction of upVector crossed with tangentA.
187666
+ * @param start start point.
187667
+ * @param tangentAtStart vector in tangent direction at the start.
187668
+ * @param radius signed radius.
187669
+ * @param upVector optional out-of-plane vector. Defaults to positive Z.
187670
+ * @param sweep angular range. If single `Angle` is given, start angle is at 0 degrees (the start point).
187671
+ */
187672
+ static createCircularStartTangentRadius(start, tangentAtStart, radius, upVector, sweep) {
187673
+ if (upVector === undefined)
187674
+ upVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.unitZ();
187675
+ const vector0 = upVector.unitCrossProduct(tangentAtStart);
187676
+ if (vector0 === undefined)
187677
+ return undefined;
187678
+ const center = start.plusScaled(vector0, radius);
187679
+ // reverse the A-to-center vector and bring it up to scale
187680
+ vector0.scaleInPlace(-radius);
187681
+ const vector90 = tangentAtStart.scaleToLength(Math.abs(radius)); // cannot fail; prior unitCrossProduct would have failed first
187682
+ return Arc3d.create(center, vector0, vector90, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_2__.AngleSweep.create(sweep));
187683
+ }
187533
187684
  /**
187534
187685
  * Create a circular arc defined by start and end points and radius.
187535
187686
  * @param start start point of the arc
@@ -187944,7 +188095,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
187944
188095
  circularRadius() {
187945
188096
  return this.isCircular ? this._matrix.columnXMagnitude() : undefined;
187946
188097
  }
187947
- /** Return the larger of the two defining vectors. */
188098
+ /** Return the larger length of the two defining vectors. */
187948
188099
  maxVectorLength() {
187949
188100
  return Math.max(this._matrix.columnXMagnitude(), this._matrix.columnYMagnitude());
187950
188101
  }
@@ -188152,12 +188303,12 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
188152
188303
  };
188153
188304
  }
188154
188305
  /** Test if this arc is almost equal to another GeometryQuery object */
188155
- isAlmostEqual(otherGeometry) {
188306
+ isAlmostEqual(otherGeometry, distanceTol = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.smallMetricDistance, radianTol = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.smallAngleRadians) {
188156
188307
  if (otherGeometry instanceof Arc3d) {
188157
188308
  const other = otherGeometry;
188158
- return this._center.isAlmostEqual(other._center)
188159
- && this._matrix.isAlmostEqual(other._matrix)
188160
- && this._sweep.isAlmostEqualAllowPeriodShift(other._sweep);
188309
+ return this._center.isAlmostEqual(other._center, distanceTol)
188310
+ && this._matrix.isAlmostEqual(other._matrix, distanceTol)
188311
+ && this._sweep.isAlmostEqualAllowPeriodShift(other._sweep, radianTol);
188161
188312
  }
188162
188313
  return false;
188163
188314
  }
@@ -188263,7 +188414,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
188263
188414
  * * `point` is the `point1` input.
188264
188415
  * * both fractions are zero
188265
188416
  * * `arc` is undefined.
188266
- * @param point0 first point of path. (the point before the point of inflection)
188417
+ * @param point0 first point of path (the point before the point of inflection)
188267
188418
  * @param point1 second point of path (the point of inflection)
188268
188419
  * @param point2 third point of path (the point after the point of inflection)
188269
188420
  * @param radius arc radius
@@ -190142,28 +190293,28 @@ __webpack_require__.r(__webpack_exports__);
190142
190293
  /* harmony export */ });
190143
190294
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
190144
190295
  /* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
190145
- /* harmony import */ var _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/AngleSweep */ "../../core/geometry/lib/esm/geometry3d/AngleSweep.js");
190146
- /* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
190296
+ /* harmony import */ var _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/AngleSweep */ "../../core/geometry/lib/esm/geometry3d/AngleSweep.js");
190297
+ /* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
190147
190298
  /* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
190148
- /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
190149
- /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
190299
+ /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
190300
+ /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
190150
190301
  /* harmony import */ var _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../geometry3d/PolylineOps */ "../../core/geometry/lib/esm/geometry3d/PolylineOps.js");
190151
190302
  /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
190152
190303
  /* harmony import */ var _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../geometry3d/Segment1d */ "../../core/geometry/lib/esm/geometry3d/Segment1d.js");
190153
190304
  /* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
190154
190305
  /* harmony import */ var _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../numerics/Polynomials */ "../../core/geometry/lib/esm/numerics/Polynomials.js");
190155
- /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
190156
- /* harmony import */ var _solid_Cone__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../solid/Cone */ "../../core/geometry/lib/esm/solid/Cone.js");
190306
+ /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
190307
+ /* harmony import */ var _solid_Cone__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../solid/Cone */ "../../core/geometry/lib/esm/solid/Cone.js");
190157
190308
  /* harmony import */ var _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../solid/RuledSweep */ "../../core/geometry/lib/esm/solid/RuledSweep.js");
190158
- /* harmony import */ var _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../solid/TorusPipe */ "../../core/geometry/lib/esm/solid/TorusPipe.js");
190159
- /* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
190160
- /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
190161
- /* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
190162
- /* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
190309
+ /* harmony import */ var _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../solid/TorusPipe */ "../../core/geometry/lib/esm/solid/TorusPipe.js");
190310
+ /* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
190311
+ /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
190312
+ /* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
190313
+ /* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
190163
190314
  /* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
190164
- /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
190165
- /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
190166
- /* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
190315
+ /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
190316
+ /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
190317
+ /* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
190167
190318
  /* harmony import */ var _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./spiral/IntegratedSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/IntegratedSpiral3d.js");
190168
190319
  /*---------------------------------------------------------------------------------------------
190169
190320
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
@@ -190224,33 +190375,16 @@ class CurveFactory {
190224
190375
  }
190225
190376
  }
190226
190377
  /**
190227
- * Create a circular arc from start point, tangent at start, and another point (endpoint) on the arc.
190228
- * @param pointA
190229
- * @param tangentA
190230
- * @param pointB
190378
+ * Create a circular arc defined by start point, tangent at start point, and end point.
190379
+ * * The circular arc is swept from start to end toward direction of the `tangentAtStart`.
190380
+ * * If tangent is parallel to line segment from start to end, return `undefined`.
190231
190381
  */
190232
- static createArcPointTangentPoint(pointA, tangentA, pointB) {
190233
- const vectorV = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(pointA, pointB);
190234
- const frame = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_3__.Matrix3d.createRigidFromColumns(tangentA, vectorV, _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.XYZ);
190235
- if (frame !== undefined) {
190236
- const vv = vectorV.dotProduct(vectorV);
190237
- const vw = frame.dotColumnY(vectorV);
190238
- const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideCoordinate(vv, 2 * vw);
190239
- if (alpha !== undefined) {
190240
- const vector0 = frame.columnY();
190241
- vector0.scaleInPlace(-alpha);
190242
- const vector90 = frame.columnX();
190243
- vector90.scaleInPlace(alpha);
190244
- const centerToEnd = vector0.plus(vectorV);
190245
- const sweepAngle = vector0.angleTo(centerToEnd);
190246
- let sweepRadians = sweepAngle.radians; // That's always positive and less than PI.
190247
- if (tangentA.dotProduct(centerToEnd) < 0.0) // ah, sweepRadians is the wrong way
190248
- sweepRadians = 2.0 * Math.PI - sweepRadians;
190249
- const center = pointA.plusScaled(vector0, -1.0);
190250
- return _Arc3d__WEBPACK_IMPORTED_MODULE_4__.Arc3d.create(center, vector0, vector90, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_5__.AngleSweep.createStartEndRadians(0.0, sweepRadians));
190251
- }
190252
- }
190253
- return undefined;
190382
+ static createArcPointTangentPoint(start, tangentAtStart, end) {
190383
+ const ret = _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.createCircularStartTangentEnd(start, tangentAtStart, end);
190384
+ if (ret instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d)
190385
+ return ret;
190386
+ else
190387
+ return undefined;
190254
190388
  }
190255
190389
  /**
190256
190390
  * Construct a sequence of alternating lines and arcs with the arcs creating tangent transition between consecutive edges.
@@ -190264,8 +190398,8 @@ class CurveFactory {
190264
190398
  */
190265
190399
  static createFilletsInLineString(points, radius, allowBackupAlongEdge = true) {
190266
190400
  if (Array.isArray(points))
190267
- return this.createFilletsInLineString(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_6__.Point3dArrayCarrier(points), radius, allowBackupAlongEdge);
190268
- if (points instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d)
190401
+ return this.createFilletsInLineString(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_3__.Point3dArrayCarrier(points), radius, allowBackupAlongEdge);
190402
+ if (points instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_4__.LineString3d)
190269
190403
  return this.createFilletsInLineString(points.packedPoints, radius, allowBackupAlongEdge);
190270
190404
  const n = points.length;
190271
190405
  if (n <= 1)
@@ -190286,7 +190420,7 @@ class CurveFactory {
190286
190420
  else if (Number.isFinite(radius))
190287
190421
  thisRadius = radius;
190288
190422
  if (thisRadius !== 0.0)
190289
- blendArray.push(_Arc3d__WEBPACK_IMPORTED_MODULE_4__.Arc3d.createFilletArc(pointA, pointB, pointC, thisRadius));
190423
+ blendArray.push(_Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.createFilletArc(pointA, pointB, pointC, thisRadius));
190290
190424
  else
190291
190425
  blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointB.clone() });
190292
190426
  pointA.setFromPoint3d(pointB);
@@ -190319,7 +190453,7 @@ class CurveFactory {
190319
190453
  }
190320
190454
  } */
190321
190455
  }
190322
- const path = _Path__WEBPACK_IMPORTED_MODULE_8__.Path.create();
190456
+ const path = _Path__WEBPACK_IMPORTED_MODULE_5__.Path.create();
190323
190457
  this.addPartialSegment(path, allowBackupAlongEdge, blendArray[0].point, blendArray[1].point, blendArray[0].fraction12, 1.0 - blendArray[1].fraction10);
190324
190458
  // add each path and successor edge ...
190325
190459
  for (let i = 1; i + 1 < points.length; i++) {
@@ -190342,21 +190476,21 @@ class CurveFactory {
190342
190476
  const yMax = Math.max(y0, y1);
190343
190477
  radius = Math.min(Math.abs(radius), 0.5 * (xMax - xMin), 0.5 * (yMax - yMin));
190344
190478
  if (radius === 0.0)
190345
- return _Loop__WEBPACK_IMPORTED_MODULE_9__.Loop.createPolygon([_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(xMin, yMin, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(xMax, yMin, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(xMax, yMax, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(xMin, yMax, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(xMin, yMin, z)]);
190479
+ 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)]);
190346
190480
  else {
190347
- const vectorU = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(radius, 0, 0);
190348
- const vectorV = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, radius, 0);
190481
+ const vectorU = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(radius, 0, 0);
190482
+ const vectorV = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(0, radius, 0);
190349
190483
  const x0A = xMin + radius;
190350
190484
  const y0A = yMin + radius;
190351
190485
  const x1A = xMax - radius;
190352
190486
  const y1A = yMax - radius;
190353
- const centers = [_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(x1A, y1A, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(x0A, y1A, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(x0A, y0A, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(x1A, y0A, z)];
190354
- const loop = _Loop__WEBPACK_IMPORTED_MODULE_9__.Loop.create();
190487
+ 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)];
190488
+ const loop = _Loop__WEBPACK_IMPORTED_MODULE_6__.Loop.create();
190355
190489
  for (let i = 0; i < 4; i++) {
190356
190490
  const center = centers[i];
190357
190491
  const nextCenter = centers[(i + 1) % 4];
190358
- const edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(center, nextCenter);
190359
- const arc = _Arc3d__WEBPACK_IMPORTED_MODULE_4__.Arc3d.create(center, vectorU, vectorV, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_5__.AngleSweep.createStartEndDegrees(0, 90));
190492
+ const edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(center, nextCenter);
190493
+ const arc = _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.create(center, vectorU, vectorV, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_8__.AngleSweep.createStartEndDegrees(0, 90));
190360
190494
  loop.tryAddChild(arc);
190361
190495
  const arcEnd = arc.endPoint();
190362
190496
  if (!edgeVector.isAlmostZero)
@@ -190408,7 +190542,7 @@ class CurveFactory {
190408
190542
  * @param fractionForIntermediateNormal fractional position for surface normal used to create the section plane.
190409
190543
  */
190410
190544
  static assembleArcChainOnEllipsoid(ellipsoid, pathPoints, fractionForIntermediateNormal = 0.5) {
190411
- const arcPath = _Path__WEBPACK_IMPORTED_MODULE_8__.Path.create();
190545
+ const arcPath = _Path__WEBPACK_IMPORTED_MODULE_5__.Path.create();
190412
190546
  for (let i = 0; i + 1 < pathPoints.length; i++) {
190413
190547
  const arc = ellipsoid.sectionArcWithIntermediateNormal(pathPoints[i].toAngles(), fractionForIntermediateNormal, pathPoints[i + 1].toAngles());
190414
190548
  arcPath.tryAddChild(arc);
@@ -190416,7 +190550,7 @@ class CurveFactory {
190416
190550
  return arcPath;
190417
190551
  }
190418
190552
  static appendGeometryQueryArray(candidate, result) {
190419
- if (candidate instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_10__.GeometryQuery)
190553
+ if (candidate instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_9__.GeometryQuery)
190420
190554
  result.push(candidate);
190421
190555
  else if (Array.isArray(candidate)) {
190422
190556
  for (const p of candidate)
@@ -190430,17 +190564,17 @@ class CurveFactory {
190430
190564
  */
190431
190565
  static createPipeSegments(centerline, pipeRadius) {
190432
190566
  if (centerline instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_1__.LineSegment3d) {
190433
- return _solid_Cone__WEBPACK_IMPORTED_MODULE_11__.Cone.createAxisPoints(centerline.startPoint(), centerline.endPoint(), pipeRadius, pipeRadius, false);
190567
+ return _solid_Cone__WEBPACK_IMPORTED_MODULE_10__.Cone.createAxisPoints(centerline.startPoint(), centerline.endPoint(), pipeRadius, pipeRadius, false);
190434
190568
  }
190435
- else if (centerline instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_4__.Arc3d) {
190436
- return _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_12__.TorusPipe.createAlongArc(centerline, pipeRadius, false);
190569
+ else if (centerline instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
190570
+ return _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_11__.TorusPipe.createAlongArc(centerline, pipeRadius, false);
190437
190571
  }
190438
- else if (centerline instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_13__.CurvePrimitive) {
190439
- const builder = _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_14__.PolyfaceBuilder.create();
190572
+ else if (centerline instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__.CurvePrimitive) {
190573
+ const builder = _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_13__.PolyfaceBuilder.create();
190440
190574
  builder.addMiteredPipes(centerline, pipeRadius);
190441
190575
  return builder.claimPolyface();
190442
190576
  }
190443
- else if (centerline instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_15__.CurveChain) {
190577
+ else if (centerline instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_14__.CurveChain) {
190444
190578
  const result = [];
190445
190579
  for (const p of centerline.children) {
190446
190580
  const pipe = this.createPipeSegments(p, pipeRadius);
@@ -190466,33 +190600,33 @@ class CurveFactory {
190466
190600
  const arcs = [];
190467
190601
  if (centerline.length < 2)
190468
190602
  return [];
190469
- const vector0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create();
190470
- const vector90 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create();
190471
- const vectorBC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create();
190472
- const currentCenter = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create();
190603
+ const vector0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
190604
+ const vector90 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
190605
+ const vectorBC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
190606
+ const currentCenter = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create();
190473
190607
  centerline.vectorIndexIndex(0, 1, vectorBC);
190474
190608
  centerline.getPoint3dAtUncheckedPointIndex(0, currentCenter);
190475
190609
  let initialSection;
190476
- if (sectionData instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_4__.Arc3d) {
190610
+ if (sectionData instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
190477
190611
  initialSection = sectionData.clone();
190478
190612
  initialSection.center.setFrom(currentCenter);
190479
190613
  vector0.setFrom(sectionData.vector0);
190480
190614
  vector90.setFrom(sectionData.vector90);
190481
190615
  }
190482
- else if (typeof sectionData === "number" || _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.isXAndY(sectionData)) {
190616
+ else if (typeof sectionData === "number" || _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.isXAndY(sectionData)) {
190483
190617
  const length0 = (typeof sectionData === "number") ? sectionData : sectionData.x;
190484
190618
  const length90 = (typeof sectionData === "number") ? sectionData : sectionData.y;
190485
- const baseFrame = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_3__.Matrix3d.createRigidHeadsUp(vectorBC, _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.ZXY);
190619
+ const baseFrame = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_15__.Matrix3d.createRigidHeadsUp(vectorBC, _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.ZXY);
190486
190620
  baseFrame.columnX(vector0).scaleInPlace(length0);
190487
190621
  baseFrame.columnY(vector90).scaleInPlace(length90);
190488
- initialSection = _Arc3d__WEBPACK_IMPORTED_MODULE_4__.Arc3d.create(currentCenter, vector0, vector90, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_5__.AngleSweep.create360());
190622
+ initialSection = _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.create(currentCenter, vector0, vector90, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_8__.AngleSweep.create360());
190489
190623
  }
190490
190624
  else {
190491
190625
  return [];
190492
190626
  }
190493
190627
  arcs.push(initialSection);
190494
- const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create();
190495
- const bisector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create();
190628
+ const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
190629
+ const bisector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
190496
190630
  for (let i = 1; i < centerline.length; i++) {
190497
190631
  vectorAB.setFromVector3d(vectorBC);
190498
190632
  centerline.getPoint3dAtUncheckedPointIndex(i, currentCenter);
@@ -190509,7 +190643,7 @@ class CurveFactory {
190509
190643
  // vector0 and vector90 are obtained by sweeping the corresponding vectors of the start ellipse to the split plane.
190510
190644
  moveVectorToPlane(vector0, vectorAB, bisector, vector0);
190511
190645
  moveVectorToPlane(vector90, vectorAB, bisector, vector90);
190512
- arcs.push(_Arc3d__WEBPACK_IMPORTED_MODULE_4__.Arc3d.create(currentCenter, vector0, vector90, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_5__.AngleSweep.create360()));
190646
+ arcs.push(_Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.create(currentCenter, vector0, vector90, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_8__.AngleSweep.create360()));
190513
190647
  }
190514
190648
  }
190515
190649
  return arcs;
@@ -190537,7 +190671,7 @@ class CurveFactory {
190537
190671
  // If successful, push the target plane and swept section to the output arrays and return the swept section.
190538
190672
  // If unsuccessful, leave the output arrays alone and return the input section.
190539
190673
  const doSweepToPlane = function (edgePlane0, edgePlane1, targetPlane, section) {
190540
- const sweepVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(edgePlane0.getOriginRef(), edgePlane1.getOriginRef());
190674
+ const sweepVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(edgePlane0.getOriginRef(), edgePlane1.getOriginRef());
190541
190675
  const transform = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createFlattenAlongVectorToPlane(sweepVector, targetPlane.getOriginRef(), targetPlane.getNormalRef());
190542
190676
  if (transform === undefined)
190543
190677
  return section;
@@ -190557,7 +190691,7 @@ class CurveFactory {
190557
190691
  if (ruledSweep) {
190558
190692
  sectionData.ruledSweep = ruledSweep;
190559
190693
  if (MiteredSweepOutputSelect.AlsoMesh === options.outputSelect) {
190560
- const builder = _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_14__.PolyfaceBuilder.create(options.strokeOptions);
190694
+ const builder = _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_13__.PolyfaceBuilder.create(options.strokeOptions);
190561
190695
  builder.addRuledSweep(ruledSweep);
190562
190696
  sectionData.mesh = builder.claimPolyface();
190563
190697
  }
@@ -190568,26 +190702,16 @@ class CurveFactory {
190568
190702
  return undefined;
190569
190703
  }
190570
190704
  /**
190571
- * Create a circular arc from start point, tangent at start, radius, optional plane normal, arc sweep
190705
+ * Create a circular arc from start point, tangent at start, radius, optional plane normal, arc sweep.
190572
190706
  * * The vector from start point to center is in the direction of upVector crossed with tangentA.
190573
- * @param pointA start point
190574
- * @param tangentA vector in tangent direction at the start
190707
+ * @param start start point.
190708
+ * @param tangentAtStart vector in tangent direction at the start.
190575
190709
  * @param radius signed radius.
190576
- * @param upVector optional out-of-plane vector. Defaults to positive Z
190577
- * @param sweep angular range. If single `Angle` is given, start angle is at 0 degrees (the start point).
190578
- *
190710
+ * @param upVector optional out-of-plane vector. Defaults to positive Z.
190711
+ * @param sweep angular range. If single `Angle` is given, start angle is at 0 degrees (the start point).
190579
190712
  */
190580
- static createArcPointTangentRadius(pointA, tangentA, radius, upVector, sweep) {
190581
- if (upVector === undefined)
190582
- upVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.unitZ();
190583
- const vector0 = upVector.unitCrossProduct(tangentA);
190584
- if (vector0 === undefined)
190585
- return undefined;
190586
- const center = pointA.plusScaled(vector0, radius);
190587
- // reverse the A-to-center vector and bring it up to scale ...
190588
- vector0.scaleInPlace(-radius);
190589
- const vector90 = tangentA.scaleToLength(Math.abs(radius)); // (Cannot fail -- prior unitCrossProduct would have failed first)
190590
- return _Arc3d__WEBPACK_IMPORTED_MODULE_4__.Arc3d.create(center, vector0, vector90, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_5__.AngleSweep.create(sweep));
190713
+ static createArcPointTangentRadius(start, tangentAtStart, radius, upVector, sweep) {
190714
+ return _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.createCircularStartTangentRadius(start, tangentAtStart, radius, upVector, sweep);
190591
190715
  }
190592
190716
  /**
190593
190717
  * Compute 2 spirals (all in XY) for a symmetric line-to-line transition.
@@ -190600,30 +190724,30 @@ class CurveFactory {
190600
190724
  * @return array with the computed spirals, or undefined if failure.
190601
190725
  */
190602
190726
  static createLineSpiralSpiralLine(spiralType, startPoint, shoulderPoint, targetPoint) {
190603
- const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(startPoint, shoulderPoint);
190604
- const vectorBC0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(shoulderPoint, targetPoint);
190727
+ const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(startPoint, shoulderPoint);
190728
+ const vectorBC0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(shoulderPoint, targetPoint);
190605
190729
  const referenceLength = vectorAB.magnitude();
190606
190730
  const radiansAB = Math.atan2(vectorAB.y, vectorAB.x);
190607
190731
  const lineTurnRadians = vectorAB.angleToXY(vectorBC0);
190608
190732
  const spiralTurnRadians = 0.5 * lineTurnRadians.radians;
190609
190733
  const radiansBC = radiansAB + lineTurnRadians.radians;
190610
- const axesA = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_3__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.createRadians(radiansAB));
190734
+ 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));
190611
190735
  const frameA = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createRefs(startPoint.clone(), axesA);
190612
190736
  // We know how much it has to turn, and but not the length or end radius.
190613
190737
  // make a spiral of referenceLength and scale it back to the junction line
190614
190738
  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);
190615
190739
  if (spiralARefLength) {
190616
190740
  const midPlanePerpendicularRadians = radiansAB + spiralTurnRadians;
190617
- const midPlanePerpendicularVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createPolar(1.0, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.createRadians(midPlanePerpendicularRadians));
190741
+ const midPlanePerpendicularVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createPolar(1.0, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.createRadians(midPlanePerpendicularRadians));
190618
190742
  const altitudeB = midPlanePerpendicularVector.dotProductStartEnd(startPoint, shoulderPoint);
190619
190743
  const altitudeSpiralEnd = midPlanePerpendicularVector.dotProductStartEnd(startPoint, spiralARefLength.endPoint());
190620
190744
  const scaleFactor = altitudeB / altitudeSpiralEnd;
190621
190745
  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);
190622
190746
  const distanceAB = vectorAB.magnitude();
190623
- const vectorBC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(shoulderPoint, targetPoint);
190747
+ const vectorBC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(shoulderPoint, targetPoint);
190624
190748
  vectorBC.scaleToLength(distanceAB, vectorBC);
190625
190749
  const pointC = shoulderPoint.plus(vectorBC);
190626
- const axesC = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_3__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.createRadians(radiansBC + Math.PI));
190750
+ 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));
190627
190751
  const frameC = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createRefs(pointC, axesC);
190628
190752
  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);
190629
190753
  return [spiralA, spiralC];
@@ -190641,8 +190765,8 @@ class CurveFactory {
190641
190765
  * @return array with the computed spirals, or undefined if failure.
190642
190766
  */
190643
190767
  static createLineSpiralSpiralLineWithSpiralLength(spiralType, pointA, pointB, pointC, spiralLength) {
190644
- const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(pointA, pointB);
190645
- const vectorBC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(pointB, pointC);
190768
+ const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(pointA, pointB);
190769
+ const vectorBC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(pointB, pointC);
190646
190770
  const radiansAB = Math.atan2(vectorAB.y, vectorAB.x);
190647
190771
  const lineTurnAngle = vectorAB.angleToXY(vectorBC);
190648
190772
  const spiralTurnRadians = 0.5 * lineTurnAngle.radians;
@@ -190659,11 +190783,11 @@ class CurveFactory {
190659
190783
  const xFractionAB = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(distanceAB - distanceBE - localEndPoint.x, distanceAB);
190660
190784
  const xFractionCB = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(distanceCB - distanceBE - localEndPoint.x, distanceCB);
190661
190785
  if (xFractionAB !== undefined && xFractionCB !== undefined) {
190662
- const axesA = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_3__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.createRadians(radiansAB));
190786
+ 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));
190663
190787
  const frameAOrigin = pointA.interpolate(xFractionAB, pointB);
190664
190788
  const frameA = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createRefs(frameAOrigin, axesA);
190665
190789
  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);
190666
- const axesB = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_3__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_19__.Angle.createRadians(radiansCB));
190790
+ 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));
190667
190791
  const frameBOrigin = pointC.interpolate(xFractionCB, pointB);
190668
190792
  const frameB = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createRefs(frameBOrigin, axesB);
190669
190793
  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);
@@ -190683,9 +190807,9 @@ class CurveFactory {
190683
190807
  * @return array with the computed spirals, or undefined if failure.
190684
190808
  */
190685
190809
  static createLineSpiralArcSpiralLine(spiralType, pointA, pointB, pointC, lengthA, lengthB, arcRadius) {
190686
- const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(pointA, pointB);
190810
+ const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(pointA, pointB);
190687
190811
  vectorAB.z = 0;
190688
- const vectorCB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(pointC, pointB);
190812
+ const vectorCB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(pointC, pointB);
190689
190813
  vectorCB.z = 0;
190690
190814
  const unitAB = vectorAB.normalize();
190691
190815
  const unitCB = vectorCB.normalize();
@@ -190708,14 +190832,14 @@ class CurveFactory {
190708
190832
  const sB = spiralEndB.origin.x - radiusB * spiralEndB.direction.y;
190709
190833
  const tB = spiralEndB.origin.y + radiusB * spiralEndB.direction.x;
190710
190834
  // Those local coordinates are rotated to unitAB and unitBC ...
190711
- const vectorA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createAdd2Scaled(unitAB, sA, unitPerpAB, tA);
190712
- const vectorB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createAdd2Scaled(unitCB, sB, unitPerpCB, tB);
190835
+ const vectorA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createAdd2Scaled(unitAB, sA, unitPerpAB, tA);
190836
+ const vectorB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createAdd2Scaled(unitCB, sB, unitPerpCB, tB);
190713
190837
  const uv = _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_22__.Vector2d.create();
190714
190838
  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)) {
190715
190839
  const tangencyAB = pointB.plusScaled(unitAB, uv.x);
190716
190840
  const tangencyCB = pointB.plusScaled(unitCB, uv.y);
190717
- const frameA = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createOriginAndMatrixColumns(tangencyAB, unitAB, unitPerpAB, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.unitZ());
190718
- const frameB = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createOriginAndMatrixColumns(tangencyCB, unitCB, unitPerpCB, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.unitZ());
190841
+ const frameA = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createOriginAndMatrixColumns(tangencyAB, unitAB, unitPerpAB, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.unitZ());
190842
+ const frameB = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createOriginAndMatrixColumns(tangencyCB, unitCB, unitPerpCB, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.unitZ());
190719
190843
  spiralA.tryTransformInPlace(frameA);
190720
190844
  spiralB.tryTransformInPlace(frameB);
190721
190845
  const rayA1 = spiralA.fractionToPointAndUnitTangent(1.0);
@@ -199933,7 +200057,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
199933
200057
  */
199934
200058
  getPointCurveClosestApproachXYNewton(curveP, pointQ) {
199935
200059
  if (!(curveP instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_4__.Arc3d) && !(curveP instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d)) {
199936
- (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"getPointCurveClosestApproachXYNewton only supports Arc3d and LineSegment");
200060
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "getPointCurveClosestApproachXYNewton only supports Arc3d and LineSegment");
199937
200061
  return undefined;
199938
200062
  }
199939
200063
  const seeds = [0.2, 0.4, 0.6, 0.8]; // HEURISTIC: arcs have up to 4 perpendiculars; lines have only 1
@@ -200208,7 +200332,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
200208
200332
  if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_11__.CurveChainWithDistanceIndex))
200209
200333
  return;
200210
200334
  if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_11__.CurveChainWithDistanceIndex) {
200211
- (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"call handleCurveChainWithDistanceIndex(geomA) instead");
200335
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "call handleCurveChainWithDistanceIndex(geomA) instead");
200212
200336
  return;
200213
200337
  }
200214
200338
  const index0 = this._results.length;
@@ -201185,7 +201309,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
201185
201309
  if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_14__.CurveChainWithDistanceIndex))
201186
201310
  return;
201187
201311
  if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_14__.CurveChainWithDistanceIndex) {
201188
- (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"call handleCurveChainWithDistanceIndex(geomA) instead");
201312
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "call handleCurveChainWithDistanceIndex(geomA) instead");
201189
201313
  return;
201190
201314
  }
201191
201315
  const index0 = this._results.length;
@@ -202030,7 +202154,7 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
202030
202154
  if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex))
202031
202155
  return;
202032
202156
  if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex) {
202033
- (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"call handleCurveChainWithDistanceIndex(geomA) instead");
202157
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "call handleCurveChainWithDistanceIndex(geomA) instead");
202034
202158
  return;
202035
202159
  }
202036
202160
  const index0 = this._results.length;
@@ -202723,7 +202847,7 @@ class AdaptiveSubdivisionQ1IntervalErrorProcessor extends QuadrantFractionsProce
202723
202847
  /** Remember the initial value of the fraction f to be perturbed. */
202724
202848
  announceQuadrantBegin(q, reversed) {
202725
202849
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(q.quadrant === 1);
202726
- (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!reversed); // ASSUME bracket and q.fractions have same ordering
202850
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!reversed); // ASSUME [bracket0, bracket1] and q.fractions have the same ordering
202727
202851
  // the first fraction might be an extra point for computing the first 3-pt arc.
202728
202852
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(q.fractions.length === 4 || (q.fractions.length === 3 && q.interpolateStartTangent));
202729
202853
  this._error0 = this._error1 = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.largeCoordinateResult;
@@ -202829,7 +202953,7 @@ class AdaptiveSubdivisionQ1ErrorProcessor extends QuadrantFractionsProcessor {
202829
202953
  const interpolateStartTangent = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isAlmostEqualEitherNumber(f0, this._fractionRangeQ1.low, this._fractionRangeQ1.high, 0);
202830
202954
  const interpolateEndTangent = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isAlmostEqualEitherNumber(f1, this._fractionRangeQ1.low, this._fractionRangeQ1.high, 0);
202831
202955
  if (!interpolateStartTangent && undefined === fPrev)
202832
- fPrev = this.getPreviousFraction(f0); // createLastArc caller doesn't supply fPrev
202956
+ fPrev = this.getPreviousFraction(f0); // createLastArc doesn't supply fPrev to announceArc
202833
202957
  const fractions = (undefined === fPrev) ? [f0, f, f1] : [fPrev, f0, f, f1];
202834
202958
  const q1 = [QuadrantFractions.create(1, fractions, interpolateStartTangent, interpolateEndTangent)];
202835
202959
  const processor = AdaptiveSubdivisionQ1IntervalErrorProcessor.create(this.fullEllipseXY, f0, f, f1);
@@ -203147,12 +203271,13 @@ class EllipticalArcApproximationContext {
203147
203271
  arc.sweep.setStartEndRadians(startAngle.radians, arc.sweep.endRadians);
203148
203272
  return arc; // returned arc starts at arcStart, ends at arcEnd
203149
203273
  };
203150
- const createFirstArc = (f0, f1, reverse) => {
203274
+ const createFirstArc = (f0, f1) => {
203151
203275
  // This arc starts at the first sample f0 and ends at f1.
203276
+ // This arc interpolates point and tangent at f0, but only point at f1.
203152
203277
  ellipticalArc.fractionToPointAndDerivative(f0, ray);
203153
203278
  ellipticalArc.fractionToPoint(f1, pt1);
203154
- if (reverse)
203155
- ray.direction.scaleInPlace(-1);
203279
+ if (f0 > f1)
203280
+ ray.direction.scaleInPlace(-1); // computed arc is retrograde
203156
203281
  const arc = arcBetween2Samples(ray, pt1, false);
203157
203282
  if (arc)
203158
203283
  processor.announceArc(arc, undefined, f0, f1);
@@ -203168,12 +203293,14 @@ class EllipticalArcApproximationContext {
203168
203293
  if (arc)
203169
203294
  processor.announceArc(arc, fPrev, f1, f2);
203170
203295
  };
203171
- const createLastArc = (f0, f1, reverse) => {
203172
- // This arc starts at f0 and ends at the last sample f1. It is the only arc to use f1.
203296
+ const createLastArc = (f0, f1) => {
203297
+ // This arc starts at f0 and ends at the last sample f1.
203298
+ // This arc interpolates point and tangent at f1, but only point at f0.
203173
203299
  ellipticalArc.fractionToPoint(f0, pt0);
203174
203300
  ellipticalArc.fractionToPointAndDerivative(f1, ray);
203175
- if (!reverse)
203176
- ray.direction.scaleInPlace(-1);
203301
+ if (f1 > f0)
203302
+ ray.direction.scaleInPlace(-1); // computed arc is retrograde
203303
+ // compute last arc from f1 to f0, then reverse
203177
203304
  const arc = arcBetween2Samples(ray, pt0, true);
203178
203305
  if (arc)
203179
203306
  processor.announceArc(arc, undefined, f0, f1);
@@ -203203,13 +203330,13 @@ class EllipticalArcApproximationContext {
203203
203330
  if (!processor.announceQuadrantBegin(q, reversed))
203204
203331
  continue;
203205
203332
  if (q.interpolateStartTangent)
203206
- createFirstArc(q.fractions[0], q.fractions[1], reversed);
203333
+ createFirstArc(q.fractions[0], q.fractions[1]);
203207
203334
  // the first inner arc approximates the ellipse over [f[1],f[2]]; the last inner arc, over [f[n-3],f[n-2]]
203208
203335
  for (let i = 0; i + 2 < n - 1; ++i)
203209
203336
  createInnerArc(q.fractions[i], q.fractions[i + 1], q.fractions[i + 2]);
203210
203337
  if (n > 2) { // the final arc approximates [f[n-2],f[n-1]]
203211
203338
  if (q.interpolateEndTangent)
203212
- createLastArc(q.fractions[n - 2], q.fractions[n - 1], reversed);
203339
+ createLastArc(q.fractions[n - 2], q.fractions[n - 1]);
203213
203340
  else
203214
203341
  createInnerArc(q.fractions[n - 3], q.fractions[n - 2], q.fractions[n - 1]);
203215
203342
  }
@@ -208391,28 +208518,31 @@ class AngleSweep {
208391
208518
  }
208392
208519
  /**
208393
208520
  * Convert an AngleSweep to a JSON object.
208394
- * @return {*} {degrees: [startAngleInDegrees, endAngleInDegrees}
208521
+ * @return {*} [startAngleInDegrees, endAngleInDegrees]
208395
208522
  */
208396
208523
  toJSON() {
208397
208524
  return [this.startDegrees, this.endDegrees];
208398
208525
  }
208399
208526
  /**
208400
- * Test if this angle sweep and other angle sweep match with radians tolerance.
208401
- * * Period shifts are allowed.
208527
+ * Test if two angle sweeps match within the given tolerance.
208528
+ * * Period shifts are allowed, but orientations must be the same.
208529
+ * @param other sweep to compare to this instance
208530
+ * @param radianTol optional radian tolerance, default value `Geometry.smallAngleRadians`
208402
208531
  */
208403
- isAlmostEqualAllowPeriodShift(other) {
208404
- // We compare angle sweeps by checking if start angle and sweep match. We cannot compare start and end because for
208405
- // example (0, 90) and (360, 90) have the same start (we allow period shift) and end but are not same angle sweeps.
208406
- return _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansAllowPeriodShift(this._radians0, other._radians0)
208407
- && _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansAllowPeriodShift(this._radians1 - this._radians0, other._radians1 - other._radians0);
208532
+ isAlmostEqualAllowPeriodShift(other, radianTol = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallAngleRadians) {
208533
+ return this.isCCW === other.isCCW // this rules out equating opposite sweeps like [0,-100] and [0,260]
208534
+ && _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansAllowPeriodShift(this._radians0, other._radians0, radianTol)
208535
+ && _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansAllowPeriodShift(this._radians1 - this._radians0, other._radians1 - other._radians0, radianTol);
208408
208536
  }
208409
208537
  /**
208410
- * Test if this angle sweep and other angle sweep match with radians tolerance.
208538
+ * Test if two angle sweeps match within the given tolerance.
208411
208539
  * * Period shifts are not allowed.
208540
+ * @param other sweep to compare to this instance
208541
+ * @param radianTol optional radian tolerance, default value `Geometry.smallAngleRadians`
208412
208542
  */
208413
- isAlmostEqualNoPeriodShift(other) {
208414
- return _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansNoPeriodShift(this._radians0, other._radians0)
208415
- && _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansNoPeriodShift(this._radians1 - this._radians0, other._radians1 - other._radians0);
208543
+ isAlmostEqualNoPeriodShift(other, radianTol = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallAngleRadians) {
208544
+ return _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansNoPeriodShift(this._radians0, other._radians0, radianTol)
208545
+ && _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansNoPeriodShift(this._radians1 - this._radians0, other._radians1 - other._radians0, radianTol);
208416
208546
  }
208417
208547
  /**
208418
208548
  * Test if start and end angles match with radians tolerance.
@@ -223297,7 +223427,7 @@ class PolygonOps {
223297
223427
  const areaOfNormalParallelogram = Math.abs(outwardUnitNormalOfPrevEdge.crossProductXY(outwardUnitNormalOfEdge));
223298
223428
  const coord = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.conditionalDivideCoordinate(areaOfNormalParallelogram, projToPrevEdge.x * projToEdge.x, largestResult);
223299
223429
  if (undefined === coord) {
223300
- (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"unexpectedly small projection distance to an edge");
223430
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "unexpectedly small projection distance to an edge");
223301
223431
  return undefined; // shouldn't happen due to chopping in computeEdgeDataXY: area/(dist*dist) <= 1/tol^2 = largestResult
223302
223432
  }
223303
223433
  coords[i] = coord;
@@ -223308,7 +223438,7 @@ class PolygonOps {
223308
223438
  }
223309
223439
  const scale = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.conditionalDivideCoordinate(1.0, coordSum);
223310
223440
  if (undefined === scale) {
223311
- (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"unexpected zero barycentric coordinate sum");
223441
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "unexpected zero barycentric coordinate sum");
223312
223442
  return undefined;
223313
223443
  }
223314
223444
  for (let i = 0; i < n; ++i)
@@ -228710,11 +228840,11 @@ class Map4d {
228710
228840
  return this._matrix0.isAlmostEqual(other._matrix0) && this._matrix1.isAlmostEqual(other._matrix1);
228711
228841
  }
228712
228842
  /**
228713
- * Create a map between a frustum and world coordinates.
228714
- * @param origin lower left of frustum
228715
- * @param uVector Vector from lower left rear to lower right rear.
228716
- * @param vVector Vector from lower left rear to upper left rear.
228717
- * @param wVector Vector from lower left rear to lower left front, i.e. lower left rear towards eye.
228843
+ * Create a world to NPC map that maps between world coordinates and the given frustum.
228844
+ * @param origin lower left rear of frustum
228845
+ * @param uVector Vector from origin to lower right rear.
228846
+ * @param vVector Vector from origin to upper left rear.
228847
+ * @param wVector Vector from origin to lower left front, i.e. origin towards eye.
228718
228848
  * @param fraction front size divided by rear size.
228719
228849
  */
228720
228850
  static createVectorFrustum(origin, uVector, vVector, wVector, fraction) {
@@ -228814,7 +228944,7 @@ __webpack_require__.r(__webpack_exports__);
228814
228944
  * * indices 8,9,10,11 are the "z row" They may be called the zx,zy,zz,zw entries
228815
228945
  * * indices 12,13,14,15 are the "w row". They may be called the wx,wy,wz,ww entries
228816
228946
  * * If "w row" contains numeric values 0,0,0,1, the Matrix4d is equivalent to a Transform with
228817
- * * The upper right 3x3 matrix (entries 0,1,2,4,5,6,8,9,10) are the 3x3 matrix part of the transform
228947
+ * * The upper left 3x3 matrix (entries 0,1,2,4,5,6,8,9,10) are the 3x3 matrix part of the transform
228818
228948
  * * The far right column entries xw,yw,zw are the "origin" (sometimes called "translation") part of the transform.
228819
228949
  * @public
228820
228950
  */
@@ -228967,7 +229097,7 @@ class Matrix4d {
228967
229097
  return Matrix4d.createRowValues(scaleX, 0, 0, tx, 0, scaleY, 0, ty, 0, 0, scaleZ, tz, 0, 0, 0, 1, result);
228968
229098
  }
228969
229099
  /**
228970
- * Create a mapping the scales and translates (no rotation) from box A to boxB
229100
+ * Create a mapping that scales and translates (no rotation) from box A to box B
228971
229101
  * @param lowA low point of box A
228972
229102
  * @param highA high point of box A
228973
229103
  * @param lowB low point of box B
@@ -229278,7 +229408,7 @@ class Matrix4d {
229278
229408
  }
229279
229409
  /** multiply each matrix * points[i]. This produces a weighted xyzw.
229280
229410
  * Immediately renormalize back to xyz and replace the original point.
229281
- * If zero weight appears in the result (i.e. input is on eyeplane)leave the mapped xyz untouched.
229411
+ * If zero weight appears in the result (i.e. input is on eyeplane) leave the mapped xyz untouched.
229282
229412
  */
229283
229413
  multiplyPoint3dArrayQuietNormalize(points) {
229284
229414
  points.forEach((point) => this.multiplyXYZWQuietRenormalize(point.x, point.y, point.z, 1.0, point));
@@ -229462,7 +229592,7 @@ class Matrix4d {
229462
229592
  this._coffs[15] += a * vectorV.w;
229463
229593
  }
229464
229594
  /**
229465
- * ADD (n place) scale*A*B*AT where
229595
+ * Add (in place) scale*A*B*AT where
229466
229596
  * * A is a pure translation with final column [x,y,z,1]
229467
229597
  * * B is the given `matrixB`
229468
229598
  * * AT is the transpose of A.
@@ -229507,12 +229637,9 @@ class Matrix4d {
229507
229637
  * * A is a pure translation with final column [x,y,z,1]
229508
229638
  * * this is this matrix.
229509
229639
  * * AT is the transpose of A.
229510
- * * scale is a multiplier.
229511
- * @param matrixB the middle matrix.
229512
229640
  * @param ax x part of translation
229513
229641
  * @param ay y part of translation
229514
229642
  * @param az z part of translation
229515
- * @param scale scale factor for entire product
229516
229643
  */
229517
229644
  multiplyTranslationSandwichInPlace(ax, ay, az) {
229518
229645
  const bx = this._coffs[3];
@@ -234385,7 +234512,7 @@ class AnalyticRoots {
234385
234512
  // EDL April 5, 2020 replace classic GraphicsGems solver by RWDNickalls.
234386
234513
  // Don't know if improveRoots is needed.
234387
234514
  // Breaks in AnalyticRoots.test.ts checkQuartic suggest it indeed converts many e-16 errors to zero.
234388
- // e-13 cases are unaffected
234515
+ // e-13 cases are unaffected
234389
234516
  this.improveRoots(c, 3, results, false);
234390
234517
  }
234391
234518
  else {
@@ -234396,6 +234523,7 @@ class AnalyticRoots {
234396
234523
  }
234397
234524
  /** Compute roots of quartic `c[0] + c[1] * x + c[2] * x^2 + c[3] * x^3 + c[4] * x^4` */
234398
234525
  static appendQuarticRoots(c, results) {
234526
+ // for details, see core\geometry\internaldocs\quarticRoots.md
234399
234527
  const coffs = new Float64Array(4);
234400
234528
  let u;
234401
234529
  let v;
@@ -234426,7 +234554,7 @@ class AnalyticRoots {
234426
234554
  this.addConstant(origin, results); // apply origin
234427
234555
  return;
234428
234556
  }
234429
- else { // solve the resolvent cubic; more info: https://en.wikipedia.org/wiki/Resolvent_cubic#Second_definition
234557
+ else { // solve the resolvent cubic
234430
234558
  coffs[0] = 0.5 * r * p - 0.125 * q * q;
234431
234559
  coffs[1] = -r;
234432
234560
  coffs[2] = -0.5 * p;
@@ -234463,7 +234591,6 @@ class AnalyticRoots {
234463
234591
  coffs[2] = 1;
234464
234592
  this.appendQuadraticRoots(coffs, results);
234465
234593
  }
234466
- // substitute
234467
234594
  this.addConstant(origin, results); // apply origin
234468
234595
  results.sort();
234469
234596
  this.improveRoots(c, 4, results, true);
@@ -234596,7 +234723,7 @@ class TrigPolynomial {
234596
234723
  /**
234597
234724
  * Solve a polynomial created from trigonometric condition using Trig.S, Trig.C, Trig.W.
234598
234725
  * * Polynomial is of degree 4:
234599
- * `coff[0] + coff[1] * t + coff[2] * t^2 + coff[3] * t^3 + coff[4] * t^4`
234726
+ * `p(t) = coff[0] + coff[1] * t + coff[2] * t^2 + coff[3] * t^3 + coff[4] * t^4`
234600
234727
  * * Solution logic includes inferring angular roots corresponding zero leading coefficients
234601
234728
  * (roots at infinity).
234602
234729
  * @param coff coefficients.
@@ -234624,16 +234751,14 @@ class TrigPolynomial {
234624
234751
  degree--;
234625
234752
  const roots = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_5__.GrowableFloat64Array();
234626
234753
  if (degree === -1) {
234627
- // Umm. Dunno. Nothing there.
234754
+ // do nothing
234628
234755
  }
234629
234756
  else {
234630
234757
  if (degree === 0) {
234631
- // p(t) is a nonzero constant
234632
- // No roots, but not degenerate.
234758
+ // p(t) is a nonzero constant; no roots but not degenerate.
234633
234759
  }
234634
234760
  else if (degree === 1) {
234635
- // p(t) = coff[1] * t + coff[0]
234636
- roots.push(-coff[0] / coff[1]);
234761
+ roots.push(-coff[0] / coff[1]); // p(t) = coff[0] + coff[1] * t
234637
234762
  }
234638
234763
  else if (degree === 2) {
234639
234764
  AnalyticRoots.appendQuadraticRoots(coff, roots);
@@ -234648,17 +234773,15 @@ class TrigPolynomial {
234648
234773
  // TODO: WORK WITH BEZIER SOLVER
234649
234774
  }
234650
234775
  if (roots.length > 0) {
234651
- // Each solution t represents an angle with
234652
- // Math.Cos(theta) = C(t)/W(t) and sin(theta) = S(t)/W(t)
234776
+ // Each solution t represents an angle with Math.Cos(theta) = C(t)/W(t) and sin(theta) = S(t)/W(t)
234653
234777
  // Division by W has no effect on atan2 calculations, so we just compute S(t),C(t)
234654
234778
  for (let i = 0; i < roots.length; i++) {
234655
234779
  const ss = PowerPolynomial.evaluate(this.S, roots.atUncheckedIndex(i));
234656
234780
  const cc = PowerPolynomial.evaluate(this.C, roots.atUncheckedIndex(i));
234657
234781
  radians.push(Math.atan2(ss, cc));
234658
234782
  }
234659
- // Each leading zero at the front of the coefficients corresponds to a root at -PI/2.
234660
- // Only make one entry....
234661
- // for (int i = degree; i < nominalDegree; i++)
234783
+ // each leading zero at the front of the coefficient array corresponds to a root at -PI/2.
234784
+ // only make one entry because we don't report multiplicity.
234662
234785
  if (degree < nominalDegree)
234663
234786
  radians.push(-0.5 * Math.PI);
234664
234787
  }
@@ -234681,8 +234804,7 @@ class TrigPolynomial {
234681
234804
  const coffs = new Float64Array(5);
234682
234805
  PowerPolynomial.zero(coffs);
234683
234806
  let degree;
234684
- // see itwinjs-core\core\geometry\internaldocs\unitCircleEllipseIntersection.md
234685
- // on how coffs (coefficient array) is built.
234807
+ // see core\geometry\internaldocs\unitCircleEllipseIntersection.md for derivation of these coefficients
234686
234808
  if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(axx, axy, ayy) > TrigPolynomial._coefficientRelTol * _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(ax, ay, a)) {
234687
234809
  PowerPolynomial.accumulate(coffs, this.CW, ax);
234688
234810
  PowerPolynomial.accumulate(coffs, this.SW, ay);
@@ -234726,6 +234848,7 @@ class TrigPolynomial {
234726
234848
  */
234727
234849
  static solveUnitCircleEllipseIntersection(cx, cy, ux, uy, vx, vy, ellipseRadians, circleRadians) {
234728
234850
  circleRadians.length = 0;
234851
+ // see core\geometry\internaldocs\unitCircleEllipseIntersection.md for derivation of these coefficients:
234729
234852
  const acc = ux * ux + uy * uy;
234730
234853
  const acs = 2.0 * (ux * vx + uy * vy);
234731
234854
  const ass = vx * vx + vy * vy;
@@ -234759,8 +234882,7 @@ class TrigPolynomial {
234759
234882
  */
234760
234883
  static solveUnitCircleHomogeneousEllipseIntersection(cx, cy, cw, ux, uy, uw, vx, vy, vw, ellipseRadians, circleRadians) {
234761
234884
  circleRadians.length = 0;
234762
- // see itwinjs-core\core\geometry\internaldocs\unitCircleEllipseIntersection.md
234763
- // on how below variables are derived.
234885
+ // see core\geometry\internaldocs\unitCircleEllipseIntersection.md for derivation of these coefficients:
234764
234886
  const acc = ux * ux + uy * uy - uw * uw;
234765
234887
  const acs = 2.0 * (ux * vx + uy * vy - uw * vw);
234766
234888
  const ass = vx * vx + vy * vy - vw * vw;
@@ -234780,8 +234902,7 @@ class TrigPolynomial {
234780
234902
  }
234781
234903
  // tolerance for small angle decision.
234782
234904
  TrigPolynomial._smallAngle = 1.0e-11;
234783
- // see itwinjs-core\core\geometry\internaldocs\unitCircleEllipseIntersection.md
234784
- // on how below variables are derived.
234905
+ // see core\geometry\internaldocs\unitCircleEllipseIntersection.md for derivation of these coefficients.
234785
234906
  /** Standard Basis coefficients for the numerator of the y-coordinate y(t) = S(t)/W(t) in the rational semicircle parameterization. */
234786
234907
  TrigPolynomial.S = Float64Array.from([0.0, 2.0, -2.0]);
234787
234908
  /** Standard Basis coefficients for the numerator of the x-coordinate x(t) = C(t)/W(t) in the rational semicircle parameterization. */
@@ -241270,7 +241391,7 @@ class PolyfaceClip {
241270
241391
  this.addRegion(builder, child);
241271
241392
  }
241272
241393
  else {
241273
- (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"unexpected region encountered");
241394
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "unexpected region encountered");
241274
241395
  }
241275
241396
  }
241276
241397
  }
@@ -287713,6 +287834,7 @@ class Parser {
287713
287834
  * @param inString A string that contains text represent a quantity.
287714
287835
  * @param format Defines the likely format of inString. Primary unit serves as a default unit if no unit label found in string.
287715
287836
  * @param unitsConversions dictionary of conversions used to convert from unit used in inString to output quantity
287837
+ * @deprecated in 4.10. Check [[Parser.parseQuantityString]] for replacements.
287716
287838
  */
287717
287839
  static parseToQuantityValue(inString, format, unitsConversions) {
287718
287840
  // TODO: This method is not able to do bearing and azimuth formatting and is overlapping with parseQuantityString.
@@ -303264,7 +303386,7 @@ var loadLanguages = instance.loadLanguages;
303264
303386
  /***/ ((module) => {
303265
303387
 
303266
303388
  "use strict";
303267
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.10.0-dev.18","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.18","@itwin/core-bentley":"workspace:^4.10.0-dev.18","@itwin/core-common":"workspace:^4.10.0-dev.18","@itwin/core-geometry":"workspace:^4.10.0-dev.18","@itwin/core-orbitgt":"workspace:^4.10.0-dev.18","@itwin/core-quantity":"workspace:^4.10.0-dev.18"},"//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"}}');
303389
+ 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"}}');
303268
303390
 
303269
303391
  /***/ })
303270
303392