@itwin/core-geometry 4.0.0-dev.46 → 4.0.0-dev.50
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/cjs/clipping/ClipPrimitive.d.ts +0 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +0 -1
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.d.ts +19 -5
- package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +32 -5
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.d.ts +2 -5
- package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurve.js +2 -5
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.js +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.js +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +17 -4
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +18 -6
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +0 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +0 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +159 -107
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +238 -137
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.d.ts +22 -21
- package/lib/cjs/geometry3d/XYZProps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.js +2 -1
- package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +7 -5
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +17 -7
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts +0 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +0 -1
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.d.ts +19 -5
- package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +32 -5
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/curve/CurveCurve.d.ts +2 -5
- package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurve.js +2 -5
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXY.js +1 -1
- package/lib/esm/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.js +1 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +17 -4
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +18 -6
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +0 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +0 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +159 -107
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +238 -137
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/XYZProps.d.ts +22 -21
- package/lib/esm/geometry3d/XYZProps.d.ts.map +1 -1
- package/lib/esm/geometry3d/XYZProps.js +2 -1
- package/lib/esm/geometry3d/XYZProps.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +7 -5
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +17 -7
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/package.json +3 -3
|
@@ -8,16 +8,17 @@ import { Point2d } from "./Point2dVector2d";
|
|
|
8
8
|
import { Point3d, Vector3d, XYZ } from "./Point3dVector3d";
|
|
9
9
|
import { Range3d } from "./Range";
|
|
10
10
|
import { TransformProps, XAndY, XYAndZ } from "./XYZProps";
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* take care of determining
|
|
11
|
+
/**
|
|
12
|
+
* A Transform consists of an origin and a Matrix3d. This describes a coordinate frame with this origin, with
|
|
13
|
+
* the columns of the Matrix3d being the local x,y,z axis directions.
|
|
14
|
+
* * The math for a Transform `T` consisting of a Matrix3d `M` and a Point3d `o` on a Vector3d `p` is: `Tp = M*p + o`.
|
|
15
|
+
* In other words, `T` is a combination of two operations on `p`: the action of matrix multiplication, followed by a
|
|
16
|
+
* translation. `Origin` is a traditional term for `o`, because `T` can be interpreted as a change of basis from the
|
|
17
|
+
* global axes centered at the global origin, to a new set of axes centered at `o`.
|
|
18
|
+
* * Beware that for common transformations (e.g. scale about point, rotate around an axis, mirror across a
|
|
19
|
+
* plane) the "fixed point" that is used when describing the transform is NOT the "origin" stored in the
|
|
20
|
+
* transform. Setup methods (e.g createFixedPointAndMatrix, createScaleAboutPoint) take care of determining
|
|
21
|
+
* the appropriate origin coordinates.
|
|
21
22
|
* @public
|
|
22
23
|
*/
|
|
23
24
|
export declare class Transform implements BeJSONFunctions {
|
|
@@ -37,135 +38,183 @@ export declare class Transform implements BeJSONFunctions {
|
|
|
37
38
|
setFrom(other: Transform): void;
|
|
38
39
|
/** Set this Transform to be an identity. */
|
|
39
40
|
setIdentity(): void;
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
41
|
+
/**
|
|
42
|
+
* Set this Transform instance from flexible inputs:
|
|
43
|
+
* * Any object (such as another Transform or TransformProps) that has `origin` and `matrix` members
|
|
44
|
+
* accepted by `Point3d.setFromJSON` and `Matrix3d.setFromJSON`
|
|
42
45
|
* * An array of 3 number arrays, each with 4 entries which are rows in a 3x4 matrix.
|
|
43
46
|
* * An array of 12 numbers, each block of 4 entries as a row 3x4 matrix.
|
|
47
|
+
* * If no input is provided, the identity Transform is returned.
|
|
44
48
|
*/
|
|
45
49
|
setFromJSON(json?: TransformProps | Transform): void;
|
|
46
50
|
/**
|
|
47
|
-
* Test for near equality with other Transform.
|
|
48
|
-
*
|
|
51
|
+
* Test for near equality with `other` Transform. Comparison uses the `isAlmostEqual` methods on the `origin` and
|
|
52
|
+
* `matrix` parts.
|
|
49
53
|
* @param other Transform to compare to.
|
|
50
54
|
*/
|
|
51
55
|
isAlmostEqual(other: Readonly<Transform>): boolean;
|
|
52
56
|
/**
|
|
53
|
-
* Test for near equality with other Transform.
|
|
54
|
-
* the
|
|
57
|
+
* Test for near equality with `other` Transform. Comparison uses the `isAlmostEqual` methods on the `origin` part
|
|
58
|
+
* and the `isAlmostEqualAllowZRotation` method on the `matrix` part.
|
|
55
59
|
* @param other Transform to compare to.
|
|
56
60
|
*/
|
|
57
61
|
isAlmostEqualAllowZRotation(other: Transform): boolean;
|
|
58
|
-
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
toJSON(): TransformProps;
|
|
62
|
-
/** Return a 3 by 4 matrix containing the rows of this Transform
|
|
63
|
-
* * This transform's origin is the [3] entry of the json arrays
|
|
62
|
+
/**
|
|
63
|
+
* Return a 3 by 4 matrix containing the rows of this Transform.
|
|
64
|
+
* * The transform's origin coordinates are the last entries of the 3 json arrays
|
|
64
65
|
*/
|
|
65
66
|
toRows(): number[][];
|
|
66
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Return a 3 by 4 matrix containing the rows of this Transform.
|
|
69
|
+
* * The transform's origin coordinates are the last entries of the 3 json arrays
|
|
70
|
+
*/
|
|
71
|
+
toJSON(): TransformProps;
|
|
72
|
+
/** Return a new Transform initialized by `Transform.setFromJSON` */
|
|
67
73
|
static fromJSON(json?: TransformProps): Transform;
|
|
68
|
-
/** Copy the contents of this transform into a new Transform (or to the result, if specified). */
|
|
74
|
+
/** Copy the contents of `this` transform into a new Transform (or to the result, if specified). */
|
|
69
75
|
clone(result?: Transform): Transform;
|
|
70
|
-
/**
|
|
71
|
-
*
|
|
72
|
-
* *
|
|
73
|
-
* * The third named column is the cross product of the first and second.
|
|
76
|
+
/**
|
|
77
|
+
* Return a modified copy of `this` Transform so that its `matrix` part is rigid (`origin` part is untouched).
|
|
78
|
+
* * For details of how the matrix is modified to rigid, see documentation of `Matrix3d.axisOrderCrossProductsInPlace`
|
|
74
79
|
*/
|
|
75
80
|
cloneRigid(axisOrder?: AxisOrder): Transform | undefined;
|
|
76
|
-
/** Create a
|
|
81
|
+
/** Create a Transform with the given `origin` and `matrix`. */
|
|
77
82
|
static createRefs(origin: XYZ | undefined, matrix: Matrix3d, result?: Transform): Transform;
|
|
78
|
-
/** Create a
|
|
83
|
+
/** Create a Transform with complete contents given */
|
|
79
84
|
static createRowValues(qxx: number, qxy: number, qxz: number, ax: number, qyx: number, qyy: number, qyz: number, ay: number, qzx: number, qzy: number, qzz: number, az: number, result?: Transform): Transform;
|
|
80
|
-
/** Create a
|
|
81
|
-
*/
|
|
85
|
+
/** Create a Transform with all zeros */
|
|
82
86
|
static createZero(result?: Transform): Transform;
|
|
83
87
|
/**
|
|
84
|
-
*
|
|
88
|
+
* Create a Transform with translation provided by x,y,z parts.
|
|
85
89
|
* @param x x part of translation
|
|
86
90
|
* @param y y part of translation
|
|
87
91
|
* @param z z part of translation
|
|
88
|
-
* @param result optional
|
|
89
|
-
* @returns new or updated transform
|
|
92
|
+
* @param result optional pre-allocated Transform
|
|
93
|
+
* @returns new or updated transform
|
|
90
94
|
*/
|
|
91
95
|
static createTranslationXYZ(x?: number, y?: number, z?: number, result?: Transform): Transform;
|
|
92
|
-
/**
|
|
93
|
-
*
|
|
94
|
-
* @
|
|
96
|
+
/**
|
|
97
|
+
* Create a Transform with specified `translation` part.
|
|
98
|
+
* @param translation x,y,z parts of the translation
|
|
99
|
+
* @param result optional pre-allocated Transform
|
|
100
|
+
* @returns new or updated transform
|
|
95
101
|
*/
|
|
96
102
|
static createTranslation(translation: XYZ, result?: Transform): Transform;
|
|
97
|
-
/** Return a reference to the matrix
|
|
103
|
+
/** Return a reference (and NOT a copy) to the `matrix` part of the Transform. */
|
|
98
104
|
get matrix(): Matrix3d;
|
|
99
|
-
/** Return a reference to the origin
|
|
105
|
+
/** Return a reference (and NOT a copy) to the `origin` part of the Transform. */
|
|
100
106
|
get origin(): XYZ;
|
|
101
|
-
/** return a (clone of) the origin part of the
|
|
107
|
+
/** return a (clone of) the `origin` part of the Transform, as a `Point3d` */
|
|
102
108
|
getOrigin(): Point3d;
|
|
103
|
-
/** return a (clone of) the origin part of the
|
|
109
|
+
/** return a (clone of) the `origin` part of the Transform, as a `Vector3d` */
|
|
104
110
|
getTranslation(): Vector3d;
|
|
105
|
-
/**
|
|
111
|
+
/** return a (clone of) the `matrix` part of the Transform, as a `Matrix3d` */
|
|
112
|
+
getMatrix(): Matrix3d;
|
|
113
|
+
/** test if the transform has `origin` = (0,0,0) and identity `matrix` */
|
|
106
114
|
get isIdentity(): boolean;
|
|
107
|
-
/**
|
|
115
|
+
/** Create an identity transform */
|
|
108
116
|
static createIdentity(result?: Transform): Transform;
|
|
109
|
-
/**
|
|
110
|
-
*
|
|
111
|
-
*
|
|
117
|
+
/**
|
|
118
|
+
* Create a Transform using the given `origin` and `matrix`.
|
|
119
|
+
* * This is a the appropriate construction when the columns of the matrix are coordinate axes of a
|
|
120
|
+
* local-to-world mapping.
|
|
121
|
+
* * This function is a closely related to `createFixedPointAndMatrix` whose point input is the fixed point
|
|
122
|
+
* of the world-to-world transformation.
|
|
112
123
|
*/
|
|
113
124
|
static createOriginAndMatrix(origin: XYZ | undefined, matrix: Matrix3d | undefined, result?: Transform): Transform;
|
|
114
|
-
/** Create
|
|
115
|
-
|
|
125
|
+
/** Create a Transform using the given `origin` and columns of the `matrix`. If `undefined` zero is used. */
|
|
126
|
+
setOriginAndMatrixColumns(origin: XYZ | undefined, vectorX: Vector3d | undefined, vectorY: Vector3d | undefined, vectorZ: Vector3d | undefined): void;
|
|
127
|
+
/** Create a Transform using the given `origin` and columns of the `matrix` */
|
|
116
128
|
static createOriginAndMatrixColumns(origin: XYZ, vectorX: Vector3d, vectorY: Vector3d, vectorZ: Vector3d, result?: Transform): Transform;
|
|
117
|
-
/**
|
|
118
|
-
*
|
|
129
|
+
/**
|
|
130
|
+
* Create a Transform such that its `matrix` part is rigid.
|
|
131
|
+
* * For details of how the matrix is created to be rigid, see documentation of `Matrix3d.createRigidFromColumns`
|
|
119
132
|
*/
|
|
120
133
|
static createRigidFromOriginAndColumns(origin: XYZ | undefined, vectorX: Vector3d, vectorY: Vector3d, axisOrder: AxisOrder, result?: Transform): Transform | undefined;
|
|
121
|
-
/**
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
* so that the fixedPoint maps back to itself.
|
|
134
|
+
/**
|
|
135
|
+
* Create a Transform with the specified `matrix`. Compute an `origin` (different from the given `fixedPoint`)
|
|
136
|
+
* so that the `fixedPoint` maps back to itself. The returned Transform, transforms a point `p` to `M*p + (f - M*f)`
|
|
137
|
+
* where `f` is the fixedPoint (i.e., `Tp = M*(p-f) + f`).
|
|
126
138
|
*/
|
|
127
139
|
static createFixedPointAndMatrix(fixedPoint: XYAndZ | undefined, matrix: Matrix3d, result?: Transform): Transform;
|
|
128
|
-
/**
|
|
129
|
-
*
|
|
130
|
-
*
|
|
140
|
+
/**
|
|
141
|
+
* Create a transform with the specified `matrix` and points `a` and `b`. The returned Transform, transforms
|
|
142
|
+
* point `p` to `M*(p-a) + b` (i.e., `Tp = M*(p-a) + b`) so transforms point `a` to 'b'.
|
|
131
143
|
*/
|
|
132
|
-
static createMatrixPickupPutdown(matrix: Matrix3d,
|
|
133
|
-
/**
|
|
134
|
-
* scales everything else around it by
|
|
144
|
+
static createMatrixPickupPutdown(matrix: Matrix3d, a: Point3d, b: Point3d, result?: Transform): Transform;
|
|
145
|
+
/**
|
|
146
|
+
* Create a Transform which leaves the fixedPoint unchanged and scales everything else around it by
|
|
147
|
+
* a single scale factor. The returned Transform, transforms a point `p` to `M*p + (f - M*f)`
|
|
148
|
+
* where `f` is the fixedPoint and M is the scale matrix (i.e., `Tp = M*(p-f) + f`).
|
|
135
149
|
*/
|
|
136
150
|
static createScaleAboutPoint(fixedPoint: Point3d, scale: number, result?: Transform): Transform;
|
|
137
|
-
/** Transform the input 2d point.
|
|
138
|
-
multiplyPoint2d(
|
|
139
|
-
/** Transform the input 3d point.
|
|
151
|
+
/** Transform the input 2d point. Return as a new point or in the pre-allocated result (if result is given). */
|
|
152
|
+
multiplyPoint2d(point: XAndY, result?: Point2d): Point2d;
|
|
153
|
+
/** Transform the input 3d point. Return as a new point or in the pre-allocated result (if result is given). */
|
|
140
154
|
multiplyPoint3d(point: XYAndZ, result?: Point3d): Point3d;
|
|
141
|
-
/** Transform the input
|
|
155
|
+
/** Transform the input 3d point in place (override the input point by the transformed point). */
|
|
142
156
|
multiplyXYAndZInPlace(point: XYAndZ): void;
|
|
143
|
-
/** Transform the input point.
|
|
157
|
+
/** Transform the input point. Return as a new point or in the pre-allocated result (if result is given). */
|
|
144
158
|
multiplyXYZ(x: number, y: number, z?: number, result?: Point3d): Point3d;
|
|
145
|
-
/**
|
|
159
|
+
/**
|
|
160
|
+
* Multiply a specific row (component) of the transform matrix times xyz and add it to the origin element
|
|
161
|
+
* at the same row. Return the result.
|
|
162
|
+
*/
|
|
146
163
|
multiplyComponentXYZ(componentIndex: number, x: number, y: number, z?: number): number;
|
|
147
|
-
/**
|
|
164
|
+
/**
|
|
165
|
+
* Multiply a specific row (component) of the transform matrix times xyz and add it to the origin element
|
|
166
|
+
* at the same row times w. Return the result.
|
|
167
|
+
*/
|
|
148
168
|
multiplyComponentXYZW(componentIndex: number, x: number, y: number, z: number, w: number): number;
|
|
149
|
-
/**
|
|
169
|
+
/**
|
|
170
|
+
* If `p = (x,y,z)` then transform is `Tp = M*p + o*w`. This function returns the transformed point as a new
|
|
171
|
+
* point4d (`Tp` as first 3 elements and `w` as last element) or in the pre-allocated result (if result is given).
|
|
172
|
+
*/
|
|
150
173
|
multiplyXYZW(x: number, y: number, z: number, w: number, result?: Point4d): Point4d;
|
|
151
|
-
/**
|
|
174
|
+
/**
|
|
175
|
+
* If `p = (x,y,z)` then transform is `Tp = M*p + o*w`. This function returns the transformed point as a new
|
|
176
|
+
* Float64Array with size 4 (`Tp` as first 3 elements and `w` as last element) or in the pre-allocated result
|
|
177
|
+
* (if result is given).
|
|
178
|
+
*/
|
|
152
179
|
multiplyXYZWToFloat64Array(x: number, y: number, z: number, w: number, result?: Float64Array): Float64Array;
|
|
153
|
-
/**
|
|
180
|
+
/**
|
|
181
|
+
* If `p = (x,y,z)` then transform is `Tp = M*p + o`. This function returns the transformed point as a new
|
|
182
|
+
* Float64Array with size 3 (`Tp` as 3 elements) or in the pre-allocated result (if result is given).
|
|
183
|
+
*/
|
|
154
184
|
multiplyXYZToFloat64Array(x: number, y: number, z: number, result?: Float64Array): Float64Array;
|
|
155
|
-
/**
|
|
185
|
+
/**
|
|
186
|
+
* Treat the 3x3 matrix and origin as upper 3x4 part of a 4x4 matrix, with 0001 as the final row. Now multiply
|
|
187
|
+
* the transposed of this 4x4 matrix by Point4d given as xyzw. Return as a new point4d (`M*p` as first 3 elements
|
|
188
|
+
* and `o*p + w` as last element where `p = (x,y,z)`) or in the pre-allocated result (if result is given).
|
|
189
|
+
*/
|
|
156
190
|
multiplyTransposeXYZW(x: number, y: number, z: number, w: number, result?: Point4d): Point4d;
|
|
157
|
-
/**
|
|
191
|
+
/** For each point in the array, replace point by the transformed point (by `Tp = M*p + o`) */
|
|
158
192
|
multiplyPoint3dArrayInPlace(points: Point3d[]): void;
|
|
159
|
-
/**
|
|
193
|
+
/** For each point in the 2d array, replace point by the transformed point (by `Tp = M*p + o`) */
|
|
160
194
|
multiplyPoint3dArrayArrayInPlace(chains: Point3d[][]): void;
|
|
161
|
-
/**
|
|
195
|
+
/**
|
|
196
|
+
* If for a point `p` we have `Tp = M*p + o = point` (where `point` is the transformed point), then
|
|
197
|
+
* `p = MInverse * (point - o)`. This function returns the original point `p` if `point` is the
|
|
198
|
+
* transformed point (`Tp = point`).
|
|
199
|
+
* * Return as a new point or in the optional `result`.
|
|
200
|
+
* * Returns `undefined` if the `matrix` part if this Transform is singular.
|
|
201
|
+
*/
|
|
162
202
|
multiplyInversePoint3d(point: XYAndZ, result?: Point3d): Point3d | undefined;
|
|
163
|
-
/**
|
|
164
|
-
* *
|
|
165
|
-
* * returns
|
|
203
|
+
/**
|
|
204
|
+
* If for a point `p` we have `Tp = M*p + w*o = weightedPoint` (where `weightedPoint` is the transformed point), then
|
|
205
|
+
* `p = MInverse * (weightedPoint - w*o)`. This function returns a Point4d where first 3 elements are the original
|
|
206
|
+
* point `p` if `weightedPoint` is the transformed point (`Tp = weightedPoint`) and the last element is `w`.
|
|
207
|
+
* * Return as a new point or in the optional `result`.
|
|
208
|
+
* * Returns `undefined` if the `matrix` part if this Transform is singular.
|
|
166
209
|
*/
|
|
167
210
|
multiplyInversePoint4d(weightedPoint: Point4d, result?: Point4d): Point4d | undefined;
|
|
168
|
-
/**
|
|
211
|
+
/**
|
|
212
|
+
* If for a point `p = (x,y,z)` we have `Tp = M*p + o = point` (where `point` is the transformed point), then
|
|
213
|
+
* `p = MInverse * (point - o)`. This function returns the original point `p` if `point` is the transformed
|
|
214
|
+
* point (`Tp = point`).
|
|
215
|
+
* * Return as a new point or in the optional `result`.
|
|
216
|
+
* * Returns `undefined` if the `matrix` part if this Transform is singular.
|
|
217
|
+
*/
|
|
169
218
|
multiplyInverseXYZ(x: number, y: number, z: number, result?: Point3d): Point3d | undefined;
|
|
170
219
|
/**
|
|
171
220
|
* * for each point: multiply transform * point
|
|
@@ -174,8 +223,8 @@ export declare class Transform implements BeJSONFunctions {
|
|
|
174
223
|
*/
|
|
175
224
|
multiplyInversePoint3dArray(source: Point3d[], result?: Point3d[]): Point3d[] | undefined;
|
|
176
225
|
/**
|
|
177
|
-
* *
|
|
178
|
-
* *
|
|
226
|
+
* * For each point in source: multiply transformInverse * point in place in the point.
|
|
227
|
+
* * Return false if not invertible.
|
|
179
228
|
*/
|
|
180
229
|
multiplyInversePoint3dArrayInPlace(source: Point3d[]): boolean;
|
|
181
230
|
/**
|
|
@@ -193,35 +242,35 @@ export declare class Transform implements BeJSONFunctions {
|
|
|
193
242
|
*/
|
|
194
243
|
static matchArrayLengths(source: any[], dest: any[], constructionFunction: () => any): number;
|
|
195
244
|
/**
|
|
196
|
-
* *
|
|
197
|
-
* *
|
|
198
|
-
* *
|
|
245
|
+
* * For each point: multiply transform * point
|
|
246
|
+
* * If result is given, resize to match source and replace each corresponding pi
|
|
247
|
+
* * If result is not given, return a new array.
|
|
199
248
|
*/
|
|
200
249
|
multiplyPoint2dArray(source: Point2d[], result?: Point2d[]): Point2d[];
|
|
201
250
|
/**
|
|
202
|
-
* *
|
|
203
|
-
* *
|
|
204
|
-
* *
|
|
251
|
+
* * For each point: multiply transform * point
|
|
252
|
+
* * If result is given, resize to match source and replace each corresponding pi
|
|
253
|
+
* * If result is not given, return a new array.
|
|
205
254
|
*/
|
|
206
255
|
multiplyPoint3dArray(source: Point3d[], result?: Point3d[]): Point3d[];
|
|
207
|
-
/**
|
|
208
|
-
*
|
|
209
|
-
* *
|
|
210
|
-
* *
|
|
256
|
+
/**
|
|
257
|
+
* Multiply the vector by the Matrix3d part of the transform.
|
|
258
|
+
* * The transform's origin is not used.
|
|
259
|
+
* * Return as new or result by usual optional result convention
|
|
211
260
|
*/
|
|
212
261
|
multiplyVector(vector: Vector3d, result?: Vector3d): Vector3d;
|
|
213
|
-
/**
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
262
|
+
/**
|
|
263
|
+
* Multiply the vector in place by the Matrix3d part of the transform.
|
|
264
|
+
* * The transform's origin is not used.
|
|
265
|
+
*/
|
|
217
266
|
multiplyVectorInPlace(vector: Vector3d): void;
|
|
218
|
-
/**
|
|
219
|
-
*
|
|
220
|
-
* *
|
|
221
|
-
* *
|
|
267
|
+
/**
|
|
268
|
+
* Multiply the vector (x,y,z) by the Matrix3d part of the transform.
|
|
269
|
+
* * The transform's origin is not used.
|
|
270
|
+
* * Return as new or result by usual optional result convention
|
|
222
271
|
*/
|
|
223
272
|
multiplyVectorXYZ(x: number, y: number, z: number, result?: Vector3d): Vector3d;
|
|
224
|
-
/**
|
|
273
|
+
/** Multiply this Transform times other Transform.
|
|
225
274
|
* ```
|
|
226
275
|
* equation
|
|
227
276
|
* \begin{matrix}
|
|
@@ -235,12 +284,13 @@ export declare class Transform implements BeJSONFunctions {
|
|
|
235
284
|
*/
|
|
236
285
|
multiplyTransformTransform(other: Transform, result?: Transform): Transform;
|
|
237
286
|
/**
|
|
238
|
-
*
|
|
287
|
+
* Multiply transformA * transformB, store to calling instance.
|
|
239
288
|
* @param transformA left operand
|
|
240
289
|
* @param transformB right operand
|
|
241
290
|
*/
|
|
242
291
|
setMultiplyTransformTransform(transformA: Transform, transformB: Transform): void;
|
|
243
|
-
/**
|
|
292
|
+
/**
|
|
293
|
+
* Multiply this Transform times other Matrix3d, with other considered to be a Transform with 0 translation.
|
|
244
294
|
* ```
|
|
245
295
|
* equation
|
|
246
296
|
* \begin{matrix}
|
|
@@ -257,15 +307,17 @@ export declare class Transform implements BeJSONFunctions {
|
|
|
257
307
|
* Return the range of the transformed corners.
|
|
258
308
|
* * The 8 corners are transformed individually.
|
|
259
309
|
* * Note that if there is anything other than translation and principal axis scaling in the transform, the volume of the range rotation will increase.
|
|
260
|
-
*
|
|
310
|
+
* * Hence to get a "tight" range on rotated geometry, a range computation must be made on the rotated geometry itself.
|
|
261
311
|
*/
|
|
262
312
|
multiplyRange(range: Range3d, result?: Range3d): Range3d;
|
|
263
313
|
/**
|
|
264
314
|
* * Return a Transform which is the inverse of this transform.
|
|
265
|
-
*
|
|
315
|
+
* @param result optional pre-allocated result
|
|
316
|
+
* @return the inverse Transform, or undefined if the matrix is singular
|
|
266
317
|
*/
|
|
267
|
-
inverse(): Transform | undefined;
|
|
268
|
-
/**
|
|
318
|
+
inverse(result?: Transform): Transform | undefined;
|
|
319
|
+
/**
|
|
320
|
+
* Initialize transforms that map each direction of a box (axis aligned) to `[0,1]`.
|
|
269
321
|
* * The corner coordinates do _not_ need to be in order in any of the x,y,z directions.
|
|
270
322
|
* * The npcToGlobalTransform (if supplied) maps 000 to the point named point000.
|
|
271
323
|
* * The npcToGlobalTransform (if supplied) maps 11 to the point named point000.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transform.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/Transform.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAY,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAE3D
|
|
1
|
+
{"version":3,"file":"Transform.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/Transform.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,eAAe,EAAY,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAE3D;;;;;;;;;;;;GAYG;AACH,qBAAa,SAAU,YAAW,eAAe;IAM/C,OAAO,CAAC,MAAM,CAAC,aAAa,CAAU;IACtC,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,OAAO,CAAW;IAE1B,OAAO;IAIP,OAAO,CAAC,MAAM,CAAC,SAAS,CAA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