@itwin/core-geometry 4.1.0-dev.66 → 4.1.0-dev.68
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 +6 -1
- package/lib/cjs/curve/RegionOps.d.ts +1 -0
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +1 -0
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts +4 -4
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +4 -4
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.d.ts +41 -32
- package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js +11 -8
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +37 -34
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +65 -43
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +2 -0
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +3 -3
- package/lib/cjs/geometry3d/Transform.js +3 -3
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +1 -0
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +1 -0
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts +4 -4
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +4 -4
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.d.ts +41 -32
- package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js +11 -8
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +37 -34
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +65 -43
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +2 -0
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +3 -3
- package/lib/esm/geometry3d/Transform.js +3 -3
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/package.json +3 -3
|
@@ -34,50 +34,59 @@ export declare class Plane3dByOriginAndUnitNormal extends Plane3d implements BeJ
|
|
|
34
34
|
* @param origin optional plane origin. If omitted, the origin is placed at 000
|
|
35
35
|
*/
|
|
36
36
|
static createZXPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal;
|
|
37
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Create a new Plane3dByOriginAndUnitNormal with given origin and normal.
|
|
38
39
|
* * The inputs are NOT captured.
|
|
39
40
|
* * Returns undefined if `normal.normalize()` returns undefined.
|
|
40
41
|
*/
|
|
41
42
|
static create(origin: Point3d, normal: Vector3d, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined;
|
|
42
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Create a new Plane3dByOriginAndUnitNormal from a variety of plane types.
|
|
43
45
|
* * The inputs are NOT captured.
|
|
44
46
|
* * Returns undefined if `source.getUnitNormal()` returns undefined.
|
|
45
47
|
*/
|
|
46
48
|
static createFrom(source: Plane3d, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined;
|
|
47
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* Create a new Plane3dByOriginAndUnitNormal with direct coordinates of origin and normal.
|
|
48
51
|
* * Returns undefined if the normal vector is all zeros.
|
|
49
52
|
* * If unable to normalize return undefined. (And if result is given it is left unchanged)
|
|
50
53
|
*/
|
|
51
54
|
static createXYZUVW(ax: number, ay: number, az: number, ux: number, uy: number, uz: number, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined;
|
|
52
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Create a new Plane3dByOriginAndUnitNormal with unit normal (a) in the xy plane (b) perpendicular to the line
|
|
57
|
+
* defined by xy parts of origin to target.
|
|
53
58
|
* * origin and normal both have z = 0.
|
|
54
59
|
* * The inputs are NOT captured.
|
|
55
60
|
* * Returns undefined if the normal vector is all zeros.
|
|
56
61
|
*/
|
|
57
62
|
static createOriginAndTargetXY(origin: XAndY, target: XAndY, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined;
|
|
58
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Create a new Plane3dByOriginAndUnitNormal with xy origin (at z=0) and normal angle in xy plane.
|
|
59
65
|
* * Returns undefined if the normal vector is all zeros.
|
|
60
66
|
*/
|
|
61
67
|
static createXYAngle(x: number, y: number, normalAngleFromX: Angle, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal;
|
|
62
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Create a plane defined by two points and an in-plane vector.
|
|
63
70
|
* @param pointA any point in the plane
|
|
64
71
|
* @param pointB any other point in the plane
|
|
65
72
|
* @param vector any vector in the plane but not parallel to the vector from pointA to pointB
|
|
66
73
|
*/
|
|
67
74
|
static createPointPointVectorInPlane(pointA: Point3d, pointB: Point3d, vector: Vector3d): Plane3dByOriginAndUnitNormal | undefined;
|
|
68
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* Create a plane defined by three points.
|
|
69
77
|
* @param pointA any point in the plane. This will be the origin.
|
|
70
78
|
* @param pointB any other point in the plane
|
|
71
79
|
* @param pointC any third point in the plane but not on the line of pointA and pointB
|
|
72
80
|
*/
|
|
73
81
|
static createOriginAndTargets(pointA: Point3d, pointB: Point3d, pointC: Point3d): Plane3dByOriginAndUnitNormal | undefined;
|
|
74
|
-
/**
|
|
82
|
+
/**
|
|
83
|
+
* Create a plane defined by a point and two vectors in the plane
|
|
75
84
|
* @param pointA any point in the plane
|
|
76
85
|
* @param vectorB any vector in the plane
|
|
77
86
|
* @param vectorC any vector in the plane but not parallel to vectorB
|
|
78
87
|
*/
|
|
79
88
|
static createOriginAndVectors(pointA: Point3d, vectorB: Vector3d, vectorC: Vector3d): Plane3dByOriginAndUnitNormal | undefined;
|
|
80
|
-
/**
|
|
89
|
+
/** Test for (toleranced) equality with `other` */
|
|
81
90
|
isAlmostEqual(other: Plane3dByOriginAndUnitNormal): boolean;
|
|
82
91
|
/** Parse a json fragment `{origin: [x,y,z], normal: [ux,uy,uz]}` */
|
|
83
92
|
setFromJSON(json?: any): void;
|
|
@@ -86,7 +95,8 @@ export declare class Plane3dByOriginAndUnitNormal extends Plane3d implements BeJ
|
|
|
86
95
|
* @return {*} [origin,normal]
|
|
87
96
|
*/
|
|
88
97
|
toJSON(): any;
|
|
89
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* Create a new Plane3dByOriginAndUnitNormal from json fragment.
|
|
90
100
|
* * See `Plane3dByOriginAndUnitNormal.setFromJSON`
|
|
91
101
|
*/
|
|
92
102
|
static fromJSON(json?: any): Plane3dByOriginAndUnitNormal;
|
|
@@ -94,18 +104,18 @@ export declare class Plane3dByOriginAndUnitNormal extends Plane3d implements BeJ
|
|
|
94
104
|
getOriginRef(): Point3d;
|
|
95
105
|
/** Return a reference to the unit normal. */
|
|
96
106
|
getNormalRef(): Vector3d;
|
|
97
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* Return coordinate axes (as a transform) with
|
|
98
109
|
* * origin at plane origin
|
|
99
110
|
* * z axis in direction of plane normal.
|
|
100
111
|
* * x,y axes in plane.
|
|
101
112
|
*/
|
|
102
113
|
getLocalToWorld(): Transform;
|
|
103
|
-
/** Return a (singular) transform which projects points to this plane.
|
|
104
|
-
*/
|
|
114
|
+
/** Return a (singular) transform which projects points to this plane. */
|
|
105
115
|
getProjectionToPlane(): Transform;
|
|
106
116
|
/** Copy coordinates from the given origin and normal. */
|
|
107
117
|
set(origin: Point3d, normal: Vector3d): void;
|
|
108
|
-
/**
|
|
118
|
+
/** Return a deep clone (point and normal cloned) */
|
|
109
119
|
clone(result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal;
|
|
110
120
|
/** Create a clone and return the transform of the clone. */
|
|
111
121
|
cloneTransformed(transform: Transform, inverse?: boolean): Plane3dByOriginAndUnitNormal | undefined;
|
|
@@ -115,35 +125,27 @@ export declare class Plane3dByOriginAndUnitNormal extends Plane3d implements BeJ
|
|
|
115
125
|
altitude(spacePoint: Point3d): number;
|
|
116
126
|
/** Return the altitude of point (x,y) given xy parts using only the xy parts of origin and unit normal */
|
|
117
127
|
altitudeXY(x: number, y: number): number;
|
|
118
|
-
/**
|
|
119
|
-
* Return the x component of the normal used to evaluate altitude.
|
|
120
|
-
*/
|
|
128
|
+
/** Return the x component of the normal used to evaluate altitude. */
|
|
121
129
|
normalX(): number;
|
|
122
|
-
/**
|
|
123
|
-
* Return the x component of the normal used to evaluate altitude.
|
|
124
|
-
*/
|
|
130
|
+
/** Return the x component of the normal used to evaluate altitude. */
|
|
125
131
|
normalY(): number;
|
|
126
|
-
/**
|
|
127
|
-
* Return the z component of the normal used to evaluate altitude.
|
|
128
|
-
*/
|
|
132
|
+
/** Return the z component of the normal used to evaluate altitude. */
|
|
129
133
|
normalZ(): number;
|
|
130
|
-
/**
|
|
131
|
-
* Return (a clone of) the unit normal.
|
|
132
|
-
*/
|
|
134
|
+
/** Return (a clone of) the unit normal. */
|
|
133
135
|
getUnitNormal(result?: Vector3d): Vector3d | undefined;
|
|
134
|
-
/**
|
|
135
|
-
* Return (a clone of) the origin.
|
|
136
|
-
*/
|
|
136
|
+
/** Return (a clone of) the origin. */
|
|
137
137
|
getAnyPointOnPlane(result?: Point3d): Point3d;
|
|
138
138
|
/** Return the signed altitude of weighted spacePoint above or below the plane. (Below is negative) */
|
|
139
139
|
weightedAltitude(spacePoint: Point4d): number;
|
|
140
|
-
/**
|
|
140
|
+
/** Return any point at specified (signed) altitude. */
|
|
141
141
|
altitudeToPoint(altitude: number, result?: Point3d): Point3d;
|
|
142
|
-
/**
|
|
142
|
+
/**
|
|
143
|
+
* Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude
|
|
143
144
|
* for a point moving at speed one along the spaceVector.
|
|
144
145
|
*/
|
|
145
146
|
velocityXYZ(x: number, y: number, z: number): number;
|
|
146
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude
|
|
147
149
|
* for a point moving at speed one along the spaceVector.
|
|
148
150
|
*/
|
|
149
151
|
velocity(spaceVector: Vector3d): number;
|
|
@@ -153,9 +155,10 @@ export declare class Plane3dByOriginAndUnitNormal extends Plane3d implements BeJ
|
|
|
153
155
|
altitudeXYZW(x: number, y: number, z: number, w: number): number;
|
|
154
156
|
/** Return the projection of spacePoint onto the plane. */
|
|
155
157
|
projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d;
|
|
156
|
-
/**
|
|
158
|
+
/**
|
|
159
|
+
* Returns true if spacePoint is within distance tolerance of the plane.
|
|
157
160
|
* * This logic is identical to the [[Plane3d]] method but avoids a level of function call.
|
|
158
|
-
|
|
161
|
+
*/
|
|
159
162
|
isPointInPlane(spacePoint: Point3d, tolerance?: number): boolean;
|
|
160
163
|
}
|
|
161
164
|
//# sourceMappingURL=Plane3dByOriginAndUnitNormal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plane3dByOriginAndUnitNormal.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndUnitNormal.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAa,eAAe,EAAY,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;GAKG;AACH,qBAAa,4BAA6B,SAAQ,OAAQ,YAAW,eAAe;IAClF,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,OAAO,CAAW;IAE1B,OAAO;IAMP,OAAO,CAAC,MAAM,CAAC,OAAO;IAGtB;;;OAGG;WACW,aAAa,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,4BAA4B;IAK3E;;;OAGG;WACW,aAAa,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,4BAA4B;IAK3E;;;OAGG;WACW,aAAa,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,4BAA4B;IAK3E
|
|
1
|
+
{"version":3,"file":"Plane3dByOriginAndUnitNormal.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndUnitNormal.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAa,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OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAG1E;;;OAGG;IACa,cAAc,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAE,MAAqC,GAAG,OAAO;CAI/G"}
|
|
@@ -57,7 +57,8 @@ class Plane3dByOriginAndUnitNormal extends Plane3d_1.Plane3d {
|
|
|
57
57
|
return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 1, 0);
|
|
58
58
|
return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 1, 0);
|
|
59
59
|
}
|
|
60
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* Create a new Plane3dByOriginAndUnitNormal with given origin and normal.
|
|
61
62
|
* * The inputs are NOT captured.
|
|
62
63
|
* * Returns undefined if `normal.normalize()` returns undefined.
|
|
63
64
|
*/
|
|
@@ -73,7 +74,8 @@ class Plane3dByOriginAndUnitNormal extends Plane3d_1.Plane3d {
|
|
|
73
74
|
return undefined;
|
|
74
75
|
return new Plane3dByOriginAndUnitNormal(origin.clone(), normalized);
|
|
75
76
|
}
|
|
76
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* Create a new Plane3dByOriginAndUnitNormal from a variety of plane types.
|
|
77
79
|
* * The inputs are NOT captured.
|
|
78
80
|
* * Returns undefined if `source.getUnitNormal()` returns undefined.
|
|
79
81
|
*/
|
|
@@ -92,7 +94,8 @@ class Plane3dByOriginAndUnitNormal extends Plane3d_1.Plane3d {
|
|
|
92
94
|
const origin = source.getAnyPointOnPlane();
|
|
93
95
|
return new Plane3dByOriginAndUnitNormal(origin, normal);
|
|
94
96
|
}
|
|
95
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* Create a new Plane3dByOriginAndUnitNormal with direct coordinates of origin and normal.
|
|
96
99
|
* * Returns undefined if the normal vector is all zeros.
|
|
97
100
|
* * If unable to normalize return undefined. (And if result is given it is left unchanged)
|
|
98
101
|
*/
|
|
@@ -107,7 +110,9 @@ class Plane3dByOriginAndUnitNormal extends Plane3d_1.Plane3d {
|
|
|
107
110
|
}
|
|
108
111
|
return new Plane3dByOriginAndUnitNormal(Point3dVector3d_1.Point3d.create(ax, ay, az), Point3dVector3d_1.Vector3d.create(ux / magU, uy / magU, uz / magU));
|
|
109
112
|
}
|
|
110
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* Create a new Plane3dByOriginAndUnitNormal with unit normal (a) in the xy plane (b) perpendicular to the line
|
|
115
|
+
* defined by xy parts of origin to target.
|
|
111
116
|
* * origin and normal both have z = 0.
|
|
112
117
|
* * The inputs are NOT captured.
|
|
113
118
|
* * Returns undefined if the normal vector is all zeros.
|
|
@@ -117,7 +122,8 @@ class Plane3dByOriginAndUnitNormal extends Plane3d_1.Plane3d {
|
|
|
117
122
|
const uy = target.y - origin.y;
|
|
118
123
|
return this.createXYZUVW(origin.x, origin.y, 0.0, uy, -ux, 0.0, result);
|
|
119
124
|
}
|
|
120
|
-
/**
|
|
125
|
+
/**
|
|
126
|
+
* Create a new Plane3dByOriginAndUnitNormal with xy origin (at z=0) and normal angle in xy plane.
|
|
121
127
|
* * Returns undefined if the normal vector is all zeros.
|
|
122
128
|
*/
|
|
123
129
|
static createXYAngle(x, y, normalAngleFromX, result) {
|
|
@@ -128,7 +134,8 @@ class Plane3dByOriginAndUnitNormal extends Plane3d_1.Plane3d {
|
|
|
128
134
|
}
|
|
129
135
|
return new Plane3dByOriginAndUnitNormal(Point3dVector3d_1.Point3d.create(x, y, 0), Point3dVector3d_1.Vector3d.create(normalAngleFromX.cos(), normalAngleFromX.sin()));
|
|
130
136
|
}
|
|
131
|
-
/**
|
|
137
|
+
/**
|
|
138
|
+
* Create a plane defined by two points and an in-plane vector.
|
|
132
139
|
* @param pointA any point in the plane
|
|
133
140
|
* @param pointB any other point in the plane
|
|
134
141
|
* @param vector any vector in the plane but not parallel to the vector from pointA to pointB
|
|
@@ -139,7 +146,8 @@ class Plane3dByOriginAndUnitNormal extends Plane3d_1.Plane3d {
|
|
|
139
146
|
return new Plane3dByOriginAndUnitNormal(pointA, cross);
|
|
140
147
|
return undefined;
|
|
141
148
|
}
|
|
142
|
-
/**
|
|
149
|
+
/**
|
|
150
|
+
* Create a plane defined by three points.
|
|
143
151
|
* @param pointA any point in the plane. This will be the origin.
|
|
144
152
|
* @param pointB any other point in the plane
|
|
145
153
|
* @param pointC any third point in the plane but not on the line of pointA and pointB
|
|
@@ -150,7 +158,8 @@ class Plane3dByOriginAndUnitNormal extends Plane3d_1.Plane3d {
|
|
|
150
158
|
return new Plane3dByOriginAndUnitNormal(pointA, cross);
|
|
151
159
|
return undefined;
|
|
152
160
|
}
|
|
153
|
-
/**
|
|
161
|
+
/**
|
|
162
|
+
* Create a plane defined by a point and two vectors in the plane
|
|
154
163
|
* @param pointA any point in the plane
|
|
155
164
|
* @param vectorB any vector in the plane
|
|
156
165
|
* @param vectorC any vector in the plane but not parallel to vectorB
|
|
@@ -161,7 +170,7 @@ class Plane3dByOriginAndUnitNormal extends Plane3d_1.Plane3d {
|
|
|
161
170
|
return new Plane3dByOriginAndUnitNormal(pointA, cross);
|
|
162
171
|
return undefined;
|
|
163
172
|
}
|
|
164
|
-
/**
|
|
173
|
+
/** Test for (toleranced) equality with `other` */
|
|
165
174
|
isAlmostEqual(other) {
|
|
166
175
|
return this._origin.isAlmostEqual(other._origin) && this._normal.isAlmostEqual(other._normal);
|
|
167
176
|
}
|
|
@@ -180,8 +189,11 @@ class Plane3dByOriginAndUnitNormal extends Plane3d_1.Plane3d {
|
|
|
180
189
|
* Convert to a JSON object.
|
|
181
190
|
* @return {*} [origin,normal]
|
|
182
191
|
*/
|
|
183
|
-
toJSON() {
|
|
184
|
-
|
|
192
|
+
toJSON() {
|
|
193
|
+
return { origin: this._origin.toJSON(), normal: this._normal.toJSON() };
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Create a new Plane3dByOriginAndUnitNormal from json fragment.
|
|
185
197
|
* * See `Plane3dByOriginAndUnitNormal.setFromJSON`
|
|
186
198
|
*/
|
|
187
199
|
static fromJSON(json) {
|
|
@@ -190,10 +202,15 @@ class Plane3dByOriginAndUnitNormal extends Plane3d_1.Plane3d {
|
|
|
190
202
|
return result;
|
|
191
203
|
}
|
|
192
204
|
/** Return a reference to the origin. */
|
|
193
|
-
getOriginRef() {
|
|
205
|
+
getOriginRef() {
|
|
206
|
+
return this._origin;
|
|
207
|
+
}
|
|
194
208
|
/** Return a reference to the unit normal. */
|
|
195
|
-
getNormalRef() {
|
|
196
|
-
|
|
209
|
+
getNormalRef() {
|
|
210
|
+
return this._normal;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Return coordinate axes (as a transform) with
|
|
197
214
|
* * origin at plane origin
|
|
198
215
|
* * z axis in direction of plane normal.
|
|
199
216
|
* * x,y axes in plane.
|
|
@@ -202,8 +219,7 @@ class Plane3dByOriginAndUnitNormal extends Plane3d_1.Plane3d {
|
|
|
202
219
|
const axes = Matrix3d_1.Matrix3d.createRigidHeadsUp(this._normal, Geometry_1.AxisOrder.ZXY);
|
|
203
220
|
return Transform_1.Transform.createRefs(this._origin.clone(), axes);
|
|
204
221
|
}
|
|
205
|
-
/** Return a (singular) transform which projects points to this plane.
|
|
206
|
-
*/
|
|
222
|
+
/** Return a (singular) transform which projects points to this plane. */
|
|
207
223
|
getProjectionToPlane() {
|
|
208
224
|
const axes = Matrix3d_1.Matrix3d.createIdentity();
|
|
209
225
|
axes.addScaledOuterProductInPlace(this._normal, this._normal, -1.0);
|
|
@@ -215,7 +231,7 @@ class Plane3dByOriginAndUnitNormal extends Plane3d_1.Plane3d {
|
|
|
215
231
|
this._origin.setFrom(origin);
|
|
216
232
|
this._normal.setFrom(normal);
|
|
217
233
|
}
|
|
218
|
-
/**
|
|
234
|
+
/** Return a deep clone (point and normal cloned) */
|
|
219
235
|
clone(result) {
|
|
220
236
|
if (result) {
|
|
221
237
|
result.set(this._origin, this._normal);
|
|
@@ -245,51 +261,56 @@ class Plane3dByOriginAndUnitNormal extends Plane3d_1.Plane3d {
|
|
|
245
261
|
this.set(source._origin, source._normal);
|
|
246
262
|
}
|
|
247
263
|
/** Return the altitude of spacePoint above or below the plane. (Below is negative) */
|
|
248
|
-
altitude(spacePoint) {
|
|
264
|
+
altitude(spacePoint) {
|
|
265
|
+
return this._normal.dotProductStartEnd(this._origin, spacePoint);
|
|
266
|
+
}
|
|
249
267
|
/** Return the altitude of point (x,y) given xy parts using only the xy parts of origin and unit normal */
|
|
250
268
|
altitudeXY(x, y) {
|
|
251
269
|
return (x - this._origin.x) * this._normal.x + (y - this._origin.y) * this._normal.y;
|
|
252
270
|
}
|
|
253
|
-
/**
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* Return (a clone of) the unit normal.
|
|
267
|
-
*/
|
|
271
|
+
/** Return the x component of the normal used to evaluate altitude. */
|
|
272
|
+
normalX() {
|
|
273
|
+
return this._normal.x;
|
|
274
|
+
}
|
|
275
|
+
/** Return the x component of the normal used to evaluate altitude. */
|
|
276
|
+
normalY() {
|
|
277
|
+
return this._normal.y;
|
|
278
|
+
}
|
|
279
|
+
/** Return the z component of the normal used to evaluate altitude. */
|
|
280
|
+
normalZ() {
|
|
281
|
+
return this._normal.z;
|
|
282
|
+
}
|
|
283
|
+
/** Return (a clone of) the unit normal. */
|
|
268
284
|
getUnitNormal(result) {
|
|
269
285
|
return this._normal.clone(result);
|
|
270
286
|
}
|
|
271
|
-
/**
|
|
272
|
-
* Return (a clone of) the origin.
|
|
273
|
-
*/
|
|
287
|
+
/** Return (a clone of) the origin. */
|
|
274
288
|
getAnyPointOnPlane(result) {
|
|
289
|
+
// This function returns the plane origin. In general, a point x is on the plane if and only if (x-o).n = 0.
|
|
275
290
|
return this._origin.clone(result);
|
|
276
291
|
}
|
|
277
292
|
/** Return the signed altitude of weighted spacePoint above or below the plane. (Below is negative) */
|
|
278
293
|
weightedAltitude(spacePoint) {
|
|
279
294
|
return this._normal.dotProductStart3dEnd4d(this._origin, spacePoint);
|
|
280
295
|
}
|
|
281
|
-
/**
|
|
296
|
+
/** Return any point at specified (signed) altitude. */
|
|
282
297
|
altitudeToPoint(altitude, result) {
|
|
283
298
|
return this._origin.plusScaled(this._normal, altitude, result);
|
|
284
299
|
}
|
|
285
|
-
/**
|
|
300
|
+
/**
|
|
301
|
+
* Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude
|
|
286
302
|
* for a point moving at speed one along the spaceVector.
|
|
287
303
|
*/
|
|
288
|
-
velocityXYZ(x, y, z) {
|
|
289
|
-
|
|
304
|
+
velocityXYZ(x, y, z) {
|
|
305
|
+
return this._normal.dotProductXYZ(x, y, z);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude
|
|
290
309
|
* for a point moving at speed one along the spaceVector.
|
|
291
310
|
*/
|
|
292
|
-
velocity(spaceVector) {
|
|
311
|
+
velocity(spaceVector) {
|
|
312
|
+
return this._normal.dotProduct(spaceVector);
|
|
313
|
+
}
|
|
293
314
|
/** Return the altitude of a point given as separate x,y,z components. */
|
|
294
315
|
altitudeXYZ(x, y, z) {
|
|
295
316
|
return this._normal.dotProductStartEndXYZ(this._origin, x, y, z);
|
|
@@ -302,9 +323,10 @@ class Plane3dByOriginAndUnitNormal extends Plane3d_1.Plane3d {
|
|
|
302
323
|
projectPointToPlane(spacePoint, result) {
|
|
303
324
|
return spacePoint.plusScaled(this._normal, -this._normal.dotProductStartEnd(this._origin, spacePoint), result);
|
|
304
325
|
}
|
|
305
|
-
/**
|
|
326
|
+
/**
|
|
327
|
+
* Returns true if spacePoint is within distance tolerance of the plane.
|
|
306
328
|
* * This logic is identical to the [[Plane3d]] method but avoids a level of function call.
|
|
307
|
-
|
|
329
|
+
*/
|
|
308
330
|
isPointInPlane(spacePoint, tolerance = Geometry_1.Geometry.smallMetricDistance) {
|
|
309
331
|
const altitude = this._normal.dotProductStartEnd(this._origin, spacePoint);
|
|
310
332
|
return Math.abs(altitude) <= tolerance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plane3dByOriginAndUnitNormal.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndUnitNormal.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAAmE;AACnE,uCAAoC;AAGpC,yCAAsC;AACtC,uDAAsD;AACtD,2CAAwC;AAGxC;;;;;GAKG;AACH,MAAa,4BAA6B,SAAQ,iBAAO;IAGvD,sCAAsC;IACtC,YAAoB,MAAe,EAAE,MAAgB;QACnD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IACD,yEAAyE;IACjE,MAAM,CAAC,OAAO,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;QACrF,OAAO,IAAI,4BAA4B,CAAC,yBAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,0BAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7F,CAAC;IACD;;;OAGG;IACI,MAAM,CAAC,aAAa,CAAC,MAAgB;QAC1C,IAAI,MAAM;YACR,OAAO,4BAA4B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACrF,OAAO,4BAA4B,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CA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/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\r\nimport { Plane3d } from \"./Plane3d\";\r\nimport { Point4d } from \"../geometry4d/Point4d\";\r\nimport { Angle } from \"./Angle\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { Transform } from \"./Transform\";\r\nimport { XAndY } from \"./XYZProps\";\r\n\r\n/**\r\n * A plane defined by\r\n * * Any point on the plane.\r\n * * a unit normal.\r\n * @public\r\n */\r\nexport class Plane3dByOriginAndUnitNormal extends Plane3d implements BeJSONFunctions {\r\n private _origin: Point3d;\r\n private _normal: Vector3d;\r\n // constructor captures references !!!\r\n private constructor(origin: Point3d, normal: Vector3d) {\r\n super();\r\n this._origin = origin;\r\n this._normal = normal;\r\n }\r\n // This is private because it does not check validity of the unit vector.\r\n private static _create(x: number, y: number, z: number, u: number, v: number, w: number) {\r\n return new Plane3dByOriginAndUnitNormal(Point3d.create(x, y, z), Vector3d.create(u, v, w));\r\n }\r\n /**\r\n * Create a plane parallel to the XY plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createXYPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 0, 1);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 0, 1);\r\n }\r\n /**\r\n * Create a plane parallel to the YZ plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createYZPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 1, 0, 0);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 1, 0, 0);\r\n }\r\n /**\r\n * Create a plane parallel to the ZX plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createZXPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 1, 0);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 1, 0);\r\n }\r\n /** Create a new Plane3dByOriginAndUnitNormal with given origin and normal.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if `normal.normalize()` returns undefined.\r\n */\r\n public static create(origin: Point3d, normal: Vector3d, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\r\n if (result) {\r\n if (normal.normalize(result._normal) === undefined)\r\n return undefined;\r\n origin.clone(result._origin);\r\n return result;\r\n }\r\n const normalized = normal.normalize();\r\n if (normalized === undefined)\r\n return undefined;\r\n return new Plane3dByOriginAndUnitNormal(origin.clone(), normalized);\r\n }\r\n /** Create a new Plane3dByOriginAndUnitNormal from a variety of plane types.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if `source.getUnitNormal()` returns undefined.\r\n */\r\n public static createFrom(source: Plane3d, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\r\n if (source instanceof Plane3dByOriginAndUnitNormal)\r\n return source.clone(result);\r\n if (result) {\r\n if (source.getUnitNormal(result._normal) === undefined)\r\n return undefined;\r\n source.getAnyPointOnPlane(result._origin);\r\n return result;\r\n }\r\n const normal = source.getUnitNormal();\r\n if (normal === undefined)\r\n return undefined;\r\n const origin = source.getAnyPointOnPlane();\r\n return new Plane3dByOriginAndUnitNormal(origin, normal);\r\n }\r\n\r\n /** create a new Plane3dByOriginAndUnitNormal with direct coordinates of origin and normal.\r\n * * Returns undefined if the normal vector is all zeros.\r\n * * If unable to normalize return undefined. (And if result is given it is left unchanged)\r\n */\r\n public static createXYZUVW(ax: number, ay: number, az: number, ux: number, uy: number, uz: number, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\r\n const magU = Geometry.hypotenuseXYZ(ux, uy, uz);\r\n if (magU < Geometry.smallMetricDistance)\r\n return undefined;\r\n if (result) {\r\n result._origin.set(ax, ay, az);\r\n result._normal.set(ux / magU, uy / magU, uz / magU);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(Point3d.create(ax, ay, az), Vector3d.create(ux / magU, uy / magU, uz / magU));\r\n }\r\n /** create a new Plane3dByOriginAndUnitNormal with unit normal (a) in the xy plane (b) perpendicular to the line defined by xy parts of origin to target.\r\n * * origin and normal both have z = 0.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if the normal vector is all zeros.\r\n */\r\n public static createOriginAndTargetXY(origin: XAndY, target: XAndY, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\r\n const ux = target.x - origin.x;\r\n const uy = target.y - origin.y;\r\n return this.createXYZUVW(origin.x, origin.y, 0.0, uy, -ux, 0.0, result);\r\n }\r\n\r\n /** create a new Plane3dByOriginAndUnitNormal with xy origin (at z=0) and normal angle in xy plane.\r\n * * Returns undefined if the normal vector is all zeros.\r\n */\r\n public static createXYAngle(x: number, y: number, normalAngleFromX: Angle, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal {\r\n if (result) {\r\n result._origin.set(x, y, 0.0);\r\n result._normal.set(normalAngleFromX.cos(), normalAngleFromX.sin(), 0.0);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(Point3d.create(x, y, 0), Vector3d.create(normalAngleFromX.cos(), normalAngleFromX.sin()));\r\n }\r\n\r\n /** Create a plane defined by two points and an in-plane vector.\r\n * @param pointA any point in the plane\r\n * @param pointB any other point in the plane\r\n * @param vector any vector in the plane but not parallel to the vector from pointA to pointB\r\n */\r\n public static createPointPointVectorInPlane(pointA: Point3d, pointB: Point3d, vector: Vector3d): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = vector.crossProductStartEnd(pointA, pointB);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n\r\n /** Create a plane defined by three points.\r\n * @param pointA any point in the plane. This will be the origin.\r\n * @param pointB any other point in the plane\r\n * @param pointC any third point in the plane but not on the line of pointA and pointB\r\n */\r\n public static createOriginAndTargets(pointA: Point3d, pointB: Point3d, pointC: Point3d): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = pointA.crossProductToPoints(pointB, pointC);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n\r\n /** Create a plane defined by a point and two vectors in the plane\r\n * @param pointA any point in the plane\r\n * @param vectorB any vector in the plane\r\n * @param vectorC any vector in the plane but not parallel to vectorB\r\n */\r\n public static createOriginAndVectors(pointA: Point3d, vectorB: Vector3d, vectorC: Vector3d): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = vectorB.crossProduct(vectorC);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n\r\n /** test for (toleranced) equality with `other` */\r\n public isAlmostEqual(other: Plane3dByOriginAndUnitNormal): boolean {\r\n return this._origin.isAlmostEqual(other._origin) && this._normal.isAlmostEqual(other._normal);\r\n }\r\n /** Parse a json fragment `{origin: [x,y,z], normal: [ux,uy,uz]}` */\r\n public setFromJSON(json?: any) {\r\n if (!json) {\r\n this._origin.set(0, 0, 0);\r\n this._normal.set(0, 0, 1);\r\n } else {\r\n this._origin.setFromJSON(json.origin);\r\n this._normal.setFromJSON(json.normal);\r\n }\r\n }\r\n /**\r\n * Convert to a JSON object.\r\n * @return {*} [origin,normal]\r\n */\r\n public toJSON(): any { return { origin: this._origin.toJSON(), normal: this._normal.toJSON() }; }\r\n /** create a new Plane3dByOriginAndUnitNormal from json fragment.\r\n * * See `Plane3dByOriginAndUnitNormal.setFromJSON`\r\n */\r\n public static fromJSON(json?: any): Plane3dByOriginAndUnitNormal {\r\n const result = Plane3dByOriginAndUnitNormal.createXYPlane();\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Return a reference to the origin. */\r\n public getOriginRef(): Point3d { return this._origin; }\r\n /** Return a reference to the unit normal. */\r\n public getNormalRef(): Vector3d { return this._normal; }\r\n\r\n /** Return coordinate axes (as a transform) with\r\n * * origin at plane origin\r\n * * z axis in direction of plane normal.\r\n * * x,y axes in plane.\r\n */\r\n public getLocalToWorld(): Transform {\r\n const axes = Matrix3d.createRigidHeadsUp(this._normal, AxisOrder.ZXY);\r\n return Transform.createRefs(this._origin.clone(), axes);\r\n }\r\n /** Return a (singular) transform which projects points to this plane.\r\n */\r\n public getProjectionToPlane(): Transform {\r\n const axes = Matrix3d.createIdentity();\r\n axes.addScaledOuterProductInPlace(this._normal, this._normal, -1.0);\r\n axes.markSingular();\r\n return Transform.createFixedPointAndMatrix(this._origin, axes);\r\n }\r\n\r\n /** Copy coordinates from the given origin and normal. */\r\n public set(origin: Point3d, normal: Vector3d): void {\r\n this._origin.setFrom(origin);\r\n this._normal.setFrom(normal);\r\n }\r\n /** return a deep clone (point and normal cloned) */\r\n public clone(result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal {\r\n if (result) {\r\n result.set(this._origin, this._normal);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(this._origin.clone(), this._normal.clone());\r\n }\r\n /** Create a clone and return the transform of the clone. */\r\n public cloneTransformed(transform: Transform, inverse: boolean = false): Plane3dByOriginAndUnitNormal | undefined {\r\n const result = this.clone();\r\n if (inverse) {\r\n transform.multiplyInversePoint3d(result._origin, result._origin);\r\n if (transform.matrix.multiplyTransposeVector(result._normal, result._normal) !== undefined\r\n && result._normal.normalizeInPlace())\r\n return result;\r\n } else {\r\n transform.multiplyPoint3d(result._origin, result._origin);\r\n if (transform.matrix.multiplyInverseTranspose(result._normal, result._normal) !== undefined\r\n && result._normal.normalizeInPlace())\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n /** Copy data from the given plane. */\r\n public setFrom(source: Plane3dByOriginAndUnitNormal): void {\r\n this.set(source._origin, source._normal);\r\n }\r\n /** Return the altitude of spacePoint above or below the plane. (Below is negative) */\r\n public altitude(spacePoint: Point3d): number { return this._normal.dotProductStartEnd(this._origin, spacePoint); }\r\n /** Return the altitude of point (x,y) given xy parts using only the xy parts of origin and unit normal */\r\n public altitudeXY(x: number, y: number): number {\r\n return (x - this._origin.x) * this._normal.x + (y - this._origin.y) * this._normal.y;\r\n }\r\n /**\r\n * Return the x component of the normal used to evaluate altitude.\r\n */\r\n public normalX(): number { return this._normal.x; }\r\n /**\r\n * Return the x component of the normal used to evaluate altitude.\r\n */\r\n public normalY(): number { return this._normal.y; }\r\n /**\r\n * Return the z component of the normal used to evaluate altitude.\r\n */\r\n public normalZ(): number { return this._normal.z; }\r\n /**\r\n * Return (a clone of) the unit normal.\r\n */\r\n public override getUnitNormal(result?: Vector3d): Vector3d | undefined {\r\n return this._normal.clone(result);\r\n }\r\n /**\r\n * Return (a clone of) the origin.\r\n */\r\n public override getAnyPointOnPlane(result?: Point3d): Point3d {\r\n return this._origin.clone(result);\r\n }\r\n /** Return the signed altitude of weighted spacePoint above or below the plane. (Below is negative) */\r\n public weightedAltitude(spacePoint: Point4d): number {\r\n return this._normal.dotProductStart3dEnd4d(this._origin, spacePoint);\r\n }\r\n\r\n /** return any point at specified (signed) altitude. */\r\n public altitudeToPoint(altitude: number, result?: Point3d): Point3d {\r\n return this._origin.plusScaled(this._normal, altitude, result);\r\n }\r\n /** Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\r\n * for a point moving at speed one along the spaceVector.\r\n */\r\n public velocityXYZ(x: number, y: number, z: number): number { return this._normal.dotProductXYZ(x, y, z); }\r\n /** Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\r\n * for a point moving at speed one along the spaceVector.\r\n */\r\n public velocity(spaceVector: Vector3d): number { return this._normal.dotProduct(spaceVector); }\r\n /** Return the altitude of a point given as separate x,y,z components. */\r\n public altitudeXYZ(x: number, y: number, z: number): number {\r\n return this._normal.dotProductStartEndXYZ(this._origin, x, y, z);\r\n }\r\n /** Return the altitude of a point given as separate x,y,z,w components. */\r\n public altitudeXYZW(x: number, y: number, z: number, w: number): number {\r\n return this._normal.dotProductStartEndXYZW(this._origin, x, y, z, w);\r\n }\r\n /** Return the projection of spacePoint onto the plane. */\r\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\r\n return spacePoint.plusScaled(this._normal, -this._normal.dotProductStartEnd(this._origin, spacePoint), result);\r\n }\r\n /** Returns true if spacePoint is within distance tolerance of the plane.\r\n * * This logic is identical to the [[Plane3d]] method but avoids a level of function call.\r\n */\r\n public override isPointInPlane(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n const altitude = this._normal.dotProductStartEnd(this._origin, spacePoint);\r\n return Math.abs(altitude) <= tolerance;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Plane3dByOriginAndUnitNormal.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndUnitNormal.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAAmE;AACnE,uCAAoC;AAGpC,yCAAsC;AACtC,uDAAsD;AACtD,2CAAwC;AAGxC;;;;;GAKG;AACH,MAAa,4BAA6B,SAAQ,iBAAO;IAGvD,sCAAsC;IACtC,YAAoB,MAAe,EAAE,MAAgB;QACnD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IACD,yEAAyE;IACjE,MAAM,CAAC,OAAO,CAAC,CAAS,EAAE,CAAS,EAAE,C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CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACvE,CAAC;IACD,0DAA0D;IACnD,mBAAmB,CAAC,UAAmB,EAAE,MAAgB;QAC9D,OAAO,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;IACjH,CAAC;IACD;;;OAGG;IACa,cAAc,CAAC,UAAmB,EAAE,YAAoB,mBAAQ,CAAC,mBAAmB;QAClG,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;IACzC,CAAC;CACF;AA1UD,oEA0UC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\r\nimport { Plane3d } from \"./Plane3d\";\r\nimport { Point4d } from \"../geometry4d/Point4d\";\r\nimport { Angle } from \"./Angle\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { Transform } from \"./Transform\";\r\nimport { XAndY } from \"./XYZProps\";\r\n\r\n/**\r\n * A plane defined by\r\n * * Any point on the plane.\r\n * * a unit normal.\r\n * @public\r\n */\r\nexport class Plane3dByOriginAndUnitNormal extends Plane3d implements BeJSONFunctions {\r\n private _origin: Point3d;\r\n private _normal: Vector3d;\r\n // constructor captures references !!!\r\n private constructor(origin: Point3d, normal: Vector3d) {\r\n super();\r\n this._origin = origin;\r\n this._normal = normal;\r\n }\r\n // This is private because it does not check validity of the unit vector.\r\n private static _create(x: number, y: number, z: number, u: number, v: number, w: number) {\r\n return new Plane3dByOriginAndUnitNormal(Point3d.create(x, y, z), Vector3d.create(u, v, w));\r\n }\r\n /**\r\n * Create a plane parallel to the XY plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createXYPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 0, 1);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 0, 1);\r\n }\r\n /**\r\n * Create a plane parallel to the YZ plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createYZPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 1, 0, 0);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 1, 0, 0);\r\n }\r\n /**\r\n * Create a plane parallel to the ZX plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createZXPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 1, 0);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 1, 0);\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal with given origin and normal.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if `normal.normalize()` returns undefined.\r\n */\r\n public static create(\r\n origin: Point3d, normal: Vector3d, result?: Plane3dByOriginAndUnitNormal\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n if (result) {\r\n if (normal.normalize(result._normal) === undefined)\r\n return undefined;\r\n origin.clone(result._origin);\r\n return result;\r\n }\r\n const normalized = normal.normalize();\r\n if (normalized === undefined)\r\n return undefined;\r\n return new Plane3dByOriginAndUnitNormal(origin.clone(), normalized);\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal from a variety of plane types.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if `source.getUnitNormal()` returns undefined.\r\n */\r\n public static createFrom(\r\n source: Plane3d, result?: Plane3dByOriginAndUnitNormal\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n if (source instanceof Plane3dByOriginAndUnitNormal)\r\n return source.clone(result);\r\n if (result) {\r\n if (source.getUnitNormal(result._normal) === undefined)\r\n return undefined;\r\n source.getAnyPointOnPlane(result._origin);\r\n return result;\r\n }\r\n const normal = source.getUnitNormal();\r\n if (normal === undefined)\r\n return undefined;\r\n const origin = source.getAnyPointOnPlane();\r\n return new Plane3dByOriginAndUnitNormal(origin, normal);\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal with direct coordinates of origin and normal.\r\n * * Returns undefined if the normal vector is all zeros.\r\n * * If unable to normalize return undefined. (And if result is given it is left unchanged)\r\n */\r\n public static createXYZUVW(\r\n ax: number, ay: number, az: number, ux: number, uy: number, uz: number, result?: Plane3dByOriginAndUnitNormal\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const magU = Geometry.hypotenuseXYZ(ux, uy, uz);\r\n if (magU < Geometry.smallMetricDistance)\r\n return undefined;\r\n if (result) {\r\n result._origin.set(ax, ay, az);\r\n result._normal.set(ux / magU, uy / magU, uz / magU);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(Point3d.create(ax, ay, az), Vector3d.create(ux / magU, uy / magU, uz / magU));\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal with unit normal (a) in the xy plane (b) perpendicular to the line\r\n * defined by xy parts of origin to target.\r\n * * origin and normal both have z = 0.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if the normal vector is all zeros.\r\n */\r\n public static createOriginAndTargetXY(\r\n origin: XAndY, target: XAndY, result?: Plane3dByOriginAndUnitNormal\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const ux = target.x - origin.x;\r\n const uy = target.y - origin.y;\r\n return this.createXYZUVW(origin.x, origin.y, 0.0, uy, -ux, 0.0, result);\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal with xy origin (at z=0) and normal angle in xy plane.\r\n * * Returns undefined if the normal vector is all zeros.\r\n */\r\n public static createXYAngle(\r\n x: number, y: number, normalAngleFromX: Angle, result?: Plane3dByOriginAndUnitNormal\r\n ): Plane3dByOriginAndUnitNormal {\r\n if (result) {\r\n result._origin.set(x, y, 0.0);\r\n result._normal.set(normalAngleFromX.cos(), normalAngleFromX.sin(), 0.0);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(\r\n Point3d.create(x, y, 0), Vector3d.create(normalAngleFromX.cos(), normalAngleFromX.sin())\r\n );\r\n }\r\n /**\r\n * Create a plane defined by two points and an in-plane vector.\r\n * @param pointA any point in the plane\r\n * @param pointB any other point in the plane\r\n * @param vector any vector in the plane but not parallel to the vector from pointA to pointB\r\n */\r\n public static createPointPointVectorInPlane(\r\n pointA: Point3d, pointB: Point3d, vector: Vector3d\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = vector.crossProductStartEnd(pointA, pointB);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n /**\r\n * Create a plane defined by three points.\r\n * @param pointA any point in the plane. This will be the origin.\r\n * @param pointB any other point in the plane\r\n * @param pointC any third point in the plane but not on the line of pointA and pointB\r\n */\r\n public static createOriginAndTargets(\r\n pointA: Point3d, pointB: Point3d, pointC: Point3d\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = pointA.crossProductToPoints(pointB, pointC);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n /**\r\n * Create a plane defined by a point and two vectors in the plane\r\n * @param pointA any point in the plane\r\n * @param vectorB any vector in the plane\r\n * @param vectorC any vector in the plane but not parallel to vectorB\r\n */\r\n public static createOriginAndVectors(\r\n pointA: Point3d, vectorB: Vector3d, vectorC: Vector3d\r\n ): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = vectorB.crossProduct(vectorC);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n /** Test for (toleranced) equality with `other` */\r\n public isAlmostEqual(other: Plane3dByOriginAndUnitNormal): boolean {\r\n return this._origin.isAlmostEqual(other._origin) && this._normal.isAlmostEqual(other._normal);\r\n }\r\n /** Parse a json fragment `{origin: [x,y,z], normal: [ux,uy,uz]}` */\r\n public setFromJSON(json?: any): void {\r\n if (!json) {\r\n this._origin.set(0, 0, 0);\r\n this._normal.set(0, 0, 1);\r\n } else {\r\n this._origin.setFromJSON(json.origin);\r\n this._normal.setFromJSON(json.normal);\r\n }\r\n }\r\n /**\r\n * Convert to a JSON object.\r\n * @return {*} [origin,normal]\r\n */\r\n public toJSON(): any {\r\n return { origin: this._origin.toJSON(), normal: this._normal.toJSON() };\r\n }\r\n /**\r\n * Create a new Plane3dByOriginAndUnitNormal from json fragment.\r\n * * See `Plane3dByOriginAndUnitNormal.setFromJSON`\r\n */\r\n public static fromJSON(json?: any): Plane3dByOriginAndUnitNormal {\r\n const result = Plane3dByOriginAndUnitNormal.createXYPlane();\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Return a reference to the origin. */\r\n public getOriginRef(): Point3d {\r\n return this._origin;\r\n }\r\n /** Return a reference to the unit normal. */\r\n public getNormalRef(): Vector3d {\r\n return this._normal;\r\n }\r\n /**\r\n * Return coordinate axes (as a transform) with\r\n * * origin at plane origin\r\n * * z axis in direction of plane normal.\r\n * * x,y axes in plane.\r\n */\r\n public getLocalToWorld(): Transform {\r\n const axes = Matrix3d.createRigidHeadsUp(this._normal, AxisOrder.ZXY);\r\n return Transform.createRefs(this._origin.clone(), axes);\r\n }\r\n /** Return a (singular) transform which projects points to this plane. */\r\n public getProjectionToPlane(): Transform {\r\n const axes = Matrix3d.createIdentity();\r\n axes.addScaledOuterProductInPlace(this._normal, this._normal, -1.0);\r\n axes.markSingular();\r\n return Transform.createFixedPointAndMatrix(this._origin, axes);\r\n }\r\n /** Copy coordinates from the given origin and normal. */\r\n public set(origin: Point3d, normal: Vector3d): void {\r\n this._origin.setFrom(origin);\r\n this._normal.setFrom(normal);\r\n }\r\n /** Return a deep clone (point and normal cloned) */\r\n public clone(result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal {\r\n if (result) {\r\n result.set(this._origin, this._normal);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(this._origin.clone(), this._normal.clone());\r\n }\r\n /** Create a clone and return the transform of the clone. */\r\n public cloneTransformed(transform: Transform, inverse: boolean = false): Plane3dByOriginAndUnitNormal | undefined {\r\n const result = this.clone();\r\n if (inverse) {\r\n transform.multiplyInversePoint3d(result._origin, result._origin);\r\n if (transform.matrix.multiplyTransposeVector(result._normal, result._normal) !== undefined\r\n && result._normal.normalizeInPlace())\r\n return result;\r\n } else {\r\n transform.multiplyPoint3d(result._origin, result._origin);\r\n if (transform.matrix.multiplyInverseTranspose(result._normal, result._normal) !== undefined\r\n && result._normal.normalizeInPlace())\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n /** Copy data from the given plane. */\r\n public setFrom(source: Plane3dByOriginAndUnitNormal): void {\r\n this.set(source._origin, source._normal);\r\n }\r\n /** Return the altitude of spacePoint above or below the plane. (Below is negative) */\r\n public altitude(spacePoint: Point3d): number {\r\n return this._normal.dotProductStartEnd(this._origin, spacePoint);\r\n }\r\n /** Return the altitude of point (x,y) given xy parts using only the xy parts of origin and unit normal */\r\n public altitudeXY(x: number, y: number): number {\r\n return (x - this._origin.x) * this._normal.x + (y - this._origin.y) * this._normal.y;\r\n }\r\n /** Return the x component of the normal used to evaluate altitude. */\r\n public normalX(): number {\r\n return this._normal.x;\r\n }\r\n /** Return the x component of the normal used to evaluate altitude. */\r\n public normalY(): number {\r\n return this._normal.y;\r\n }\r\n /** Return the z component of the normal used to evaluate altitude. */\r\n public normalZ(): number {\r\n return this._normal.z;\r\n }\r\n /** Return (a clone of) the unit normal. */\r\n public override getUnitNormal(result?: Vector3d): Vector3d | undefined {\r\n return this._normal.clone(result);\r\n }\r\n /** Return (a clone of) the origin. */\r\n public override getAnyPointOnPlane(result?: Point3d): Point3d {\r\n // This function returns the plane origin. In general, a point x is on the plane if and only if (x-o).n = 0.\r\n return this._origin.clone(result);\r\n }\r\n /** Return the signed altitude of weighted spacePoint above or below the plane. (Below is negative) */\r\n public weightedAltitude(spacePoint: Point4d): number {\r\n return this._normal.dotProductStart3dEnd4d(this._origin, spacePoint);\r\n }\r\n /** Return any point at specified (signed) altitude. */\r\n public altitudeToPoint(altitude: number, result?: Point3d): Point3d {\r\n return this._origin.plusScaled(this._normal, altitude, result);\r\n }\r\n /**\r\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\r\n * for a point moving at speed one along the spaceVector.\r\n */\r\n public velocityXYZ(x: number, y: number, z: number): number {\r\n return this._normal.dotProductXYZ(x, y, z);\r\n }\r\n /**\r\n * Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\r\n * for a point moving at speed one along the spaceVector.\r\n */\r\n public velocity(spaceVector: Vector3d): number {\r\n return this._normal.dotProduct(spaceVector);\r\n }\r\n /** Return the altitude of a point given as separate x,y,z components. */\r\n public altitudeXYZ(x: number, y: number, z: number): number {\r\n return this._normal.dotProductStartEndXYZ(this._origin, x, y, z);\r\n }\r\n /** Return the altitude of a point given as separate x,y,z,w components. */\r\n public altitudeXYZW(x: number, y: number, z: number, w: number): number {\r\n return this._normal.dotProductStartEndXYZW(this._origin, x, y, z, w);\r\n }\r\n /** Return the projection of spacePoint onto the plane. */\r\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\r\n return spacePoint.plusScaled(this._normal, -this._normal.dotProductStartEnd(this._origin, spacePoint), result);\r\n }\r\n /**\r\n * Returns true if spacePoint is within distance tolerance of the plane.\r\n * * This logic is identical to the [[Plane3d]] method but avoids a level of function call.\r\n */\r\n public override isPointInPlane(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n const altitude = this._normal.dotProductStartEnd(this._origin, spacePoint);\r\n return Math.abs(altitude) <= tolerance;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plane3dByOriginAndVectors.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndVectors.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAa,eAAe,EAAY,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGpC;;;;;;;;;;;;;;GAcG;AACH,qBAAa,yBAA0B,SAAQ,OAAQ,YAAW,eAAe;IAC/E,2BAA2B;IACpB,MAAM,EAAE,OAAO,CAAC;IACvB,gCAAgC;IACzB,OAAO,EAAE,QAAQ,CAAC;IACzB,gCAAgC;IACzB,OAAO,EAAE,QAAQ,CAAC;IACzB,OAAO;IAMP,6DAA6D;WAC/C,sBAAsB,CAClC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,yBAAyB,GACxF,yBAAyB;IAS5B,4BAA4B;IACrB,KAAK,CAAC,MA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I,MAAM;IAIxB,qHAAqH;IAC9G,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAQpC,qHAAqH;IAC9G,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAQ3D,0HAA0H;IACnH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAQ1C,0HAA0H;IACnH,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAQ3D;;;;OAIG;IACI,gBAAgB,CAAC,IAAI,EAAE,OAAO;IAOrC;;;;OAIG;IACI,mBAAmB,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;CAuB3E"}
|
|
@@ -252,6 +252,8 @@ class Plane3dByOriginAndVectors extends Plane3d_1.Plane3d {
|
|
|
252
252
|
* Return some point on the plane.
|
|
253
253
|
*/
|
|
254
254
|
getAnyPointOnPlane(result) {
|
|
255
|
+
// This function returns the plane origin. In general, a point x is on the plane if
|
|
256
|
+
// and only if x = o + a*u + b*v, where a and b are scalars.
|
|
255
257
|
return this.origin.clone(result);
|
|
256
258
|
}
|
|
257
259
|
/** Return (if possible) a ray with origin at plane origin, direction as unit normal to the plane */
|