@itwin/rpcinterface-full-stack-tests 4.1.0-dev.24 → 4.1.0-dev.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/dist/_a8a9.bundled-tests.js.map +1 -1
- package/lib/dist/bundled-tests.js +288 -203
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/object-storage-azure.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_itwin_object-storage-azure_1_6_0_node_modules_itwin_obj-0f69b1.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_3_3_3_node_modules_loaders_gl_draco_di-28f62e.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_reflect-metadata_0_1_13_node_modules_reflect-metadata_R-610cb3.bundled-tests.js.map +1 -1
- package/package.json +13 -13
|
@@ -152179,18 +152179,25 @@ class ImageryMapLayerTreeSupplier {
|
|
|
152179
152179
|
* This allows the ID to serve as a lookup key to find the corresponding TileTree.
|
|
152180
152180
|
*/
|
|
152181
152181
|
compareTileTreeIds(lhs, rhs) {
|
|
152182
|
-
let cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(lhs.settings.
|
|
152182
|
+
let cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(lhs.settings.formatId, rhs.settings.formatId);
|
|
152183
152183
|
if (0 === cmp) {
|
|
152184
|
-
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.
|
|
152184
|
+
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(lhs.settings.url, rhs.settings.url);
|
|
152185
152185
|
if (0 === cmp) {
|
|
152186
|
-
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStringsOrUndefined)(lhs.settings.
|
|
152186
|
+
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStringsOrUndefined)(lhs.settings.userName, rhs.settings.userName);
|
|
152187
152187
|
if (0 === cmp) {
|
|
152188
|
-
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.
|
|
152188
|
+
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStringsOrUndefined)(lhs.settings.password, rhs.settings.password);
|
|
152189
152189
|
if (0 === cmp) {
|
|
152190
|
-
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.
|
|
152190
|
+
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(lhs.settings.transparentBackground, rhs.settings.transparentBackground);
|
|
152191
152191
|
if (0 === cmp) {
|
|
152192
|
-
|
|
152193
|
-
|
|
152192
|
+
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.settings.subLayers.length, rhs.settings.subLayers.length);
|
|
152193
|
+
if (0 === cmp) {
|
|
152194
|
+
for (let i = 0; i < lhs.settings.subLayers.length && 0 === cmp; i++) {
|
|
152195
|
+
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(lhs.settings.subLayers[i].name, rhs.settings.subLayers[i].name);
|
|
152196
|
+
if (0 === cmp) {
|
|
152197
|
+
cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(lhs.settings.subLayers[i].visible, rhs.settings.subLayers[i].visible);
|
|
152198
|
+
}
|
|
152199
|
+
}
|
|
152200
|
+
}
|
|
152194
152201
|
}
|
|
152195
152202
|
}
|
|
152196
152203
|
}
|
|
@@ -182629,6 +182636,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePrimitive
|
|
|
182629
182636
|
/**
|
|
182630
182637
|
* Return a clone of this arc, projected to given z value.
|
|
182631
182638
|
* * If `z` is omitted, the clone is at the z of the center.
|
|
182639
|
+
* * This function projects the arc into a plane parallel to xy-plane.
|
|
182632
182640
|
* * Note that projection to fixed z can change circle into ellipse (and (rarely) ellipse to circle)
|
|
182633
182641
|
*/
|
|
182634
182642
|
cloneAtZ(z) {
|
|
@@ -184643,10 +184651,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
184643
184651
|
* A `CurveCollection` is an abstract (non-instantiable) class for various sets of curves with particular structures:
|
|
184644
184652
|
* - `CurveChain` is a (non-instantiable) intermediate class for a sequence of `CurvePrimitive` joining head-to-tail.
|
|
184645
184653
|
* The two instantiable forms of `CurveChain` are
|
|
184646
|
-
* - `Path` - A chain not required to close
|
|
184647
|
-
*
|
|
184648
|
-
*
|
|
184649
|
-
*
|
|
184654
|
+
* - `Path` - A chain not required to close and not enclosing a planar area (so curves do not have to be on the
|
|
184655
|
+
* same plane).
|
|
184656
|
+
* - `Loop` - A chain required to close from last to first so that a planar area is enclosed (so curves have to
|
|
184657
|
+
* be on the same plane).
|
|
184658
|
+
* - `ParityRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by parity rules.
|
|
184659
|
+
* - `UnionRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by union rules.
|
|
184650
184660
|
* - `BagOfCurves` -- a collection of `AnyCurve` with no implied structure.
|
|
184651
184661
|
*
|
|
184652
184662
|
* @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.
|
|
@@ -184686,7 +184696,7 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
|
|
|
184686
184696
|
* Return the max gap between adjacent primitives in Path and Loop collections.
|
|
184687
184697
|
* * In a Path, gaps are computed between consecutive primitives.
|
|
184688
184698
|
* * In a Loop, gaps are computed between consecutive primitives and between last and first.
|
|
184689
|
-
* *
|
|
184699
|
+
* * Gaps are NOT computed between consecutive CurvePrimitives in "unstructured" collections. The type is
|
|
184690
184700
|
* "unstructured" so gaps should not be semantically meaningful.
|
|
184691
184701
|
*/
|
|
184692
184702
|
maxGap() {
|
|
@@ -184708,11 +184718,15 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
|
|
|
184708
184718
|
cloneTransformed(transform) {
|
|
184709
184719
|
return _internalContexts_CloneCurvesContext__WEBPACK_IMPORTED_MODULE_7__.CloneCurvesContext.clone(this, transform);
|
|
184710
184720
|
}
|
|
184711
|
-
/** Create a deep copy with all linestrings
|
|
184721
|
+
/** Create a deep copy with all linestrings broken down into multiple LineSegment3d. */
|
|
184712
184722
|
cloneWithExpandedLineStrings() {
|
|
184713
184723
|
return _internalContexts_CloneWithExpandedLineStrings__WEBPACK_IMPORTED_MODULE_8__.CloneWithExpandedLineStrings.clone(this);
|
|
184714
184724
|
}
|
|
184715
|
-
/**
|
|
184725
|
+
/**
|
|
184726
|
+
* Push all CurvePrimitives contained in the instance onto the `results` array.
|
|
184727
|
+
* * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives
|
|
184728
|
+
* of the Loop are pushed onto `results`.
|
|
184729
|
+
*/
|
|
184716
184730
|
collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings = false) {
|
|
184717
184731
|
if (this.children) {
|
|
184718
184732
|
for (const child of this.children) {
|
|
@@ -184724,10 +184738,12 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
|
|
|
184724
184738
|
}
|
|
184725
184739
|
}
|
|
184726
184740
|
/**
|
|
184727
|
-
* Return an array containing
|
|
184741
|
+
* Return an array containing all CurvePrimitives in the instance.
|
|
184742
|
+
* * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives of
|
|
184743
|
+
* the Loop are pushed onto the returned array.
|
|
184728
184744
|
* @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without
|
|
184729
|
-
* clearing the array.
|
|
184730
|
-
* @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself.
|
|
184745
|
+
* clearing the array).
|
|
184746
|
+
* @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,
|
|
184731
184747
|
* it recurses to its (otherwise hidden) children.
|
|
184732
184748
|
*/
|
|
184733
184749
|
collectCurvePrimitives(collectorArray, smallestPossiblePrimitives = false, explodeLineStrings = false) {
|
|
@@ -184742,7 +184758,7 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
|
|
|
184742
184758
|
* * `UnionRegion`
|
|
184743
184759
|
*/
|
|
184744
184760
|
get isAnyRegionType() {
|
|
184745
|
-
return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() ===
|
|
184761
|
+
return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 4 || this.dgnBoundaryType() === 5;
|
|
184746
184762
|
}
|
|
184747
184763
|
/** Return true for a `Path`, i.e. a chain of curves joined head-to-tail */
|
|
184748
184764
|
get isOpenPath() {
|
|
@@ -184750,12 +184766,16 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
|
|
|
184750
184766
|
}
|
|
184751
184767
|
/**
|
|
184752
184768
|
* Return true for a single-loop planar region type, i.e. `Loop`.
|
|
184753
|
-
* * This is
|
|
184769
|
+
* * This is NOT a test for physical closure of a `Path`.
|
|
184754
184770
|
*/
|
|
184755
184771
|
get isClosedPath() {
|
|
184756
184772
|
return this.dgnBoundaryType() === 2;
|
|
184757
184773
|
}
|
|
184758
|
-
/**
|
|
184774
|
+
/**
|
|
184775
|
+
* Extend (increase) the given range as needed to encompass all curves in the curve collection.
|
|
184776
|
+
* @param rangeToExtend the given range.
|
|
184777
|
+
* @param transform if supplied, the range is extended with transformed curves.
|
|
184778
|
+
*/
|
|
184759
184779
|
extendRange(rangeToExtend, transform) {
|
|
184760
184780
|
const children = this.children;
|
|
184761
184781
|
if (children) {
|
|
@@ -184765,8 +184785,8 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
|
|
|
184765
184785
|
}
|
|
184766
184786
|
}
|
|
184767
184787
|
/**
|
|
184768
|
-
*
|
|
184769
|
-
* *
|
|
184788
|
+
* Find any CurvePrimitive in the source and evaluate it at the given fraction.
|
|
184789
|
+
* * The first CurvePrimitive found is evaluated. Any other CurvePrimitives are ignored.
|
|
184770
184790
|
* @param source containing `CurvePrimitive` or `CurveCollection`
|
|
184771
184791
|
* @param fraction fraction to use in `curve.fractionToPoint(fraction)`
|
|
184772
184792
|
*/
|
|
@@ -184798,19 +184818,20 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
|
|
|
184798
184818
|
}
|
|
184799
184819
|
/**
|
|
184800
184820
|
* Shared base class for use by both open and closed paths.
|
|
184801
|
-
*
|
|
184802
|
-
*
|
|
184803
|
-
* `
|
|
184804
|
-
*
|
|
184805
|
-
* to xyz, but in fact does all the
|
|
184806
|
-
* calculations over multiple primitives.
|
|
184807
|
-
* - The specific derived classes are `Path` and `Loop`
|
|
184808
|
-
* - `CurveChain` is an intermediate class. It is not instantiable on its own.
|
|
184821
|
+
* * A `CurveChain` contains only CurvePrimitives. No other paths, loops, or regions allowed.
|
|
184822
|
+
* * The specific derived classes are `Path` and `Loop`
|
|
184823
|
+
* * `CurveChain` is an intermediate class. It is not instantiable on its own.
|
|
184824
|
+
* * The related class `CurveChainWithDistanceIndex` is a `CurvePrimitive` whose API presents well-defined mappings
|
|
184825
|
+
* from fraction to xyz over the entire chain, but in fact does all the calculations over multiple primitives.
|
|
184809
184826
|
* @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.
|
|
184810
184827
|
* @public
|
|
184811
184828
|
*/
|
|
184812
184829
|
class CurveChain extends CurveCollection {
|
|
184813
|
-
|
|
184830
|
+
/** Constructor */
|
|
184831
|
+
constructor() {
|
|
184832
|
+
super();
|
|
184833
|
+
this._curves = [];
|
|
184834
|
+
}
|
|
184814
184835
|
/** Return the array of `CurvePrimitive` */
|
|
184815
184836
|
get children() {
|
|
184816
184837
|
if (this._curves === undefined)
|
|
@@ -184818,7 +184839,7 @@ class CurveChain extends CurveCollection {
|
|
|
184818
184839
|
return this._curves;
|
|
184819
184840
|
}
|
|
184820
184841
|
/**
|
|
184821
|
-
* Return the
|
|
184842
|
+
* Return the curve primitive at the given `index`, optionally using `modulo` to map `index` to the cyclic indexing.
|
|
184822
184843
|
* * In particular, `-1` is the final curve.
|
|
184823
184844
|
* @param index cyclic index
|
|
184824
184845
|
*/
|
|
@@ -184826,8 +184847,7 @@ class CurveChain extends CurveCollection {
|
|
|
184826
184847
|
const n = this.children.length;
|
|
184827
184848
|
if (n === 0)
|
|
184828
184849
|
return undefined;
|
|
184829
|
-
|
|
184830
|
-
if (index >= 0 && index < n)
|
|
184850
|
+
if (index >= 0 && index < n) // try simplest non-cyclic access first
|
|
184831
184851
|
return this.children[index];
|
|
184832
184852
|
if (cyclic) {
|
|
184833
184853
|
const index2 = _Geometry__WEBPACK_IMPORTED_MODULE_10__.Geometry.modulo(index, n);
|
|
@@ -184840,6 +184860,11 @@ class CurveChain extends CurveCollection {
|
|
|
184840
184860
|
* @param options tolerance parameters controlling the stroking.
|
|
184841
184861
|
*/
|
|
184842
184862
|
getPackedStrokes(options) {
|
|
184863
|
+
/**
|
|
184864
|
+
* The object returned by "cloneStroked" has the same type (Loop or Path) but instead of a chain of
|
|
184865
|
+
* CurvePrimitives as children, it has a single LineString3d child. "getPackedStrokes" just returns
|
|
184866
|
+
* the points of that LineString3d using "packedPoints".
|
|
184867
|
+
*/
|
|
184843
184868
|
const tree = this.cloneStroked(options);
|
|
184844
184869
|
if (tree instanceof CurveChain) {
|
|
184845
184870
|
const children = tree.children;
|
|
@@ -184851,16 +184876,6 @@ class CurveChain extends CurveCollection {
|
|
|
184851
184876
|
}
|
|
184852
184877
|
return undefined;
|
|
184853
184878
|
}
|
|
184854
|
-
/* EDL 01/20 Path, Loop, CurveChainWithDistanceIndex all implement this.
|
|
184855
|
-
Reducing it to abstract.
|
|
184856
|
-
Hypothetically, a derived class in the wild might be depending on this.
|
|
184857
|
-
{
|
|
184858
|
-
const strokes = LineString3d.create();
|
|
184859
|
-
for (const curve of this.children)
|
|
184860
|
-
curve.emitStrokes(strokes, options);
|
|
184861
|
-
return strokes;
|
|
184862
|
-
}
|
|
184863
|
-
*/
|
|
184864
184879
|
/**
|
|
184865
184880
|
* Add a child curve.
|
|
184866
184881
|
* * Returns false if the given child is not a CurvePrimitive.
|
|
@@ -184893,7 +184908,7 @@ class CurveChain extends CurveCollection {
|
|
|
184893
184908
|
this._curves.reverse();
|
|
184894
184909
|
}
|
|
184895
184910
|
/**
|
|
184896
|
-
* Return the index where target is found in the array of children
|
|
184911
|
+
* Return the index where target is found in the array of children.
|
|
184897
184912
|
* @param alsoSearchProxies whether to also check proxy curves of the children
|
|
184898
184913
|
*/
|
|
184899
184914
|
childIndex(target, alsoSearchProxies) {
|
|
@@ -184912,7 +184927,7 @@ class CurveChain extends CurveCollection {
|
|
|
184912
184927
|
}
|
|
184913
184928
|
return undefined;
|
|
184914
184929
|
}
|
|
184915
|
-
/** Evaluate an indexed curve at a fraction.
|
|
184930
|
+
/** Evaluate an indexed curve at a fraction. Return as a CurveLocationDetail that indicates the primitive. */
|
|
184916
184931
|
primitiveIndexAndFractionToCurveLocationDetailPointAndDerivative(index, fraction, cyclic = false, result) {
|
|
184917
184932
|
const primitive = this.cyclicCurvePrimitive(index, cyclic);
|
|
184918
184933
|
if (primitive) {
|
|
@@ -188144,7 +188159,7 @@ var CurveIntervalRole;
|
|
|
188144
188159
|
(function (CurveIntervalRole) {
|
|
188145
188160
|
/** This point is an isolated point NOT at a primary vertex. */
|
|
188146
188161
|
CurveIntervalRole[CurveIntervalRole["isolated"] = 0] = "isolated";
|
|
188147
|
-
/**
|
|
188162
|
+
/** This point is an isolated vertex hit */
|
|
188148
188163
|
CurveIntervalRole[CurveIntervalRole["isolatedAtVertex"] = 1] = "isolatedAtVertex";
|
|
188149
188164
|
/** This is the beginning of an interval */
|
|
188150
188165
|
CurveIntervalRole[CurveIntervalRole["intervalStart"] = 10] = "intervalStart";
|
|
@@ -188159,11 +188174,11 @@ var CurveIntervalRole;
|
|
|
188159
188174
|
*/
|
|
188160
188175
|
var CurveSearchStatus;
|
|
188161
188176
|
(function (CurveSearchStatus) {
|
|
188162
|
-
/**
|
|
188177
|
+
/** Unimplemented or zero length curve */
|
|
188163
188178
|
CurveSearchStatus[CurveSearchStatus["error"] = 0] = "error";
|
|
188164
|
-
/**
|
|
188179
|
+
/** Complete success of search */
|
|
188165
188180
|
CurveSearchStatus[CurveSearchStatus["success"] = 1] = "success";
|
|
188166
|
-
/**
|
|
188181
|
+
/** Search ended prematurely (e.g. at incomplete distance moved) at start or end of curve */
|
|
188167
188182
|
CurveSearchStatus[CurveSearchStatus["stoppedAtBoundary"] = 2] = "stoppedAtBoundary";
|
|
188168
188183
|
})(CurveSearchStatus || (CurveSearchStatus = {}));
|
|
188169
188184
|
/**
|
|
@@ -188186,7 +188201,7 @@ function optionalVectorUpdate(source, result) {
|
|
|
188186
188201
|
* @public
|
|
188187
188202
|
*/
|
|
188188
188203
|
class CurveLocationDetail {
|
|
188189
|
-
/**
|
|
188204
|
+
/** Constructor */
|
|
188190
188205
|
constructor() {
|
|
188191
188206
|
this.pointQ = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
|
|
188192
188207
|
this.fraction = 0;
|
|
@@ -188284,8 +188299,10 @@ class CurveLocationDetail {
|
|
|
188284
188299
|
return this.setFP(fraction, ray.origin, ray.direction, a);
|
|
188285
188300
|
}
|
|
188286
188301
|
/** Set the CurvePrimitive pointer, leaving all other properties untouched. */
|
|
188287
|
-
setCurve(curve) {
|
|
188288
|
-
|
|
188302
|
+
setCurve(curve) {
|
|
188303
|
+
this.curve = curve;
|
|
188304
|
+
}
|
|
188305
|
+
/** Record the distance from the CurveLocationDetail's point to the parameter point. */
|
|
188289
188306
|
setDistanceTo(point) {
|
|
188290
188307
|
this.a = this.point.distance(point);
|
|
188291
188308
|
}
|
|
@@ -188688,7 +188705,7 @@ class CurvePrimitive extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_1__.Geometr
|
|
|
188688
188705
|
}
|
|
188689
188706
|
/**
|
|
188690
188707
|
* Returns a (high accuracy) range of the curve between fractional positions
|
|
188691
|
-
* * Default implementation returns the range of the curve from clonePartialCurve
|
|
188708
|
+
* * Default implementation returns the range of the curve from clonePartialCurve.
|
|
188692
188709
|
*/
|
|
188693
188710
|
rangeBetweenFractions(fraction0, fraction1, transform) {
|
|
188694
188711
|
return this.rangeBetweenFractionsByClone(fraction0, fraction1, transform);
|
|
@@ -188717,6 +188734,7 @@ class CurvePrimitive extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_1__.Geometr
|
|
|
188717
188734
|
* @param fraction0 start fraction for evaluation
|
|
188718
188735
|
* @param fraction1 end fraction for evaluation
|
|
188719
188736
|
* @param count number of points to evaluate
|
|
188737
|
+
* @param transform optional transform to be applied to the curve
|
|
188720
188738
|
* @param extrapolationFactor if positive, evaluate again at interval midpoints and apply this fraction multiplier
|
|
188721
188739
|
* to any increase in size.
|
|
188722
188740
|
*/
|
|
@@ -188804,8 +188822,8 @@ class CurvePrimitive extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_1__.Geometr
|
|
|
188804
188822
|
* * `curveStartState` = `CurveSearchStatus.error`
|
|
188805
188823
|
* @param startFraction fractional position where the move starts
|
|
188806
188824
|
* @param signedDistance distance to move. Negative distance is backwards in the fraction space
|
|
188807
|
-
* @param allowExtension if true,
|
|
188808
|
-
* allow movement beyond the startPoint or endpoint
|
|
188825
|
+
* @param allowExtension if true, allow the move to go beyond the startPoint or endpoint of the curve. If false,
|
|
188826
|
+
* do not allow movement beyond the startPoint or endpoint
|
|
188809
188827
|
* @param result optional result.
|
|
188810
188828
|
* @returns A CurveLocationDetail annotated as above. Note that if the curve does not support the calculation, there is
|
|
188811
188829
|
* still a result which contains the point at the input startFraction, with failure indicated in the `curveStartState`
|
|
@@ -189514,8 +189532,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
189514
189532
|
* * A 3d line segment represented by its start and end coordinates
|
|
189515
189533
|
* * startPoint
|
|
189516
189534
|
* * endPoint
|
|
189517
|
-
* * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e.
|
|
189518
|
-
* equivalent forms
|
|
189535
|
+
* * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. each of these
|
|
189536
|
+
* equivalent forms maps fraction `f` to a point `X(f)`:
|
|
189519
189537
|
* ```
|
|
189520
189538
|
* equation
|
|
189521
189539
|
* X(f) = P_0 + f*(P_1 - P_0)\newline
|
|
@@ -189530,14 +189548,14 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
|
|
|
189530
189548
|
}
|
|
189531
189549
|
/**
|
|
189532
189550
|
* Return REFERENCE to the start point of this segment.
|
|
189533
|
-
* *
|
|
189551
|
+
* * This is distinct from the `CurvePrimitive` abstract method `startPoint()` which creates a returned point.
|
|
189534
189552
|
*/
|
|
189535
189553
|
get point0Ref() {
|
|
189536
189554
|
return this._point0;
|
|
189537
189555
|
}
|
|
189538
189556
|
/**
|
|
189539
189557
|
* Return REFERENCE to the end point of this segment.
|
|
189540
|
-
* *
|
|
189558
|
+
* * This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point.
|
|
189541
189559
|
*/
|
|
189542
189560
|
get point1Ref() {
|
|
189543
189561
|
return this._point1;
|
|
@@ -190937,7 +190955,7 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
|
|
|
190937
190955
|
return ls;
|
|
190938
190956
|
}
|
|
190939
190957
|
/**
|
|
190940
|
-
* Evaluate a curve at uniform fractions.
|
|
190958
|
+
* Evaluate a curve at uniform fractions. Append the evaluations to this linestring.
|
|
190941
190959
|
* @param curve primitive to evaluate.
|
|
190942
190960
|
* @param numStrokes number of strokes (edges).
|
|
190943
190961
|
* @param fraction0 starting fraction coordinate
|
|
@@ -193734,8 +193752,8 @@ var RegionBinaryOpType;
|
|
|
193734
193752
|
* * `ParityRegion` -- a collection of loops, interpreted by parity rules.
|
|
193735
193753
|
* The common "One outer loop and many Inner loops" is a parity region.
|
|
193736
193754
|
* * `UnionRegion` -- a collection of `Loop` and `ParityRegion` objects understood as a (probably disjoint) union.
|
|
193737
|
-
* * Most of the methods in this class ignore z-coordinates, so callers should ensure that input geometry has
|
|
193738
|
-
* rotated parallel to the xy-plane.
|
|
193755
|
+
* * **NOTE:** Most of the methods in this class ignore z-coordinates, so callers should ensure that input geometry has
|
|
193756
|
+
* been rotated parallel to the xy-plane.
|
|
193739
193757
|
* @public
|
|
193740
193758
|
*/
|
|
193741
193759
|
class RegionOps {
|
|
@@ -193985,34 +194003,29 @@ class RegionOps {
|
|
|
193985
194003
|
return RegionOps.sortOuterAndHoleLoopsXY(allLoops);
|
|
193986
194004
|
}
|
|
193987
194005
|
/**
|
|
193988
|
-
* Construct a wire
|
|
193989
|
-
* * This is a simple wire offset, not an area.
|
|
194006
|
+
* Construct a wire that is offset from the given polyline or polygon.
|
|
194007
|
+
* * This is a simple wire offset, not an area offset.
|
|
194008
|
+
* * Since z-coordinates are ignored, for best results the input points should lie in (a plane parallel to)
|
|
194009
|
+
* the xy-plane.
|
|
193990
194010
|
* * The construction algorithm attempts to eliminate some self-intersections within the offsets, but does not
|
|
193991
194011
|
* guarantee a simple area offset.
|
|
193992
|
-
* *
|
|
193993
|
-
*
|
|
194012
|
+
* * If offsetDistance is given as a number, default OffsetOptions are applied.
|
|
194013
|
+
* * See [[JointOptions]] class doc for offset construction rules.
|
|
193994
194014
|
* @param points a single loop or path
|
|
193995
194015
|
* @param wrap true to include wraparound
|
|
193996
|
-
* @param
|
|
194016
|
+
* @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or JointOptions
|
|
194017
|
+
* object.
|
|
193997
194018
|
*/
|
|
193998
|
-
static constructPolygonWireXYOffset(points, wrap,
|
|
194019
|
+
static constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions) {
|
|
193999
194020
|
const context = new _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_17__.PolygonWireOffsetContext();
|
|
194000
|
-
return context.constructPolygonWireXYOffset(points, wrap,
|
|
194021
|
+
return context.constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions);
|
|
194001
194022
|
}
|
|
194002
194023
|
/**
|
|
194003
194024
|
* Construct curves that are offset from a Path or Loop as viewed in xy-plane (ignoring z).
|
|
194004
194025
|
* * The construction will remove "some" local effects of features smaller than the offset distance, but will
|
|
194005
194026
|
* not detect self intersection among widely separated edges.
|
|
194006
194027
|
* * If offsetDistance is given as a number, default OffsetOptions are applied.
|
|
194007
|
-
* *
|
|
194008
|
-
* * If the turn is larger than `options.minArcDegrees`, a circular arc is constructed.
|
|
194009
|
-
* * If the turn is less than or equal to `options.maxChamferTurnDegrees`, extend curves along tangent to
|
|
194010
|
-
* single intersection point.
|
|
194011
|
-
* * If the turn is larger than `options.maxChamferDegrees`, the turn is constructed as a sequence of straight
|
|
194012
|
-
* lines that are:
|
|
194013
|
-
* * outside the arc
|
|
194014
|
-
* * have uniform turn angle less than `options.maxChamferDegrees`
|
|
194015
|
-
* * each line segment (except first and last) touches the arc at its midpoint.
|
|
194028
|
+
* * See [[JointOptions]] class doc for offset construction rules.
|
|
194016
194029
|
* @param curves base curves.
|
|
194017
194030
|
* @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.
|
|
194018
194031
|
*/
|
|
@@ -195187,12 +195200,16 @@ class StrokeOptions {
|
|
|
195187
195200
|
get needNormals() {
|
|
195188
195201
|
return this._needNormals !== undefined ? this._needNormals : false;
|
|
195189
195202
|
}
|
|
195190
|
-
set needNormals(value) {
|
|
195203
|
+
set needNormals(value) {
|
|
195204
|
+
this._needNormals = value;
|
|
195205
|
+
}
|
|
195191
195206
|
/** Whether twoSided is requested. */
|
|
195192
195207
|
get needTwoSided() {
|
|
195193
195208
|
return this._needTwoSided !== undefined ? this._needTwoSided : false;
|
|
195194
195209
|
}
|
|
195195
|
-
set needTwoSided(value) {
|
|
195210
|
+
set needTwoSided(value) {
|
|
195211
|
+
this._needTwoSided = value;
|
|
195212
|
+
}
|
|
195196
195213
|
/** Ask if angleTol is specified */
|
|
195197
195214
|
get hasAngleTol() {
|
|
195198
195215
|
return this.angleTol !== undefined && Math.abs(this.angleTol.radians) > 0.0;
|
|
@@ -196911,7 +196928,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
196911
196928
|
|
|
196912
196929
|
|
|
196913
196930
|
/**
|
|
196914
|
-
* Classification of
|
|
196931
|
+
* Classification of how the joint is constructed.
|
|
196915
196932
|
* @internal
|
|
196916
196933
|
*/
|
|
196917
196934
|
var JointMode;
|
|
@@ -196924,26 +196941,44 @@ var JointMode;
|
|
|
196924
196941
|
JointMode[JointMode["Gap"] = 4] = "Gap";
|
|
196925
196942
|
})(JointMode || (JointMode = {}));
|
|
196926
196943
|
/**
|
|
196927
|
-
*
|
|
196928
|
-
*
|
|
196929
|
-
* *
|
|
196930
|
-
*
|
|
196931
|
-
* *
|
|
196932
|
-
*
|
|
196933
|
-
* *
|
|
196944
|
+
* Control parameters for joint construction.
|
|
196945
|
+
* * Define a "joint" as the common point between adjacent segments of the input curve.
|
|
196946
|
+
* * Define the "turn angle" at a joint to be the angle in [0,pi] between the first derivatives (tangents) of
|
|
196947
|
+
* the segments at the joint.
|
|
196948
|
+
* * When creating offsets, if an offset needs to do an "outside" turn, the first applicable construction is applied:
|
|
196949
|
+
* * If the turn angle is larger than `options.minArcDegrees`, a circular arc is constructed to offset the joint.
|
|
196950
|
+
* * If the turn angle is less than or equal to `options.maxChamferTurnDegrees`, extend curves along tangent to
|
|
196951
|
+
* single intersection point (to create a sharp corner).
|
|
196952
|
+
* * If the turn angle is larger than `options.maxChamferDegrees`, the joint is offset with a line string whose edges:
|
|
196953
|
+
* * lie outside the arc that would have been created by the first construction
|
|
196954
|
+
* * have uniform turn angle less than `options.maxChamferDegrees`
|
|
196955
|
+
* * touch the arc at their midpoint (except first and last edge).
|
|
196934
196956
|
* @public
|
|
196935
196957
|
*/
|
|
196936
196958
|
class JointOptions {
|
|
196937
|
-
/**
|
|
196959
|
+
/**
|
|
196960
|
+
* Construct JointOptions.
|
|
196938
196961
|
* * leftOffsetDistance is required
|
|
196939
196962
|
* * minArcDegrees and maxChamferDegrees are optional.
|
|
196940
196963
|
*/
|
|
196941
|
-
constructor(leftOffsetDistance, minArcDegrees = 180, maxChamferDegrees = 90, preserveEllipticalArcs = false) {
|
|
196942
|
-
/**
|
|
196943
|
-
*
|
|
196964
|
+
constructor(leftOffsetDistance, minArcDegrees = 180, maxChamferDegrees = 90, preserveEllipticalArcs = false, allowSharpestCorners = false) {
|
|
196965
|
+
/**
|
|
196966
|
+
* Smallest arc to construct.
|
|
196967
|
+
* * If this control angle is 180 degrees or more, arcs are never created.
|
|
196944
196968
|
*/
|
|
196945
196969
|
this.minArcDegrees = 180.0;
|
|
196970
|
+
/** Largest turn angle at which to construct a sharp corner, or largest turn angle in a multi-segment chamfer. */
|
|
196946
196971
|
this.maxChamferTurnDegrees = 90;
|
|
196972
|
+
/**
|
|
196973
|
+
* Whether to remove the internal turn angle upper bound for sharp corner construction.
|
|
196974
|
+
* * By default, a sharp corner is not created at a joint when the turn angle is too large, so as to avoid offsets whose
|
|
196975
|
+
* ranges blow up. Internally, this is implemented by applying an upper bound of 120 degrees to `maxChamferTurnDegrees`.
|
|
196976
|
+
* * When `allowSharpestCorners` is true, this internal upper bound is removed, allowing sharp corners for turn angles
|
|
196977
|
+
* up to `maxChamferTurnDegrees`.
|
|
196978
|
+
* * Thus, if you know your input turn angles are no greater than `maxChamferTurnDegrees`, you can create an offset
|
|
196979
|
+
* with sharp corners at each joint by setting `minArcDegrees` to 180 and `allowSharpestCorners` to true.
|
|
196980
|
+
*/
|
|
196981
|
+
this.allowSharpestCorners = false;
|
|
196947
196982
|
/** Offset distance, positive to left of base curve. */
|
|
196948
196983
|
this.leftOffsetDistance = 0;
|
|
196949
196984
|
/** Whether to offset elliptical arcs as elliptical arcs (true) or as B-spline curves (false, default). */
|
|
@@ -196952,10 +196987,11 @@ class JointOptions {
|
|
|
196952
196987
|
this.minArcDegrees = minArcDegrees;
|
|
196953
196988
|
this.maxChamferTurnDegrees = maxChamferDegrees;
|
|
196954
196989
|
this.preserveEllipticalArcs = preserveEllipticalArcs;
|
|
196990
|
+
this.allowSharpestCorners = allowSharpestCorners;
|
|
196955
196991
|
}
|
|
196956
196992
|
/** Return a deep clone. */
|
|
196957
196993
|
clone() {
|
|
196958
|
-
return new JointOptions(this.leftOffsetDistance, this.minArcDegrees, this.maxChamferTurnDegrees, this.preserveEllipticalArcs);
|
|
196994
|
+
return new JointOptions(this.leftOffsetDistance, this.minArcDegrees, this.maxChamferTurnDegrees, this.preserveEllipticalArcs, this.allowSharpestCorners);
|
|
196959
196995
|
}
|
|
196960
196996
|
/** Copy values of input options */
|
|
196961
196997
|
setFrom(other) {
|
|
@@ -196963,6 +196999,7 @@ class JointOptions {
|
|
|
196963
196999
|
this.minArcDegrees = other.minArcDegrees;
|
|
196964
197000
|
this.maxChamferTurnDegrees = other.maxChamferTurnDegrees;
|
|
196965
197001
|
this.preserveEllipticalArcs = other.preserveEllipticalArcs;
|
|
197002
|
+
this.allowSharpestCorners = other.allowSharpestCorners;
|
|
196966
197003
|
}
|
|
196967
197004
|
/**
|
|
196968
197005
|
* Parse a number or JointOptions up to JointOptions:
|
|
@@ -196973,17 +197010,22 @@ class JointOptions {
|
|
|
196973
197010
|
static create(leftOffsetDistanceOrOptions) {
|
|
196974
197011
|
if (leftOffsetDistanceOrOptions instanceof JointOptions)
|
|
196975
197012
|
return leftOffsetDistanceOrOptions;
|
|
196976
|
-
// if (Number.isFinite(leftOffsetDistanceOrOptions))
|
|
196977
197013
|
return new JointOptions(leftOffsetDistanceOrOptions);
|
|
196978
197014
|
}
|
|
196979
|
-
/**
|
|
197015
|
+
/**
|
|
197016
|
+
/** Return true if the options indicate this amount of turn should be handled with an arc. */
|
|
196980
197017
|
needArc(theta) {
|
|
196981
197018
|
return Math.abs(theta.degrees) >= this.minArcDegrees;
|
|
196982
197019
|
}
|
|
196983
|
-
/**
|
|
197020
|
+
/** Return the number of corners needed to chamfer the given turn angle. */
|
|
196984
197021
|
numChamferPoints(theta) {
|
|
196985
197022
|
const degrees = Math.abs(theta.degrees);
|
|
196986
|
-
const
|
|
197023
|
+
const minStepDegreesClamp = 10;
|
|
197024
|
+
let maxStepDegreesClamp = 120;
|
|
197025
|
+
if (this.allowSharpestCorners) {
|
|
197026
|
+
maxStepDegreesClamp = this.maxChamferTurnDegrees;
|
|
197027
|
+
}
|
|
197028
|
+
const stepDegrees = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.clamp(this.maxChamferTurnDegrees, minStepDegreesClamp, maxStepDegreesClamp);
|
|
196987
197029
|
if (degrees <= stepDegrees)
|
|
196988
197030
|
return 1;
|
|
196989
197031
|
return Math.ceil(degrees / stepDegrees);
|
|
@@ -196999,17 +197041,41 @@ class OffsetOptions {
|
|
|
196999
197041
|
this.jointOptions = JointOptions.create(offsetDistanceOrOptions);
|
|
197000
197042
|
this.strokeOptions = (strokeOptions !== undefined) ? strokeOptions : _StrokeOptions__WEBPACK_IMPORTED_MODULE_1__.StrokeOptions.createForCurves();
|
|
197001
197043
|
}
|
|
197002
|
-
get minArcDegrees() {
|
|
197003
|
-
|
|
197004
|
-
|
|
197005
|
-
set
|
|
197006
|
-
|
|
197007
|
-
|
|
197008
|
-
get
|
|
197009
|
-
|
|
197010
|
-
|
|
197044
|
+
get minArcDegrees() {
|
|
197045
|
+
return this.jointOptions.minArcDegrees;
|
|
197046
|
+
}
|
|
197047
|
+
set minArcDegrees(value) {
|
|
197048
|
+
this.jointOptions.minArcDegrees = value;
|
|
197049
|
+
}
|
|
197050
|
+
get maxChamferTurnDegrees() {
|
|
197051
|
+
return this.jointOptions.maxChamferTurnDegrees;
|
|
197052
|
+
}
|
|
197053
|
+
set maxChamferTurnDegrees(value) {
|
|
197054
|
+
this.jointOptions.maxChamferTurnDegrees = value;
|
|
197055
|
+
}
|
|
197056
|
+
get allowSharpestCorners() {
|
|
197057
|
+
return this.jointOptions.allowSharpestCorners;
|
|
197058
|
+
}
|
|
197059
|
+
set allowSharpestCorners(value) {
|
|
197060
|
+
this.jointOptions.allowSharpestCorners = value;
|
|
197061
|
+
}
|
|
197062
|
+
get leftOffsetDistance() {
|
|
197063
|
+
return this.jointOptions.leftOffsetDistance;
|
|
197064
|
+
}
|
|
197065
|
+
set leftOffsetDistance(value) {
|
|
197066
|
+
this.jointOptions.leftOffsetDistance = value;
|
|
197067
|
+
}
|
|
197068
|
+
get preserveEllipticalArcs() {
|
|
197069
|
+
return this.jointOptions.preserveEllipticalArcs;
|
|
197070
|
+
}
|
|
197071
|
+
set preserveEllipticalArcs(value) {
|
|
197072
|
+
this.jointOptions.preserveEllipticalArcs = value;
|
|
197073
|
+
}
|
|
197074
|
+
/**
|
|
197075
|
+
* Convert variant input into OffsetOptions.
|
|
197011
197076
|
* * If a JointOptions is provided, it is captured.
|
|
197012
|
-
* * If an OffsetOptions is provided, a reference to it is returned.
|
|
197077
|
+
* * If an OffsetOptions is provided, a reference to it is returned.
|
|
197078
|
+
*/
|
|
197013
197079
|
static create(offsetDistanceOrOptions) {
|
|
197014
197080
|
if (offsetDistanceOrOptions instanceof OffsetOptions)
|
|
197015
197081
|
return offsetDistanceOrOptions;
|
|
@@ -197038,7 +197104,9 @@ class Joint {
|
|
|
197038
197104
|
this.swingPoint = swingPoint;
|
|
197039
197105
|
this.flexure = JointMode.Unknown;
|
|
197040
197106
|
}
|
|
197041
|
-
/**
|
|
197107
|
+
/**
|
|
197108
|
+
* Try to construct an arc transition from ray0 to ray1 with given center.
|
|
197109
|
+
*/
|
|
197042
197110
|
static constructArc(ray0, center, ray1) {
|
|
197043
197111
|
if (center !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(ray0.origin.distance(center), ray1.origin.distance(center))) {
|
|
197044
197112
|
const angle = ray0.direction.angleToXY(ray1.direction);
|
|
@@ -197083,6 +197151,7 @@ class Joint {
|
|
|
197083
197151
|
destination.packedPoints.push(point);
|
|
197084
197152
|
}
|
|
197085
197153
|
}
|
|
197154
|
+
/** Append stroke points along the offset curve defined by the Joint chain to the destination line string. */
|
|
197086
197155
|
static collectStrokesFromChain(start, destination, maxTest = 100) {
|
|
197087
197156
|
let numOut = -2 * maxTest; // allow extra things to happen
|
|
197088
197157
|
Joint.visitJointsOnChain(start, (joint) => {
|
|
@@ -197094,7 +197163,7 @@ class Joint {
|
|
|
197094
197163
|
if (fA === 0.0 && fB === 1.0)
|
|
197095
197164
|
curve1 = joint.curve1.clone();
|
|
197096
197165
|
else if (fA < fB)
|
|
197097
|
-
curve1 = joint.curve1.clonePartialCurve(fA, fB);
|
|
197166
|
+
curve1 = joint.curve1.clonePartialCurve(fA, fB); // trimming is done by clonePartialCurve
|
|
197098
197167
|
if (curve1) {
|
|
197099
197168
|
if (!joint.jointCurve) {
|
|
197100
197169
|
this.addPoint(destination, curve1.startPoint());
|
|
@@ -197134,6 +197203,7 @@ class Joint {
|
|
|
197134
197203
|
}
|
|
197135
197204
|
}
|
|
197136
197205
|
}
|
|
197206
|
+
/** Append CurvePrimitives along the offset curve defined by the Joint chain to the destination array. */
|
|
197137
197207
|
static collectCurvesFromChain(start, destination, maxTest = 100) {
|
|
197138
197208
|
if (start === undefined)
|
|
197139
197209
|
return;
|
|
@@ -197148,13 +197218,13 @@ class Joint {
|
|
|
197148
197218
|
if (fA === 0.0 && fB === 1.0)
|
|
197149
197219
|
curve1 = joint.curve1.clone();
|
|
197150
197220
|
else if (fA < fB)
|
|
197151
|
-
curve1 = joint.curve1.clonePartialCurve(fA, fB);
|
|
197221
|
+
curve1 = joint.curve1.clonePartialCurve(fA, fB); // trimming is done by clonePartialCurve
|
|
197152
197222
|
this.collectPrimitive(destination, curve1);
|
|
197153
197223
|
}
|
|
197154
197224
|
return numOut++ < maxTest;
|
|
197155
197225
|
}, maxTest);
|
|
197156
197226
|
}
|
|
197157
|
-
/** Execute `joint.annotateJointMode()` at all joints on the chain. */
|
|
197227
|
+
/** Execute `joint.annotateJointMode()` at all joints on the chain to set some of the joints attributes. */
|
|
197158
197228
|
static annotateChain(start, options, maxTest = 100) {
|
|
197159
197229
|
if (start)
|
|
197160
197230
|
Joint.visitJointsOnChain(start, (joint) => { joint.annotateJointMode(options); return true; }, maxTest);
|
|
@@ -197162,7 +197232,7 @@ class Joint {
|
|
|
197162
197232
|
/**
|
|
197163
197233
|
* Visit joints on a chain.
|
|
197164
197234
|
* * terminate on `false` return from `callback`
|
|
197165
|
-
* @param start first (and, for cyclic chain, final)
|
|
197235
|
+
* @param start first (and, for cyclic chain, final) joint
|
|
197166
197236
|
* @param callback function to call with each Joint as a single parameter.
|
|
197167
197237
|
*/
|
|
197168
197238
|
static visitJointsOnChain(start, callback, maxTest = 100) {
|
|
@@ -197170,7 +197240,7 @@ class Joint {
|
|
|
197170
197240
|
if (joint) {
|
|
197171
197241
|
let numTest = 0;
|
|
197172
197242
|
while (joint !== undefined) {
|
|
197173
|
-
if (numTest++ >= maxTest + 5)
|
|
197243
|
+
if (numTest++ >= maxTest + 5) // allow extra things to happen
|
|
197174
197244
|
return true;
|
|
197175
197245
|
if (!callback(joint))
|
|
197176
197246
|
return false;
|
|
@@ -197186,13 +197256,13 @@ class Joint {
|
|
|
197186
197256
|
if (this.curve0 && this.curve1) {
|
|
197187
197257
|
const ray0 = this.curve0.fractionToPointAndDerivative(1.0);
|
|
197188
197258
|
const ray1 = this.curve1.fractionToPointAndDerivative(0.0);
|
|
197189
|
-
const intersection = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_7__.Ray3d.closestApproachRay3dRay3d(ray0, ray1);
|
|
197259
|
+
const intersection = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_7__.Ray3d.closestApproachRay3dRay3d(ray0, ray1); // intersection of the 2 ray lines
|
|
197190
197260
|
if (intersection.approachType === _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_8__.CurveCurveApproachType.Intersection) {
|
|
197191
197261
|
if (intersection.detailA.fraction >= 0.0 && intersection.detailB.fraction <= 0.0) {
|
|
197192
197262
|
this.fraction0 = 1.0;
|
|
197193
197263
|
this.fraction1 = 0.0;
|
|
197194
197264
|
this.flexure = JointMode.Extend;
|
|
197195
|
-
const theta = ray0.getDirectionRef().angleToXY(ray1.getDirectionRef());
|
|
197265
|
+
const theta = ray0.getDirectionRef().angleToXY(ray1.getDirectionRef()); // angle between the 2 ray lines
|
|
197196
197266
|
if (options.needArc(theta)) {
|
|
197197
197267
|
const arc = Joint.constructArc(ray0, this.curve0.baseCurveEnd, ray1);
|
|
197198
197268
|
if (arc) {
|
|
@@ -197200,13 +197270,12 @@ class Joint {
|
|
|
197200
197270
|
return;
|
|
197201
197271
|
}
|
|
197202
197272
|
}
|
|
197203
|
-
const numChamferPoints = options.numChamferPoints(theta);
|
|
197204
|
-
if (numChamferPoints <= 1) {
|
|
197273
|
+
const numChamferPoints = options.numChamferPoints(theta); // how many interior points in the linestring
|
|
197274
|
+
if (numChamferPoints <= 1) { // create sharp corner
|
|
197205
197275
|
this.jointCurve = _LineString3d__WEBPACK_IMPORTED_MODULE_6__.LineString3d.create(ray0.origin, intersection.detailA.point, ray1.origin);
|
|
197206
197276
|
return;
|
|
197207
197277
|
}
|
|
197208
|
-
if (numChamferPoints > 1) {
|
|
197209
|
-
// A nontrivial linestring ...
|
|
197278
|
+
if (numChamferPoints > 1) { // create chamfer corner (a line string)
|
|
197210
197279
|
const radians0 = theta.radians;
|
|
197211
197280
|
const numHalfStep = 2.0 * numChamferPoints;
|
|
197212
197281
|
const halfStepRadians = radians0 / numHalfStep;
|
|
@@ -197226,19 +197295,20 @@ class Joint {
|
|
|
197226
197295
|
}
|
|
197227
197296
|
}
|
|
197228
197297
|
}
|
|
197229
|
-
//
|
|
197298
|
+
// if there is no intersection between the 2 ray lines, fill the gap by a line segment
|
|
197230
197299
|
this.flexure = JointMode.Gap;
|
|
197231
197300
|
this.jointCurve = _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d.create(this.curve0.fractionToPoint(1.0), this.curve1.fractionToPoint(0.0));
|
|
197232
197301
|
this.fraction0 = 1.0;
|
|
197233
197302
|
this.fraction1 = 0.0;
|
|
197234
197303
|
}
|
|
197235
197304
|
}
|
|
197236
|
-
|
|
197305
|
+
/** Select the index at which summed fraction difference is smallest */
|
|
197237
197306
|
selectIntersectionIndexByFraction(fractionA, fractionB, intersections) {
|
|
197238
197307
|
let index = -1;
|
|
197239
197308
|
let aMin = Number.MAX_VALUE;
|
|
197240
197309
|
for (let i = 0; i < intersections.length; i++) {
|
|
197241
|
-
const a = Math.abs(intersections[i].detailA.fraction - fractionA)
|
|
197310
|
+
const a = Math.abs(intersections[i].detailA.fraction - fractionA)
|
|
197311
|
+
+ Math.abs(intersections[i].detailB.fraction - fractionB);
|
|
197242
197312
|
if (a < aMin) {
|
|
197243
197313
|
aMin = a;
|
|
197244
197314
|
index = i;
|
|
@@ -197247,42 +197317,42 @@ class Joint {
|
|
|
197247
197317
|
return index;
|
|
197248
197318
|
}
|
|
197249
197319
|
/**
|
|
197250
|
-
* Examine the adjacent geometry
|
|
197251
|
-
* * set JointMode:
|
|
197320
|
+
* Examine the adjacent geometry to set some of joint attributes:
|
|
197321
|
+
* * set JointMode: one of Cap, Extend, or Trim
|
|
197252
197322
|
* * set fraction0 and fraction1 of intersection of curve0 and curve1
|
|
197323
|
+
* * set joint curve
|
|
197253
197324
|
* * this REFERENCES curve0, curve1, fraction0, fraction1
|
|
197254
197325
|
* * this does not reference nextJoint and previousJoint
|
|
197255
197326
|
*/
|
|
197256
197327
|
annotateJointMode(options) {
|
|
197257
|
-
if (this.curve0 &&
|
|
197328
|
+
if (!this.curve0 && this.curve1) { // joint at the start of the chain
|
|
197258
197329
|
this.flexure = JointMode.Cap;
|
|
197259
|
-
this.
|
|
197330
|
+
this.fraction1 = 0.0;
|
|
197260
197331
|
}
|
|
197261
|
-
else if (this.
|
|
197332
|
+
else if (this.curve0 && !this.curve1) { // joint at the end of the chain
|
|
197262
197333
|
this.flexure = JointMode.Cap;
|
|
197263
|
-
this.
|
|
197334
|
+
this.fraction0 = 1.0;
|
|
197264
197335
|
}
|
|
197265
|
-
else if (this.curve0 && this.curve1) {
|
|
197266
|
-
|
|
197267
|
-
if (this.curve0.endPoint().isAlmostEqual(this.curve1.startPoint())) {
|
|
197336
|
+
else if (this.curve0 && this.curve1) { // joints at the middle of the chain
|
|
197337
|
+
if (this.curve0.endPoint().isAlmostEqual(this.curve1.startPoint())) { // joint between colinear segments
|
|
197268
197338
|
this.fraction0 = 1.0;
|
|
197269
197339
|
this.fraction1 = 0.0;
|
|
197270
197340
|
this.flexure = JointMode.Trim;
|
|
197271
197341
|
}
|
|
197272
|
-
else if (this.curve0 instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d && this.curve1 instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d) {
|
|
197273
|
-
const ray0 = this.curve0.fractionToPointAndDerivative(0.0);
|
|
197274
|
-
const ray1 = this.curve1.fractionToPointAndDerivative(0.0);
|
|
197275
|
-
const intersection = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_7__.Ray3d.closestApproachRay3dRay3d(ray0, ray1);
|
|
197342
|
+
else if (this.curve0 instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d && this.curve1 instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d) { // pair of lines
|
|
197343
|
+
const ray0 = this.curve0.fractionToPointAndDerivative(0.0);
|
|
197344
|
+
const ray1 = this.curve1.fractionToPointAndDerivative(0.0);
|
|
197345
|
+
const intersection = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_7__.Ray3d.closestApproachRay3dRay3d(ray0, ray1); // intersection of the 2 ray lines
|
|
197276
197346
|
if (intersection.approachType === _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_8__.CurveCurveApproachType.Intersection) {
|
|
197277
197347
|
this.fraction0 = intersection.detailA.fraction;
|
|
197278
197348
|
this.fraction1 = intersection.detailB.fraction;
|
|
197279
|
-
if (this.fraction0 >= 1.0 && this.fraction1 <= 0.0) {
|
|
197349
|
+
if (this.fraction0 >= 1.0 && this.fraction1 <= 0.0) { // need to extend
|
|
197280
197350
|
this.annotateExtension(options);
|
|
197281
197351
|
}
|
|
197282
|
-
else if (this.fraction0 < 1.0 && this.fraction1 > 0.0) {
|
|
197352
|
+
else if (this.fraction0 < 1.0 && this.fraction1 > 0.0) { // need to trim
|
|
197283
197353
|
this.flexure = JointMode.Trim;
|
|
197284
197354
|
}
|
|
197285
|
-
else if (this.fraction0 > 1.0 && this.fraction1 > 1.0) {
|
|
197355
|
+
else if (this.fraction0 > 1.0 && this.fraction1 > 1.0) { // need to fill gap with a single line segment
|
|
197286
197356
|
this.flexure = JointMode.Gap;
|
|
197287
197357
|
this.jointCurve = _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d.create(this.curve0.fractionToPoint(1.0), this.curve1.fractionToPoint(0.0));
|
|
197288
197358
|
this.fraction0 = 1.0;
|
|
@@ -197290,15 +197360,15 @@ class Joint {
|
|
|
197290
197360
|
}
|
|
197291
197361
|
}
|
|
197292
197362
|
}
|
|
197293
|
-
else { // generic pair of curves
|
|
197363
|
+
else { // generic pair of curves
|
|
197294
197364
|
const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_9__.CurveCurve.intersectionXYPairs(this.curve0, false, this.curve1, false);
|
|
197295
197365
|
const intersectionIndex = this.selectIntersectionIndexByFraction(1.0, 0.0, intersections);
|
|
197296
|
-
if (intersectionIndex >= 0) {
|
|
197366
|
+
if (intersectionIndex >= 0) { // need to trim
|
|
197297
197367
|
this.flexure = JointMode.Trim;
|
|
197298
197368
|
this.fraction0 = intersections[intersectionIndex].detailA.fraction;
|
|
197299
197369
|
this.fraction1 = intersections[intersectionIndex].detailB.fraction;
|
|
197300
197370
|
}
|
|
197301
|
-
else {
|
|
197371
|
+
else { // need to extend
|
|
197302
197372
|
this.annotateExtension(options);
|
|
197303
197373
|
}
|
|
197304
197374
|
}
|
|
@@ -197306,7 +197376,8 @@ class Joint {
|
|
|
197306
197376
|
}
|
|
197307
197377
|
/**
|
|
197308
197378
|
* * Examine the primitive trim fractions between each pair of joints.
|
|
197309
|
-
* * If trim fractions indicate the primitive must disappear, replace the joint pair by a new joint pointing at
|
|
197379
|
+
* * If trim fractions indicate the primitive must disappear, replace the joint pair by a new joint pointing at
|
|
197380
|
+
* surrounding primitives
|
|
197310
197381
|
* @param start
|
|
197311
197382
|
*/
|
|
197312
197383
|
static removeDegeneratePrimitives(start, options, maxTest) {
|
|
@@ -197341,8 +197412,7 @@ class Joint {
|
|
|
197341
197412
|
}
|
|
197342
197413
|
*/
|
|
197343
197414
|
const eliminateF = f0 >= f1 || f0 > 1.0;
|
|
197344
|
-
const eliminateG = (g0 !== undefined && g0 > 1.0)
|
|
197345
|
-
|| (g0 !== undefined && g1 !== undefined && g0 >= g1);
|
|
197415
|
+
const eliminateG = (g0 !== undefined && g0 > 1.0) || (g0 !== undefined && g1 !== undefined && g0 >= g1);
|
|
197346
197416
|
if (eliminateF && eliminateG) {
|
|
197347
197417
|
const jointC = jointB.nextJoint;
|
|
197348
197418
|
const newJoint = new Joint(jointA.curve0, jointC.curve1, undefined);
|
|
@@ -197398,9 +197468,8 @@ class Joint {
|
|
|
197398
197468
|
* @internal
|
|
197399
197469
|
*/
|
|
197400
197470
|
class PolygonWireOffsetContext {
|
|
197401
|
-
/**
|
|
197402
|
-
constructor() {
|
|
197403
|
-
}
|
|
197471
|
+
/** Construct a context. */
|
|
197472
|
+
constructor() { }
|
|
197404
197473
|
// Construct a single offset from base points
|
|
197405
197474
|
static createOffsetSegment(basePointA, basePointB, distance) {
|
|
197406
197475
|
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(basePointA, basePointB, this._unitAlong);
|
|
@@ -197413,13 +197482,25 @@ class PolygonWireOffsetContext {
|
|
|
197413
197482
|
return undefined;
|
|
197414
197483
|
}
|
|
197415
197484
|
/**
|
|
197416
|
-
* Construct
|
|
197417
|
-
*
|
|
197418
|
-
*
|
|
197419
|
-
*
|
|
197420
|
-
*
|
|
197485
|
+
* Construct a wire (not area) that is offset from given polyline or polygon (which must be in xy-plane or in
|
|
197486
|
+
* a plane parallel to xy-plane).
|
|
197487
|
+
* * This is a simple wire offset (in the form of a line string), not an area.
|
|
197488
|
+
* * If offsetDistance is given as a number, default OffsetOptions are applied.
|
|
197489
|
+
* * See [[JointOptions]] class doc for offset construction rules.
|
|
197490
|
+
* @param points a single loop or path
|
|
197491
|
+
* @param wrap true to offset the wraparound joint. Assumes first = last point.
|
|
197492
|
+
* @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or JointOptions
|
|
197493
|
+
* object.
|
|
197421
197494
|
*/
|
|
197422
197495
|
constructPolygonWireXYOffset(points, wrap, leftOffsetDistanceOrOptions) {
|
|
197496
|
+
/**
|
|
197497
|
+
* if "wrap = true", then first and last point in the points array must be close; otherwise
|
|
197498
|
+
* generated offset will be invalid.
|
|
197499
|
+
*/
|
|
197500
|
+
if (wrap && !points[0].isAlmostEqual(points[points.length - 1])) {
|
|
197501
|
+
wrap = false;
|
|
197502
|
+
}
|
|
197503
|
+
/** create raw offsets as a linked list (joint0) */
|
|
197423
197504
|
const options = JointOptions.create(leftOffsetDistanceOrOptions);
|
|
197424
197505
|
const numPoints = points.length;
|
|
197425
197506
|
let fragment0 = PolygonWireOffsetContext.createOffsetSegment(points[0], points[1], options.leftOffsetDistance);
|
|
@@ -197439,7 +197520,9 @@ class PolygonWireOffsetContext {
|
|
|
197439
197520
|
newJoint = new Joint(fragment0, undefined, points[numPoints - 1]);
|
|
197440
197521
|
Joint.link(previousJoint, newJoint);
|
|
197441
197522
|
}
|
|
197523
|
+
/** annotateChain sets some of the joints attributes (including how to extend curves or fill the gap between curves) */
|
|
197442
197524
|
Joint.annotateChain(joint0, options, numPoints);
|
|
197525
|
+
/** make limited passes through the Joint chain until no self-intersections are removed */
|
|
197443
197526
|
for (let pass = 0; pass++ < 5;) {
|
|
197444
197527
|
const state = Joint.removeDegeneratePrimitives(joint0, options, numPoints);
|
|
197445
197528
|
joint0 = state.newStart;
|
|
@@ -197453,6 +197536,7 @@ class PolygonWireOffsetContext {
|
|
|
197453
197536
|
*/
|
|
197454
197537
|
}
|
|
197455
197538
|
// Joint.collectPrimitivesFromChain(joint0, result, numPoints);
|
|
197539
|
+
/** turn the Joint linked list into a CurveCollection (Loop or Path). trimming is done in collectStrokesFromChain */
|
|
197456
197540
|
const chain = _LineString3d__WEBPACK_IMPORTED_MODULE_6__.LineString3d.create();
|
|
197457
197541
|
Joint.collectStrokesFromChain(joint0, chain, numPoints);
|
|
197458
197542
|
const n = chain.packedPoints.length;
|
|
@@ -197476,14 +197560,13 @@ PolygonWireOffsetContext._offsetB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTE
|
|
|
197476
197560
|
*/
|
|
197477
197561
|
class CurveChainWireOffsetContext {
|
|
197478
197562
|
/** construct a context. */
|
|
197479
|
-
constructor() {
|
|
197480
|
-
}
|
|
197563
|
+
constructor() { }
|
|
197481
197564
|
/**
|
|
197482
197565
|
* Annotate a CurvePrimitive with properties `baseCurveStart` and `baseCurveEnd`.
|
|
197483
|
-
*
|
|
197484
|
-
* @param cp primitive to annotate
|
|
197566
|
+
* @param cp curve primitive to annotate
|
|
197485
197567
|
* @param startPoint optional start point
|
|
197486
197568
|
* @param endPoint optional end point
|
|
197569
|
+
* @return the input CurvePrimitive with annotations
|
|
197487
197570
|
*/
|
|
197488
197571
|
static applyBasePoints(cp, startPoint, endPoint) {
|
|
197489
197572
|
if (cp !== undefined) {
|
|
@@ -197495,7 +197578,7 @@ class CurveChainWireOffsetContext {
|
|
|
197495
197578
|
return cp;
|
|
197496
197579
|
}
|
|
197497
197580
|
/**
|
|
197498
|
-
* Create the offset of a single primitive.
|
|
197581
|
+
* Create the offset of a single primitive as viewed in the xy-plane (ignoring z).
|
|
197499
197582
|
* * each primitive may be labeled (as an `any` object) with start or end point of base curve:
|
|
197500
197583
|
* * `(primitive as any).baseCurveStart: Point3d`
|
|
197501
197584
|
* * `(primitive as any).baseCurveEnd: Point3d`
|
|
@@ -197519,15 +197602,10 @@ class CurveChainWireOffsetContext {
|
|
|
197519
197602
|
}
|
|
197520
197603
|
/**
|
|
197521
197604
|
* Construct curves that are offset from a Path or Loop as viewed in xy-plane (ignoring z).
|
|
197522
|
-
* * The construction will remove "some" local effects of features smaller than the offset distance, but will
|
|
197605
|
+
* * The construction will remove "some" local effects of features smaller than the offset distance, but will
|
|
197606
|
+
* not detect self intersection among widely separated edges.
|
|
197523
197607
|
* * If offsetDistance is given as a number, default OffsetOptions are applied.
|
|
197524
|
-
* *
|
|
197525
|
-
* * If the turn is larger than `options.minArcDegrees`, a circular arc is constructed.
|
|
197526
|
-
* * If the turn is less than or equal to `options.maxChamferTurnDegrees`, extend curves along tangent to single intersection point.
|
|
197527
|
-
* * If the turn is larger than `options.maxChamferDegrees`, the turn is constructed as a sequence of straight lines that are:
|
|
197528
|
-
* * outside the arc
|
|
197529
|
-
* * have uniform turn angle less than `options.maxChamferDegrees`
|
|
197530
|
-
* * each line segment (except first and last) touches the arc at its midpoint.
|
|
197608
|
+
* * See [[JointOptions]] class doc for offset construction rules.
|
|
197531
197609
|
* @param curves base curves.
|
|
197532
197610
|
* @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.
|
|
197533
197611
|
*/
|
|
@@ -197535,14 +197613,15 @@ class CurveChainWireOffsetContext {
|
|
|
197535
197613
|
const wrap = curves instanceof _Loop__WEBPACK_IMPORTED_MODULE_10__.Loop;
|
|
197536
197614
|
const offsetOptions = OffsetOptions.create(offsetDistanceOrOptions);
|
|
197537
197615
|
const simpleOffsets = [];
|
|
197538
|
-
|
|
197616
|
+
/** traverse primitives (children of curves) and create simple offsets of each primitive as an array */
|
|
197539
197617
|
for (const c of curves.children) {
|
|
197540
197618
|
const c1 = CurveChainWireOffsetContext.createSingleOffsetPrimitiveXY(c, offsetOptions);
|
|
197541
197619
|
if (c1 === undefined) {
|
|
197542
197620
|
// bad .. maybe arc to inside?
|
|
197543
197621
|
}
|
|
197544
|
-
else if (c1 instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__.CurvePrimitive)
|
|
197622
|
+
else if (c1 instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__.CurvePrimitive) {
|
|
197545
197623
|
simpleOffsets.push(c1);
|
|
197624
|
+
}
|
|
197546
197625
|
else if (Array.isArray(c1)) {
|
|
197547
197626
|
for (const c2 of c1) {
|
|
197548
197627
|
if (c2 instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__.CurvePrimitive)
|
|
@@ -197550,6 +197629,7 @@ class CurveChainWireOffsetContext {
|
|
|
197550
197629
|
}
|
|
197551
197630
|
}
|
|
197552
197631
|
}
|
|
197632
|
+
/** create joints between array elements to make offsets as a linked list (joint0) */
|
|
197553
197633
|
let fragment0;
|
|
197554
197634
|
let newJoint;
|
|
197555
197635
|
let previousJoint;
|
|
@@ -197568,8 +197648,10 @@ class CurveChainWireOffsetContext {
|
|
|
197568
197648
|
}
|
|
197569
197649
|
if (joint0 && previousJoint && curves instanceof _Loop__WEBPACK_IMPORTED_MODULE_10__.Loop)
|
|
197570
197650
|
Joint.link(previousJoint, joint0);
|
|
197651
|
+
/** annotateChain sets some of the joints attributes (including how to extend curves or fill the gap between curves) */
|
|
197571
197652
|
const numOffset = simpleOffsets.length;
|
|
197572
197653
|
Joint.annotateChain(joint0, offsetOptions.jointOptions, numOffset);
|
|
197654
|
+
/** turn the Joint linked list into a CurveCollection. trimming is done in collectCurvesFromChain */
|
|
197573
197655
|
const outputCurves = [];
|
|
197574
197656
|
Joint.collectCurvesFromChain(joint0, outputCurves, numOffset);
|
|
197575
197657
|
return _RegionOps__WEBPACK_IMPORTED_MODULE_13__.RegionOps.createLoopPathOrBagOfCurves(outputCurves, wrap, true);
|
|
@@ -210256,10 +210338,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
210256
210338
|
* * are NOT required to be unit vectors.
|
|
210257
210339
|
* * are NOT required to be perpendicular vectors.
|
|
210258
210340
|
* * The skewed, non-uniform scaling of the grid directions is the primary focus of this class.
|
|
210259
|
-
* * Queries of altitude, velocity, normalX, normalY, and normalZ use the NORMALIZED cross product of vectorU
|
|
210341
|
+
* * Queries of altitude, velocity, normalX, normalY, and normalZ use the NORMALIZED cross product of vectorU
|
|
210342
|
+
* and vectorV as plane normal.
|
|
210260
210343
|
* * Hence these are cartesian distances.
|
|
210261
210344
|
* * If numerous calls to these are expected, the repeated normalization may be a performance issue.
|
|
210262
|
-
* * Using a [[Plane3dByOriginAndUnitNormal]] or the rigid transform returned by [[toRigidFrame]] would provide
|
|
210345
|
+
* * Using a [[Plane3dByOriginAndUnitNormal]] or the rigid transform returned by [[toRigidFrame]] would provide
|
|
210346
|
+
* better performance.
|
|
210263
210347
|
* @public
|
|
210264
210348
|
*/
|
|
210265
210349
|
class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d {
|
|
@@ -210269,7 +210353,7 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
|
|
|
210269
210353
|
this.vectorU = vectorU;
|
|
210270
210354
|
this.vectorV = vectorV;
|
|
210271
210355
|
}
|
|
210272
|
-
/**
|
|
210356
|
+
/** Create a new plane from origin and 2 in-plane vectors. */
|
|
210273
210357
|
static createOriginAndVectors(origin, vectorU, vectorV, result) {
|
|
210274
210358
|
if (result) {
|
|
210275
210359
|
result.origin.setFrom(origin);
|
|
@@ -210279,13 +210363,14 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
|
|
|
210279
210363
|
}
|
|
210280
210364
|
return new Plane3dByOriginAndVectors(origin.clone(), vectorU.clone(), vectorV.clone());
|
|
210281
210365
|
}
|
|
210282
|
-
/**
|
|
210366
|
+
/** Clone to a new plane. */
|
|
210283
210367
|
clone(result) {
|
|
210284
210368
|
if (result !== undefined)
|
|
210285
210369
|
result.setOriginAndVectors(this.origin, this.vectorU, this.vectorV);
|
|
210286
210370
|
return new Plane3dByOriginAndVectors(this.origin.clone(), this.vectorU.clone(), this.vectorV.clone());
|
|
210287
210371
|
}
|
|
210288
|
-
/**
|
|
210372
|
+
/**
|
|
210373
|
+
* Create a new Plane3dByOriginAndVectors from a variety of plane types.
|
|
210289
210374
|
* * The input is NOT captured.
|
|
210290
210375
|
*/
|
|
210291
210376
|
static createFrom(source, result) {
|
|
@@ -210344,7 +210429,8 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
|
|
|
210344
210429
|
this.vectorV.set(vx, vy, vz);
|
|
210345
210430
|
return this;
|
|
210346
210431
|
}
|
|
210347
|
-
/**
|
|
210432
|
+
/**
|
|
210433
|
+
* Set all origin and both vectors from coordinates in given origin and vectors.
|
|
210348
210434
|
* * Note that coordinates are copied out of the parameters -- the given parameters are NOT retained by reference.
|
|
210349
210435
|
*/
|
|
210350
210436
|
setOriginAndVectors(origin, vectorU, vectorV) {
|
|
@@ -210359,7 +210445,8 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
|
|
|
210359
210445
|
return result.setOriginAndVectorsXYZ(x0, y0, z0, ux, uy, uz, vx, vy, vz);
|
|
210360
210446
|
return new Plane3dByOriginAndVectors(_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(x0, y0, z0), _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(ux, uy, uz), _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(vx, vy, vz));
|
|
210361
210447
|
}
|
|
210362
|
-
/**
|
|
210448
|
+
/**
|
|
210449
|
+
* Define a plane by three points in the plane.
|
|
210363
210450
|
* @param origin origin for the parameterization.
|
|
210364
210451
|
* @param targetU target point for the vectorU starting at the origin.
|
|
210365
210452
|
* @param targetV target point for the vectorV originating at the origin.
|
|
@@ -210372,7 +210459,8 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
|
|
|
210372
210459
|
static createXYPlane(result) {
|
|
210373
210460
|
return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(0, 0, 0, 1, 0, 0, 0, 1, 0, result);
|
|
210374
210461
|
}
|
|
210375
|
-
/**
|
|
210462
|
+
/**
|
|
210463
|
+
* Create a plane from data presented as Float64Arrays.
|
|
210376
210464
|
* @param origin x,y,z of origin.
|
|
210377
210465
|
* @param vectorU x,y,z of vectorU
|
|
210378
210466
|
* @param vectorV x,y,z of vectorV
|
|
@@ -210380,7 +210468,8 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
|
|
|
210380
210468
|
static createOriginAndVectorsArrays(origin, vectorU, vectorV, result) {
|
|
210381
210469
|
return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(origin[0], origin[1], origin[2], vectorU[0], vectorU[1], vectorU[2], vectorV[0], vectorV[1], vectorV[2], result);
|
|
210382
210470
|
}
|
|
210383
|
-
/**
|
|
210471
|
+
/**
|
|
210472
|
+
* Create a plane from data presented as Float64Array with weights
|
|
210384
210473
|
* @param origin x,y,z,w of origin.
|
|
210385
210474
|
* @param vectorU x,y,z,w of vectorU
|
|
210386
210475
|
* @param vectorV x,y,z,w of vectorV
|
|
@@ -210444,7 +210533,7 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
|
|
|
210444
210533
|
vectorV: this.vectorV.toJSON(),
|
|
210445
210534
|
};
|
|
210446
210535
|
}
|
|
210447
|
-
/**
|
|
210536
|
+
/** Create a new plane. See `setFromJSON` for layout example. */
|
|
210448
210537
|
static fromJSON(json) {
|
|
210449
210538
|
const result = Plane3dByOriginAndVectors.createXYPlane();
|
|
210450
210539
|
result.setFromJSON(json);
|
|
@@ -210456,7 +210545,8 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
|
|
|
210456
210545
|
&& this.vectorU.isAlmostEqual(other.vectorU)
|
|
210457
210546
|
&& this.vectorV.isAlmostEqual(other.vectorV);
|
|
210458
210547
|
}
|
|
210459
|
-
/**
|
|
210548
|
+
/**
|
|
210549
|
+
* Normalize both `vectorU` and `vectorV` in place. This does NOT make them perpendicular.
|
|
210460
210550
|
* * Return true if both succeeded.
|
|
210461
210551
|
*/
|
|
210462
210552
|
normalizeInPlace() {
|
|
@@ -210464,9 +210554,7 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
|
|
|
210464
210554
|
const okV = this.vectorV.normalizeInPlace();
|
|
210465
210555
|
return okU && okV;
|
|
210466
210556
|
}
|
|
210467
|
-
/**
|
|
210468
|
-
* Return (if possible) a unit normal to the plane.
|
|
210469
|
-
*/
|
|
210557
|
+
/** Return (if possible) a unit normal to the plane */
|
|
210470
210558
|
getUnitNormal(result) {
|
|
210471
210559
|
return this.vectorU.unitCrossProduct(this.vectorV, result);
|
|
210472
210560
|
}
|
|
@@ -210483,9 +210571,7 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
|
|
|
210483
210571
|
getAnyPointOnPlane(result) {
|
|
210484
210572
|
return this.origin.clone(result);
|
|
210485
210573
|
}
|
|
210486
|
-
/**
|
|
210487
|
-
* Return (if possible) a ray with origin at plane origin, direction as unit normal to the plane.
|
|
210488
|
-
*/
|
|
210574
|
+
/** Return (if possible) a ray with origin at plane origin, direction as unit normal to the plane */
|
|
210489
210575
|
unitNormalRay(result) {
|
|
210490
210576
|
if (!Plane3dByOriginAndVectors._workVector)
|
|
210491
210577
|
Plane3dByOriginAndVectors._workVector = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create();
|
|
@@ -210505,27 +210591,24 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
|
|
|
210505
210591
|
toRigidFrame(result) {
|
|
210506
210592
|
return _Transform__WEBPACK_IMPORTED_MODULE_5__.Transform.createRigidFromOriginAndColumns(this.origin, this.vectorU, this.vectorV, _Geometry__WEBPACK_IMPORTED_MODULE_3__.AxisOrder.XYZ, result);
|
|
210507
210593
|
}
|
|
210508
|
-
/**
|
|
210509
|
-
* Apply the transform to the origin and vectors in place.
|
|
210510
|
-
*/
|
|
210594
|
+
/** Apply the transform to the origin and vectors in place */
|
|
210511
210595
|
transformInPlace(transform) {
|
|
210512
210596
|
transform.multiplyPoint3d(this.origin, this.origin);
|
|
210513
210597
|
transform.multiplyVector(this.vectorU, this.vectorU);
|
|
210514
210598
|
transform.multiplyVector(this.vectorV, this.vectorV);
|
|
210515
210599
|
}
|
|
210516
|
-
// Implement PlaneAltitudeEvaluator methods . . .
|
|
210517
210600
|
/**
|
|
210518
210601
|
* Return x component of the (normalized!) {vectorU CROSS vectorV}.
|
|
210519
210602
|
* Return 0 if the cross product is zero.
|
|
210520
|
-
|
|
210603
|
+
*/
|
|
210521
210604
|
normalX() {
|
|
210522
210605
|
const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
|
|
210523
210606
|
return unitNormal !== undefined ? unitNormal.x : 0.0;
|
|
210524
210607
|
}
|
|
210525
210608
|
/**
|
|
210526
|
-
|
|
210527
|
-
|
|
210528
|
-
|
|
210609
|
+
* Return y component of the (normalized!) {vectorU CROSS vectorV}.
|
|
210610
|
+
* Return 0 if the cross product is zero.
|
|
210611
|
+
*/
|
|
210529
210612
|
normalY() {
|
|
210530
210613
|
const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
|
|
210531
210614
|
return unitNormal !== undefined ? unitNormal.y : 0.0;
|
|
@@ -210533,41 +210616,43 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
|
|
|
210533
210616
|
/**
|
|
210534
210617
|
* Return z component of the (normalized!) {vectorU CROSS vectorV}.
|
|
210535
210618
|
* Return 0 if the cross product is zero.
|
|
210536
|
-
|
|
210619
|
+
*/
|
|
210537
210620
|
normalZ() {
|
|
210538
210621
|
const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
|
|
210539
210622
|
return unitNormal !== undefined ? unitNormal.z : 0.0;
|
|
210540
210623
|
}
|
|
210541
|
-
/** Return signed cartesian altitude perpendicular to the plane.
|
|
210624
|
+
/** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */
|
|
210542
210625
|
altitude(xyz) {
|
|
210543
210626
|
const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
|
|
210544
210627
|
if (unitNormal === undefined)
|
|
210545
210628
|
return 0.0;
|
|
210546
210629
|
return _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYZXYZ((xyz.x - this.origin.x), (xyz.y - this.origin.y), (xyz.z - this.origin.z), unitNormal.x, unitNormal.y, unitNormal.z);
|
|
210547
210630
|
}
|
|
210548
|
-
/** Return signed cartesian altitude perpendicular to the plane.
|
|
210631
|
+
/** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */
|
|
210549
210632
|
altitudeXYZ(x, y, z) {
|
|
210550
210633
|
const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
|
|
210551
210634
|
if (unitNormal === undefined)
|
|
210552
210635
|
return 0.0;
|
|
210553
210636
|
return _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYZXYZ((x - this.origin.x), (y - this.origin.y), (z - this.origin.z), unitNormal.x, unitNormal.y, unitNormal.z);
|
|
210554
210637
|
}
|
|
210555
|
-
/** Return signed projection of the input vector to the plane normal.
|
|
210638
|
+
/** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */
|
|
210556
210639
|
velocity(xyzVector) {
|
|
210557
210640
|
const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
|
|
210558
210641
|
if (unitNormal === undefined)
|
|
210559
210642
|
return 0.0;
|
|
210560
210643
|
return _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYZXYZ(xyzVector.x, xyzVector.y, xyzVector.z, unitNormal.x, unitNormal.y, unitNormal.z);
|
|
210561
210644
|
}
|
|
210562
|
-
/** Return signed projection of the input vector to the plane normal.
|
|
210645
|
+
/** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */
|
|
210563
210646
|
velocityXYZ(x, y, z) {
|
|
210564
210647
|
const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
|
|
210565
210648
|
if (unitNormal === undefined)
|
|
210566
210649
|
return 0.0;
|
|
210567
210650
|
return _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYZXYZ(x, y, z, unitNormal.x, unitNormal.y, unitNormal.z);
|
|
210568
210651
|
}
|
|
210569
|
-
/**
|
|
210570
|
-
*
|
|
210652
|
+
/**
|
|
210653
|
+
* Return triple product of homogeneous difference {(xyzw - w * origin)} with vectorU and vectorV.
|
|
210654
|
+
* * In the usual manner of homogeneous calculations, this is proportional to true cartesian distance from the
|
|
210655
|
+
* plane but is not a physical distance.
|
|
210571
210656
|
*/
|
|
210572
210657
|
weightedAltitude(xyzw) {
|
|
210573
210658
|
const w = xyzw.w;
|
|
@@ -216737,7 +216822,7 @@ class Range3d extends RangeBase {
|
|
|
216737
216822
|
const coffs = transform.matrix.coffs;
|
|
216738
216823
|
this.extendXYZW(origin.x * w + coffs[0] * x + coffs[1] * y + coffs[2] * z, origin.y * w + coffs[3] * x + coffs[4] * y + coffs[5] * z, origin.z * w + coffs[6] * x + coffs[7] * y + coffs[8] * z, w);
|
|
216739
216824
|
}
|
|
216740
|
-
/** Multiply the point x,y,z by transform and use the coordinate to extend this range. */
|
|
216825
|
+
/** Multiply the point x,y,z by the inverse of the transform and use the coordinate to extend this range. */
|
|
216741
216826
|
extendInverseTransformedXYZ(transform, x, y, z) {
|
|
216742
216827
|
const origin = transform.origin;
|
|
216743
216828
|
if (!transform.matrix.computeCachedInverse(true))
|
|
@@ -276918,7 +277003,7 @@ class TestContext {
|
|
|
276918
277003
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
276919
277004
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
276920
277005
|
await core_frontend_1.NoRenderApp.startup({
|
|
276921
|
-
applicationVersion: "4.1.0-dev.
|
|
277006
|
+
applicationVersion: "4.1.0-dev.26",
|
|
276922
277007
|
applicationId: this.settings.gprid,
|
|
276923
277008
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
|
|
276924
277009
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -296292,7 +296377,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
|
|
|
296292
296377
|
/***/ ((module) => {
|
|
296293
296378
|
|
|
296294
296379
|
"use strict";
|
|
296295
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.1.0-dev.
|
|
296380
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.1.0-dev.26","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/**/*,**/primitives,**/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-eslintrc -c \\"./node_modules/@itwin/eslint-plugin/dist/configs/extension-exports-config.js\\" \\"./src/**/*.ts\\" 1>&2","lint":"eslint -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.1.0-dev.26","@itwin/core-bentley":"workspace:^4.1.0-dev.26","@itwin/core-common":"workspace:^4.1.0-dev.26","@itwin/core-geometry":"workspace:^4.1.0-dev.26","@itwin/core-orbitgt":"workspace:^4.1.0-dev.26","@itwin/core-quantity":"workspace:^4.1.0-dev.26"},"//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.0-dev.33","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^8.2.2","@types/node":"^18.11.5","@types/sinon":"^9.0.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^8.36.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~5.0.2","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/object-storage-azure":"^1.5.0","@itwin/cloud-agnostic-core":"^1.5.0","@itwin/object-storage-core":"^1.5.0","@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","wms-capabilities":"0.4.0","reflect-metadata":"0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
|
|
296296
296381
|
|
|
296297
296382
|
/***/ }),
|
|
296298
296383
|
|