@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
|
@@ -13,15 +13,14 @@ import { Point2d } from "./Point2dVector2d";
|
|
|
13
13
|
import { Point3d, Vector3d } from "./Point3dVector3d";
|
|
14
14
|
import { Transform } from "./Transform";
|
|
15
15
|
/* eslint-disable @itwin/prefer-get */
|
|
16
|
-
// cSpell:words XXYZ YXYZ ZXYZ SaeedTorabi arctan
|
|
16
|
+
// cSpell:words XXYZ YXYZ ZXYZ SaeedTorabi arctan diagonalization
|
|
17
17
|
/**
|
|
18
18
|
* PackedMatrix3dOps contains static methods for matrix operations where the matrix is a Float64Array.
|
|
19
|
-
* * The Float64Array contains the matrix entries in row-major order
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* equation
|
|
23
|
-
* \newcommand[1]\mij{#1_{00}\ #1_{01}\ a_{02}}
|
|
19
|
+
* * The Float64Array contains the matrix entries in row-major order:
|
|
20
|
+
* ```equation
|
|
21
|
+
* \mij{a}
|
|
24
22
|
* ```
|
|
23
|
+
* @internal
|
|
25
24
|
*/
|
|
26
25
|
export class PackedMatrix3dOps {
|
|
27
26
|
/**
|
|
@@ -169,13 +168,11 @@ export var InverseMatrixState;
|
|
|
169
168
|
* * A very common use is to hold a rigid body rotation (which has no scaling or skew), but the 3x3 contents can
|
|
170
169
|
* also hold scaling and skewing.
|
|
171
170
|
* * The matrix with 2-dimensional layout (note: a 2d array can be shown by a matrix)
|
|
172
|
-
* ```
|
|
173
|
-
* equation
|
|
171
|
+
* ```equation
|
|
174
172
|
* \matrixXY{A}
|
|
175
173
|
* ```
|
|
176
174
|
* is stored as 9 numbers in "row-major" order in a `Float64Array`, viz
|
|
177
|
-
* ```
|
|
178
|
-
* equation
|
|
175
|
+
* ```equation
|
|
179
176
|
* \rowMajorMatrixXY{A}
|
|
180
177
|
* ```
|
|
181
178
|
* * If the matrix inverse is known it is stored in the inverseCoffs array.
|
|
@@ -199,8 +196,7 @@ export class Matrix3d {
|
|
|
199
196
|
static numComputeCache = 0;
|
|
200
197
|
/**
|
|
201
198
|
* Matrix contents as a flat array of numbers in row-major order.
|
|
202
|
-
* ```
|
|
203
|
-
* equation
|
|
199
|
+
* ```equation
|
|
204
200
|
* \mxy{B}
|
|
205
201
|
* \mij{B}
|
|
206
202
|
* ```
|
|
@@ -209,8 +205,7 @@ export class Matrix3d {
|
|
|
209
205
|
coffs;
|
|
210
206
|
/**
|
|
211
207
|
* Matrix inverse contents.
|
|
212
|
-
* ```
|
|
213
|
-
* equation
|
|
208
|
+
* ```equation
|
|
214
209
|
* \mxy{A}
|
|
215
210
|
* ```
|
|
216
211
|
* * DO NOT directly modify this array. It will destroy integrity of the cached inverse state.
|
|
@@ -380,8 +375,7 @@ export class Matrix3d {
|
|
|
380
375
|
/**
|
|
381
376
|
* Returns a Matrix3d populated by numeric values given in row-major order.
|
|
382
377
|
* Sets all entries in the matrix from call parameters appearing in row-major order, i.e.
|
|
383
|
-
* ```
|
|
384
|
-
* equation
|
|
378
|
+
* ```equation
|
|
385
379
|
* \begin{bmatrix}a_{xx}\ a_{xy}\ a_{xz}\\ a_{yx}\ a_{yy}\ a_{yz}\\ a_{zx}\ a_{zy}\ a_{zz}\end{bmatrix}
|
|
386
380
|
* ```
|
|
387
381
|
* @param axx Row x, column x(0, 0) entry
|
|
@@ -560,8 +554,7 @@ export class Matrix3d {
|
|
|
560
554
|
* * Note that for geometry transformations "all zeros" is not a useful default state.
|
|
561
555
|
* * Hence, almost always use `createIdentity` for graphics transformations.
|
|
562
556
|
* * "All zeros" is appropriate for summing moment data.
|
|
563
|
-
* ```
|
|
564
|
-
* equation
|
|
557
|
+
* ```equation
|
|
565
558
|
* \begin{bmatrix}0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0\end{bmatrix}
|
|
566
559
|
* ```
|
|
567
560
|
*/
|
|
@@ -575,8 +568,7 @@ export class Matrix3d {
|
|
|
575
568
|
* * All diagonal entries (xx,yy,zz) are one
|
|
576
569
|
* * All others are zero.
|
|
577
570
|
* * This (rather than "all zeros") is the useful state for most graphics transformations.
|
|
578
|
-
* ```
|
|
579
|
-
* equation
|
|
571
|
+
* ```equation
|
|
580
572
|
* \begin{bmatrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1\end{bmatrix}
|
|
581
573
|
* ```
|
|
582
574
|
*
|
|
@@ -588,8 +580,7 @@ export class Matrix3d {
|
|
|
588
580
|
}
|
|
589
581
|
/**
|
|
590
582
|
* Create a matrix with distinct x,y,z diagonal (scale) entries.
|
|
591
|
-
* ```
|
|
592
|
-
* equation
|
|
583
|
+
* ```equation
|
|
593
584
|
* \begin{bmatrix}s_x & 0 & 0 \\ 0 & s_y & 0\\ 0 & 0 & s_z\end{bmatrix}
|
|
594
585
|
* ```
|
|
595
586
|
*/
|
|
@@ -614,8 +605,7 @@ export class Matrix3d {
|
|
|
614
605
|
}
|
|
615
606
|
/**
|
|
616
607
|
* Create a matrix with uniform scale factor "s":
|
|
617
|
-
* ```
|
|
618
|
-
* equation
|
|
608
|
+
* ```equation
|
|
619
609
|
* \begin{bmatrix}s & 0 & 0 \\ 0 & s & 0\\ 0 & 0 & s\end{bmatrix}
|
|
620
610
|
* ```
|
|
621
611
|
*/
|
|
@@ -795,8 +785,7 @@ export class Matrix3d {
|
|
|
795
785
|
}
|
|
796
786
|
/**
|
|
797
787
|
* Create a matrix from column vectors.
|
|
798
|
-
* ```
|
|
799
|
-
* equation
|
|
788
|
+
* ```equation
|
|
800
789
|
* \begin{bmatrix}U_x & V_x & W_x \\ U_y & V_y & W_y \\ U_z & V_z & W_z \end{bmatrix}
|
|
801
790
|
* ```
|
|
802
791
|
*/
|
|
@@ -805,8 +794,7 @@ export class Matrix3d {
|
|
|
805
794
|
}
|
|
806
795
|
/**
|
|
807
796
|
* Create a matrix with each column's _x,y_ parts given `XAndY` and separate numeric z values.
|
|
808
|
-
* ```
|
|
809
|
-
* equation
|
|
797
|
+
* ```equation
|
|
810
798
|
* \begin{bmatrix}U_x & V_x & W_x \\ U_y & V_y & W_y \\ u & v & w \end{bmatrix}
|
|
811
799
|
* ```
|
|
812
800
|
*/
|
|
@@ -1499,8 +1487,7 @@ export class Matrix3d {
|
|
|
1499
1487
|
}
|
|
1500
1488
|
/**
|
|
1501
1489
|
* Create a matrix from row vectors.
|
|
1502
|
-
* ```
|
|
1503
|
-
* equation
|
|
1490
|
+
* ```equation
|
|
1504
1491
|
* \begin{bmatrix}U_x & U_y & U_z \\ V_x & V_y & V_z \\ W_x & W_y & W_z \end{bmatrix}
|
|
1505
1492
|
* ```
|
|
1506
1493
|
*/
|
|
@@ -1515,8 +1502,7 @@ export class Matrix3d {
|
|
|
1515
1502
|
* mirror of the `vector` across the `plane`. In general, When scale != 0, the result is computed by first
|
|
1516
1503
|
* projecting the `vector` to the `plane`, then translating that projection along the `direction` (if scale > 0)
|
|
1517
1504
|
* or in opposite direction (if scale < 0).
|
|
1518
|
-
* ```
|
|
1519
|
-
* equation
|
|
1505
|
+
* ```equation
|
|
1520
1506
|
* \text{The matrix is } I + (s-1) D D^T
|
|
1521
1507
|
* \\ \text{with }D\text{ being the normalized direction vector and }s\text{ being the scale.}
|
|
1522
1508
|
* ```
|
|
@@ -1567,8 +1553,7 @@ export class Matrix3d {
|
|
|
1567
1553
|
}
|
|
1568
1554
|
/**
|
|
1569
1555
|
* Multiply `matrix * point`, treating the point as a column vector on the right.
|
|
1570
|
-
* ```
|
|
1571
|
-
* equation
|
|
1556
|
+
* ```equation
|
|
1572
1557
|
* \matrixXY{A}\columnSubXYZ{U}
|
|
1573
1558
|
* ```
|
|
1574
1559
|
* @return the point result
|
|
@@ -1581,8 +1566,7 @@ export class Matrix3d {
|
|
|
1581
1566
|
}
|
|
1582
1567
|
/**
|
|
1583
1568
|
* Multiply `matrix * vector`, treating the vector is a column vector on the right.
|
|
1584
|
-
* ```
|
|
1585
|
-
* equation
|
|
1569
|
+
* ```equation
|
|
1586
1570
|
* \matrixXY{A}\columnSubXYZ{U}
|
|
1587
1571
|
* ```
|
|
1588
1572
|
* @return the vector result
|
|
@@ -1638,8 +1622,7 @@ export class Matrix3d {
|
|
|
1638
1622
|
/**
|
|
1639
1623
|
* Treat the 3x3 matrix and origin as upper 3x4 part of a 4x4 matrix, with 0001 as the final row.
|
|
1640
1624
|
* Multiply the 4x4 matrix by `[x,y,z,w]`
|
|
1641
|
-
* ```
|
|
1642
|
-
* equation
|
|
1625
|
+
* ```equation
|
|
1643
1626
|
* \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}
|
|
1644
1627
|
* ```
|
|
1645
1628
|
* @param origin translation part (xyz in column 3)
|
|
@@ -1656,8 +1639,7 @@ export class Matrix3d {
|
|
|
1656
1639
|
/**
|
|
1657
1640
|
* Treat the 3x3 matrix and origin as upper 3x4 part of a 4x4 matrix, with 0001 as the final row.
|
|
1658
1641
|
* Multiply the 4x4 matrix by `[x,y,z,w]`
|
|
1659
|
-
* ```
|
|
1660
|
-
* equation
|
|
1642
|
+
* ```equation
|
|
1661
1643
|
* \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}
|
|
1662
1644
|
* ```
|
|
1663
1645
|
* @param origin translation part (xyz in column 3)
|
|
@@ -1680,8 +1662,7 @@ export class Matrix3d {
|
|
|
1680
1662
|
/**
|
|
1681
1663
|
* Treat the 3x3 matrix and origin as a 3x4 matrix.
|
|
1682
1664
|
* * Multiply the 3x4 matrix by `[x,y,z,1]`
|
|
1683
|
-
* ```
|
|
1684
|
-
* equation
|
|
1665
|
+
* ```equation
|
|
1685
1666
|
* \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}
|
|
1686
1667
|
* ```
|
|
1687
1668
|
* @param origin translation part (xyz in column 3)
|
|
@@ -1702,8 +1683,7 @@ export class Matrix3d {
|
|
|
1702
1683
|
/**
|
|
1703
1684
|
* Multiply the transpose matrix times a vector.
|
|
1704
1685
|
* * This produces the same x,y,z as treating the vector as a row on the left of the (un-transposed) matrix.
|
|
1705
|
-
* ```
|
|
1706
|
-
* equation
|
|
1686
|
+
* ```equation
|
|
1707
1687
|
* \begin{matrix}
|
|
1708
1688
|
* \text{Treating U as a column to the right of transposed matrix\: return column}&\columnSubXYZ{V}&=&\matrixTransposeSubXY{A}\columnSubXYZ{U} \\
|
|
1709
1689
|
* \text{Treating U as a row to the left of untransposed matrix\: return row}&\rowSubXYZ{V}&=&\rowSubXYZ{U}\matrixXY{A}
|
|
@@ -1794,14 +1774,13 @@ export class Matrix3d {
|
|
|
1794
1774
|
/**
|
|
1795
1775
|
* Multiply the transpose matrix times column using individual numeric inputs.
|
|
1796
1776
|
* * This produces the same x,y,z as treating the vector as a row on the left of the (un-transposed) matrix.
|
|
1797
|
-
* ```
|
|
1798
|
-
* equation
|
|
1777
|
+
* ```equation
|
|
1799
1778
|
* \begin{matrix}
|
|
1800
1779
|
* \text{treating the input as a column vector } \columnXYZ{x}{y}{z}\text{ compute }&\columnSubXYZ{V} &= &A^T \columnXYZ{x}{y}{z} \\
|
|
1801
1780
|
* \text{or as a row vector } \rowXYZ{x}{y}{z} \text{ compute }&\rowSubXYZ{V} &= &\rowXYZ{x}{y}{z} A \\
|
|
1802
1781
|
* \phantom{8888}\text{and return V as a Vector3d} & & &
|
|
1803
1782
|
* \end{matrix}
|
|
1804
|
-
*
|
|
1783
|
+
* ```
|
|
1805
1784
|
* @param result the vector result (optional)
|
|
1806
1785
|
*/
|
|
1807
1786
|
multiplyTransposeXYZ(x, y, z, result) {
|
|
@@ -1964,8 +1943,7 @@ export class Matrix3d {
|
|
|
1964
1943
|
}
|
|
1965
1944
|
/**
|
|
1966
1945
|
* Multiply `this` matrix times the transpose of `other` matrix
|
|
1967
|
-
* ```
|
|
1968
|
-
* equation
|
|
1946
|
+
* ```equation
|
|
1969
1947
|
* \text{for instance matrix }A\text{ and matrix }B\text{ return matrix }C{\text where }\\\matrixXY{C}=\matrixXY{A}\matrixTransposeSubXY{B}
|
|
1970
1948
|
* ```
|
|
1971
1949
|
* @return the matrix result: this*otherTranspose
|
|
@@ -1983,8 +1961,7 @@ export class Matrix3d {
|
|
|
1983
1961
|
}
|
|
1984
1962
|
/**
|
|
1985
1963
|
* Multiply the transpose of `this` matrix times `other` matrix
|
|
1986
|
-
* ```
|
|
1987
|
-
* equation
|
|
1964
|
+
* ```equation
|
|
1988
1965
|
* \matrixXY{result}=\matrixXY{\text{this}}\matrixTransposeSubXY{\text{other}}
|
|
1989
1966
|
* ```
|
|
1990
1967
|
* @return the matrix result: thisTranspose*other
|
|
@@ -2003,8 +1980,7 @@ export class Matrix3d {
|
|
|
2003
1980
|
/**
|
|
2004
1981
|
* Multiply `this` Matrix3d (considered to be a Transform with 0 `origin`) times `other` Transform.
|
|
2005
1982
|
* * **Note:** If `this = [A 0]` and `other = [B b]`, then `this * other` is defined as [A*B Ab] because:
|
|
2006
|
-
* ```
|
|
2007
|
-
* equation
|
|
1983
|
+
* ```equation
|
|
2008
1984
|
* \begin{matrix}
|
|
2009
1985
|
* \text{this matrix }\bold{A}\text{ promoted to block Transform} & \blockTransform{A}{0} \\
|
|
2010
1986
|
* \text{other Transform with `matrix` part }\bold{B}\text{ and origin part }\bold{b} & \blockTransform{B}{b}\\
|
|
@@ -2385,8 +2361,7 @@ export class Matrix3d {
|
|
|
2385
2361
|
* Add scaled values from an outer product of vectors U and V.
|
|
2386
2362
|
* * The scaled outer product is a matrix with `rank 1` (all columns/rows are linearly dependent).
|
|
2387
2363
|
* * This is useful in constructing mirrors and directional scales.
|
|
2388
|
-
* ```
|
|
2389
|
-
* equation
|
|
2364
|
+
* ```equation
|
|
2390
2365
|
* A += s \columnSubXYZ{U}\rowSubXYZ{V}
|
|
2391
2366
|
* \\ \matrixXY{A} += s \begin{bmatrix}
|
|
2392
2367
|
* U_x * V_x & U_x * V_y & U_x * V_z \\
|