@itwin/core-geometry 5.11.0-dev.8 → 5.12.0-dev.1
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/CHANGELOG.md +14 -1
- package/lib/cjs/curve/CurveFactory.d.ts +38 -7
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +45 -23
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.d.ts +1 -2
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +1 -2
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +3 -3
- package/lib/cjs/curve/RegionOps.js +3 -3
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.d.ts +1 -2
- package/lib/cjs/geometry3d/BilinearPatch.d.ts.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js +1 -2
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +29 -54
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +30 -55
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +2 -4
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +2 -4
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +38 -7
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +45 -23
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts +1 -2
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +1 -2
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +3 -3
- package/lib/esm/curve/RegionOps.js +3 -3
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.d.ts +1 -2
- package/lib/esm/geometry3d/BilinearPatch.d.ts.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js +1 -2
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +29 -54
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +30 -55
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +2 -4
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +2 -4
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/package.json +5 -5
|
@@ -16,15 +16,14 @@ const Point2dVector2d_1 = require("./Point2dVector2d");
|
|
|
16
16
|
const Point3dVector3d_1 = require("./Point3dVector3d");
|
|
17
17
|
const Transform_1 = require("./Transform");
|
|
18
18
|
/* eslint-disable @itwin/prefer-get */
|
|
19
|
-
// cSpell:words XXYZ YXYZ ZXYZ SaeedTorabi arctan
|
|
19
|
+
// cSpell:words XXYZ YXYZ ZXYZ SaeedTorabi arctan diagonalization
|
|
20
20
|
/**
|
|
21
21
|
* PackedMatrix3dOps contains static methods for matrix operations where the matrix is a Float64Array.
|
|
22
|
-
* * The Float64Array contains the matrix entries in row-major order
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* equation
|
|
26
|
-
* \newcommand[1]\mij{#1_{00}\ #1_{01}\ a_{02}}
|
|
22
|
+
* * The Float64Array contains the matrix entries in row-major order:
|
|
23
|
+
* ```equation
|
|
24
|
+
* \mij{a}
|
|
27
25
|
* ```
|
|
26
|
+
* @internal
|
|
28
27
|
*/
|
|
29
28
|
class PackedMatrix3dOps {
|
|
30
29
|
/**
|
|
@@ -173,13 +172,11 @@ var InverseMatrixState;
|
|
|
173
172
|
* * A very common use is to hold a rigid body rotation (which has no scaling or skew), but the 3x3 contents can
|
|
174
173
|
* also hold scaling and skewing.
|
|
175
174
|
* * The matrix with 2-dimensional layout (note: a 2d array can be shown by a matrix)
|
|
176
|
-
* ```
|
|
177
|
-
* equation
|
|
175
|
+
* ```equation
|
|
178
176
|
* \matrixXY{A}
|
|
179
177
|
* ```
|
|
180
178
|
* is stored as 9 numbers in "row-major" order in a `Float64Array`, viz
|
|
181
|
-
* ```
|
|
182
|
-
* equation
|
|
179
|
+
* ```equation
|
|
183
180
|
* \rowMajorMatrixXY{A}
|
|
184
181
|
* ```
|
|
185
182
|
* * If the matrix inverse is known it is stored in the inverseCoffs array.
|
|
@@ -203,8 +200,7 @@ class Matrix3d {
|
|
|
203
200
|
static numComputeCache = 0;
|
|
204
201
|
/**
|
|
205
202
|
* Matrix contents as a flat array of numbers in row-major order.
|
|
206
|
-
* ```
|
|
207
|
-
* equation
|
|
203
|
+
* ```equation
|
|
208
204
|
* \mxy{B}
|
|
209
205
|
* \mij{B}
|
|
210
206
|
* ```
|
|
@@ -213,8 +209,7 @@ class Matrix3d {
|
|
|
213
209
|
coffs;
|
|
214
210
|
/**
|
|
215
211
|
* Matrix inverse contents.
|
|
216
|
-
* ```
|
|
217
|
-
* equation
|
|
212
|
+
* ```equation
|
|
218
213
|
* \mxy{A}
|
|
219
214
|
* ```
|
|
220
215
|
* * DO NOT directly modify this array. It will destroy integrity of the cached inverse state.
|
|
@@ -384,8 +379,7 @@ class Matrix3d {
|
|
|
384
379
|
/**
|
|
385
380
|
* Returns a Matrix3d populated by numeric values given in row-major order.
|
|
386
381
|
* Sets all entries in the matrix from call parameters appearing in row-major order, i.e.
|
|
387
|
-
* ```
|
|
388
|
-
* equation
|
|
382
|
+
* ```equation
|
|
389
383
|
* \begin{bmatrix}a_{xx}\ a_{xy}\ a_{xz}\\ a_{yx}\ a_{yy}\ a_{yz}\\ a_{zx}\ a_{zy}\ a_{zz}\end{bmatrix}
|
|
390
384
|
* ```
|
|
391
385
|
* @param axx Row x, column x(0, 0) entry
|
|
@@ -564,8 +558,7 @@ class Matrix3d {
|
|
|
564
558
|
* * Note that for geometry transformations "all zeros" is not a useful default state.
|
|
565
559
|
* * Hence, almost always use `createIdentity` for graphics transformations.
|
|
566
560
|
* * "All zeros" is appropriate for summing moment data.
|
|
567
|
-
* ```
|
|
568
|
-
* equation
|
|
561
|
+
* ```equation
|
|
569
562
|
* \begin{bmatrix}0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0\end{bmatrix}
|
|
570
563
|
* ```
|
|
571
564
|
*/
|
|
@@ -579,8 +572,7 @@ class Matrix3d {
|
|
|
579
572
|
* * All diagonal entries (xx,yy,zz) are one
|
|
580
573
|
* * All others are zero.
|
|
581
574
|
* * This (rather than "all zeros") is the useful state for most graphics transformations.
|
|
582
|
-
* ```
|
|
583
|
-
* equation
|
|
575
|
+
* ```equation
|
|
584
576
|
* \begin{bmatrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1\end{bmatrix}
|
|
585
577
|
* ```
|
|
586
578
|
*
|
|
@@ -592,8 +584,7 @@ class Matrix3d {
|
|
|
592
584
|
}
|
|
593
585
|
/**
|
|
594
586
|
* Create a matrix with distinct x,y,z diagonal (scale) entries.
|
|
595
|
-
* ```
|
|
596
|
-
* equation
|
|
587
|
+
* ```equation
|
|
597
588
|
* \begin{bmatrix}s_x & 0 & 0 \\ 0 & s_y & 0\\ 0 & 0 & s_z\end{bmatrix}
|
|
598
589
|
* ```
|
|
599
590
|
*/
|
|
@@ -618,8 +609,7 @@ class Matrix3d {
|
|
|
618
609
|
}
|
|
619
610
|
/**
|
|
620
611
|
* Create a matrix with uniform scale factor "s":
|
|
621
|
-
* ```
|
|
622
|
-
* equation
|
|
612
|
+
* ```equation
|
|
623
613
|
* \begin{bmatrix}s & 0 & 0 \\ 0 & s & 0\\ 0 & 0 & s\end{bmatrix}
|
|
624
614
|
* ```
|
|
625
615
|
*/
|
|
@@ -799,8 +789,7 @@ class Matrix3d {
|
|
|
799
789
|
}
|
|
800
790
|
/**
|
|
801
791
|
* Create a matrix from column vectors.
|
|
802
|
-
* ```
|
|
803
|
-
* equation
|
|
792
|
+
* ```equation
|
|
804
793
|
* \begin{bmatrix}U_x & V_x & W_x \\ U_y & V_y & W_y \\ U_z & V_z & W_z \end{bmatrix}
|
|
805
794
|
* ```
|
|
806
795
|
*/
|
|
@@ -809,8 +798,7 @@ class Matrix3d {
|
|
|
809
798
|
}
|
|
810
799
|
/**
|
|
811
800
|
* Create a matrix with each column's _x,y_ parts given `XAndY` and separate numeric z values.
|
|
812
|
-
* ```
|
|
813
|
-
* equation
|
|
801
|
+
* ```equation
|
|
814
802
|
* \begin{bmatrix}U_x & V_x & W_x \\ U_y & V_y & W_y \\ u & v & w \end{bmatrix}
|
|
815
803
|
* ```
|
|
816
804
|
*/
|
|
@@ -1503,8 +1491,7 @@ class Matrix3d {
|
|
|
1503
1491
|
}
|
|
1504
1492
|
/**
|
|
1505
1493
|
* Create a matrix from row vectors.
|
|
1506
|
-
* ```
|
|
1507
|
-
* equation
|
|
1494
|
+
* ```equation
|
|
1508
1495
|
* \begin{bmatrix}U_x & U_y & U_z \\ V_x & V_y & V_z \\ W_x & W_y & W_z \end{bmatrix}
|
|
1509
1496
|
* ```
|
|
1510
1497
|
*/
|
|
@@ -1519,8 +1506,7 @@ class Matrix3d {
|
|
|
1519
1506
|
* mirror of the `vector` across the `plane`. In general, When scale != 0, the result is computed by first
|
|
1520
1507
|
* projecting the `vector` to the `plane`, then translating that projection along the `direction` (if scale > 0)
|
|
1521
1508
|
* or in opposite direction (if scale < 0).
|
|
1522
|
-
* ```
|
|
1523
|
-
* equation
|
|
1509
|
+
* ```equation
|
|
1524
1510
|
* \text{The matrix is } I + (s-1) D D^T
|
|
1525
1511
|
* \\ \text{with }D\text{ being the normalized direction vector and }s\text{ being the scale.}
|
|
1526
1512
|
* ```
|
|
@@ -1571,8 +1557,7 @@ class Matrix3d {
|
|
|
1571
1557
|
}
|
|
1572
1558
|
/**
|
|
1573
1559
|
* Multiply `matrix * point`, treating the point as a column vector on the right.
|
|
1574
|
-
* ```
|
|
1575
|
-
* equation
|
|
1560
|
+
* ```equation
|
|
1576
1561
|
* \matrixXY{A}\columnSubXYZ{U}
|
|
1577
1562
|
* ```
|
|
1578
1563
|
* @return the point result
|
|
@@ -1585,8 +1570,7 @@ class Matrix3d {
|
|
|
1585
1570
|
}
|
|
1586
1571
|
/**
|
|
1587
1572
|
* Multiply `matrix * vector`, treating the vector is a column vector on the right.
|
|
1588
|
-
* ```
|
|
1589
|
-
* equation
|
|
1573
|
+
* ```equation
|
|
1590
1574
|
* \matrixXY{A}\columnSubXYZ{U}
|
|
1591
1575
|
* ```
|
|
1592
1576
|
* @return the vector result
|
|
@@ -1642,8 +1626,7 @@ class Matrix3d {
|
|
|
1642
1626
|
/**
|
|
1643
1627
|
* Treat the 3x3 matrix and origin as upper 3x4 part of a 4x4 matrix, with 0001 as the final row.
|
|
1644
1628
|
* Multiply the 4x4 matrix by `[x,y,z,w]`
|
|
1645
|
-
* ```
|
|
1646
|
-
* equation
|
|
1629
|
+
* ```equation
|
|
1647
1630
|
* \begin{bmatrix}M_0 & M_1 & M_2 & Ox \\ M_3 & M_4 & M_5 & Oy \\ M_6 & M_7 & M_8 & Oz \\ 0 & 0 & 0 & 1\end{bmatrix} * \begin{bmatrix}x \\ y \\ z \\ w\end{bmatrix}
|
|
1648
1631
|
* ```
|
|
1649
1632
|
* @param origin translation part (xyz in column 3)
|
|
@@ -1660,8 +1643,7 @@ class Matrix3d {
|
|
|
1660
1643
|
/**
|
|
1661
1644
|
* Treat the 3x3 matrix and origin as upper 3x4 part of a 4x4 matrix, with 0001 as the final row.
|
|
1662
1645
|
* Multiply the 4x4 matrix by `[x,y,z,w]`
|
|
1663
|
-
* ```
|
|
1664
|
-
* equation
|
|
1646
|
+
* ```equation
|
|
1665
1647
|
* \begin{bmatrix}M_0 & M_1 & M_2 & Ox \\ M_3 & M_4 & M_5 & Oy \\ M_6 & M_7 & M_8 & Oz \\ 0 & 0 & 0 & 1\end{bmatrix} * \begin{bmatrix}x \\ y \\ z \\ w\end{bmatrix}
|
|
1666
1648
|
* ```
|
|
1667
1649
|
* @param origin translation part (xyz in column 3)
|
|
@@ -1684,8 +1666,7 @@ class Matrix3d {
|
|
|
1684
1666
|
/**
|
|
1685
1667
|
* Treat the 3x3 matrix and origin as a 3x4 matrix.
|
|
1686
1668
|
* * Multiply the 3x4 matrix by `[x,y,z,1]`
|
|
1687
|
-
* ```
|
|
1688
|
-
* equation
|
|
1669
|
+
* ```equation
|
|
1689
1670
|
* \begin{bmatrix}M_0 & M_1 & M_2 & Ox \\ M_3 & M_4 & M_5 & Oy \\ M_6 & M_7 & M_8 & Oz\end{bmatrix} * \begin{bmatrix}x \\ y \\ z \\ 1\end{bmatrix}
|
|
1690
1671
|
* ```
|
|
1691
1672
|
* @param origin translation part (xyz in column 3)
|
|
@@ -1706,8 +1687,7 @@ class Matrix3d {
|
|
|
1706
1687
|
/**
|
|
1707
1688
|
* Multiply the transpose matrix times a vector.
|
|
1708
1689
|
* * This produces the same x,y,z as treating the vector as a row on the left of the (un-transposed) matrix.
|
|
1709
|
-
* ```
|
|
1710
|
-
* equation
|
|
1690
|
+
* ```equation
|
|
1711
1691
|
* \begin{matrix}
|
|
1712
1692
|
* \text{Treating U as a column to the right of transposed matrix\: return column}&\columnSubXYZ{V}&=&\matrixTransposeSubXY{A}\columnSubXYZ{U} \\
|
|
1713
1693
|
* \text{Treating U as a row to the left of untransposed matrix\: return row}&\rowSubXYZ{V}&=&\rowSubXYZ{U}\matrixXY{A}
|
|
@@ -1798,14 +1778,13 @@ class Matrix3d {
|
|
|
1798
1778
|
/**
|
|
1799
1779
|
* Multiply the transpose matrix times column using individual numeric inputs.
|
|
1800
1780
|
* * This produces the same x,y,z as treating the vector as a row on the left of the (un-transposed) matrix.
|
|
1801
|
-
* ```
|
|
1802
|
-
* equation
|
|
1781
|
+
* ```equation
|
|
1803
1782
|
* \begin{matrix}
|
|
1804
1783
|
* \text{treating the input as a column vector } \columnXYZ{x}{y}{z}\text{ compute }&\columnSubXYZ{V} &= &A^T \columnXYZ{x}{y}{z} \\
|
|
1805
1784
|
* \text{or as a row vector } \rowXYZ{x}{y}{z} \text{ compute }&\rowSubXYZ{V} &= &\rowXYZ{x}{y}{z} A \\
|
|
1806
1785
|
* \phantom{8888}\text{and return V as a Vector3d} & & &
|
|
1807
1786
|
* \end{matrix}
|
|
1808
|
-
*
|
|
1787
|
+
* ```
|
|
1809
1788
|
* @param result the vector result (optional)
|
|
1810
1789
|
*/
|
|
1811
1790
|
multiplyTransposeXYZ(x, y, z, result) {
|
|
@@ -1968,8 +1947,7 @@ class Matrix3d {
|
|
|
1968
1947
|
}
|
|
1969
1948
|
/**
|
|
1970
1949
|
* Multiply `this` matrix times the transpose of `other` matrix
|
|
1971
|
-
* ```
|
|
1972
|
-
* equation
|
|
1950
|
+
* ```equation
|
|
1973
1951
|
* \text{for instance matrix }A\text{ and matrix }B\text{ return matrix }C{\text where }\\\matrixXY{C}=\matrixXY{A}\matrixTransposeSubXY{B}
|
|
1974
1952
|
* ```
|
|
1975
1953
|
* @return the matrix result: this*otherTranspose
|
|
@@ -1987,8 +1965,7 @@ class Matrix3d {
|
|
|
1987
1965
|
}
|
|
1988
1966
|
/**
|
|
1989
1967
|
* Multiply the transpose of `this` matrix times `other` matrix
|
|
1990
|
-
* ```
|
|
1991
|
-
* equation
|
|
1968
|
+
* ```equation
|
|
1992
1969
|
* \matrixXY{result}=\matrixXY{\text{this}}\matrixTransposeSubXY{\text{other}}
|
|
1993
1970
|
* ```
|
|
1994
1971
|
* @return the matrix result: thisTranspose*other
|
|
@@ -2007,8 +1984,7 @@ class Matrix3d {
|
|
|
2007
1984
|
/**
|
|
2008
1985
|
* Multiply `this` Matrix3d (considered to be a Transform with 0 `origin`) times `other` Transform.
|
|
2009
1986
|
* * **Note:** If `this = [A 0]` and `other = [B b]`, then `this * other` is defined as [A*B Ab] because:
|
|
2010
|
-
* ```
|
|
2011
|
-
* equation
|
|
1987
|
+
* ```equation
|
|
2012
1988
|
* \begin{matrix}
|
|
2013
1989
|
* \text{this matrix }\bold{A}\text{ promoted to block Transform} & \blockTransform{A}{0} \\
|
|
2014
1990
|
* \text{other Transform with `matrix` part }\bold{B}\text{ and origin part }\bold{b} & \blockTransform{B}{b}\\
|
|
@@ -2389,8 +2365,7 @@ class Matrix3d {
|
|
|
2389
2365
|
* Add scaled values from an outer product of vectors U and V.
|
|
2390
2366
|
* * The scaled outer product is a matrix with `rank 1` (all columns/rows are linearly dependent).
|
|
2391
2367
|
* * This is useful in constructing mirrors and directional scales.
|
|
2392
|
-
* ```
|
|
2393
|
-
* equation
|
|
2368
|
+
* ```equation
|
|
2394
2369
|
* A += s \columnSubXYZ{U}\rowSubXYZ{V}
|
|
2395
2370
|
* \\ \matrixXY{A} += s \begin{bmatrix}
|
|
2396
2371
|
* U_x * V_x & U_x * V_y & U_x * V_z \\
|