@itwin/core-geometry 4.1.0-dev.67 → 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/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,eAAe,EAAY,MAAM,aAA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C,EAAE,OAAO,GAAG,OAAO;IAG1E;;;OAGG;IACa,cAAc,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,GAAE,MAAqC,GAAG,OAAO;CAI/G"}
|
|
@@ -54,7 +54,8 @@ export class Plane3dByOriginAndUnitNormal extends Plane3d {
|
|
|
54
54
|
return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 1, 0);
|
|
55
55
|
return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 1, 0);
|
|
56
56
|
}
|
|
57
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* Create a new Plane3dByOriginAndUnitNormal with given origin and normal.
|
|
58
59
|
* * The inputs are NOT captured.
|
|
59
60
|
* * Returns undefined if `normal.normalize()` returns undefined.
|
|
60
61
|
*/
|
|
@@ -70,7 +71,8 @@ export class Plane3dByOriginAndUnitNormal extends Plane3d {
|
|
|
70
71
|
return undefined;
|
|
71
72
|
return new Plane3dByOriginAndUnitNormal(origin.clone(), normalized);
|
|
72
73
|
}
|
|
73
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* Create a new Plane3dByOriginAndUnitNormal from a variety of plane types.
|
|
74
76
|
* * The inputs are NOT captured.
|
|
75
77
|
* * Returns undefined if `source.getUnitNormal()` returns undefined.
|
|
76
78
|
*/
|
|
@@ -89,7 +91,8 @@ export class Plane3dByOriginAndUnitNormal extends Plane3d {
|
|
|
89
91
|
const origin = source.getAnyPointOnPlane();
|
|
90
92
|
return new Plane3dByOriginAndUnitNormal(origin, normal);
|
|
91
93
|
}
|
|
92
|
-
/**
|
|
94
|
+
/**
|
|
95
|
+
* Create a new Plane3dByOriginAndUnitNormal with direct coordinates of origin and normal.
|
|
93
96
|
* * Returns undefined if the normal vector is all zeros.
|
|
94
97
|
* * If unable to normalize return undefined. (And if result is given it is left unchanged)
|
|
95
98
|
*/
|
|
@@ -104,7 +107,9 @@ export class Plane3dByOriginAndUnitNormal extends Plane3d {
|
|
|
104
107
|
}
|
|
105
108
|
return new Plane3dByOriginAndUnitNormal(Point3d.create(ax, ay, az), Vector3d.create(ux / magU, uy / magU, uz / magU));
|
|
106
109
|
}
|
|
107
|
-
/**
|
|
110
|
+
/**
|
|
111
|
+
* Create a new Plane3dByOriginAndUnitNormal with unit normal (a) in the xy plane (b) perpendicular to the line
|
|
112
|
+
* defined by xy parts of origin to target.
|
|
108
113
|
* * origin and normal both have z = 0.
|
|
109
114
|
* * The inputs are NOT captured.
|
|
110
115
|
* * Returns undefined if the normal vector is all zeros.
|
|
@@ -114,7 +119,8 @@ export class Plane3dByOriginAndUnitNormal extends Plane3d {
|
|
|
114
119
|
const uy = target.y - origin.y;
|
|
115
120
|
return this.createXYZUVW(origin.x, origin.y, 0.0, uy, -ux, 0.0, result);
|
|
116
121
|
}
|
|
117
|
-
/**
|
|
122
|
+
/**
|
|
123
|
+
* Create a new Plane3dByOriginAndUnitNormal with xy origin (at z=0) and normal angle in xy plane.
|
|
118
124
|
* * Returns undefined if the normal vector is all zeros.
|
|
119
125
|
*/
|
|
120
126
|
static createXYAngle(x, y, normalAngleFromX, result) {
|
|
@@ -125,7 +131,8 @@ export class Plane3dByOriginAndUnitNormal extends Plane3d {
|
|
|
125
131
|
}
|
|
126
132
|
return new Plane3dByOriginAndUnitNormal(Point3d.create(x, y, 0), Vector3d.create(normalAngleFromX.cos(), normalAngleFromX.sin()));
|
|
127
133
|
}
|
|
128
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* Create a plane defined by two points and an in-plane vector.
|
|
129
136
|
* @param pointA any point in the plane
|
|
130
137
|
* @param pointB any other point in the plane
|
|
131
138
|
* @param vector any vector in the plane but not parallel to the vector from pointA to pointB
|
|
@@ -136,7 +143,8 @@ export class Plane3dByOriginAndUnitNormal extends Plane3d {
|
|
|
136
143
|
return new Plane3dByOriginAndUnitNormal(pointA, cross);
|
|
137
144
|
return undefined;
|
|
138
145
|
}
|
|
139
|
-
/**
|
|
146
|
+
/**
|
|
147
|
+
* Create a plane defined by three points.
|
|
140
148
|
* @param pointA any point in the plane. This will be the origin.
|
|
141
149
|
* @param pointB any other point in the plane
|
|
142
150
|
* @param pointC any third point in the plane but not on the line of pointA and pointB
|
|
@@ -147,7 +155,8 @@ export class Plane3dByOriginAndUnitNormal extends Plane3d {
|
|
|
147
155
|
return new Plane3dByOriginAndUnitNormal(pointA, cross);
|
|
148
156
|
return undefined;
|
|
149
157
|
}
|
|
150
|
-
/**
|
|
158
|
+
/**
|
|
159
|
+
* Create a plane defined by a point and two vectors in the plane
|
|
151
160
|
* @param pointA any point in the plane
|
|
152
161
|
* @param vectorB any vector in the plane
|
|
153
162
|
* @param vectorC any vector in the plane but not parallel to vectorB
|
|
@@ -158,7 +167,7 @@ export class Plane3dByOriginAndUnitNormal extends Plane3d {
|
|
|
158
167
|
return new Plane3dByOriginAndUnitNormal(pointA, cross);
|
|
159
168
|
return undefined;
|
|
160
169
|
}
|
|
161
|
-
/**
|
|
170
|
+
/** Test for (toleranced) equality with `other` */
|
|
162
171
|
isAlmostEqual(other) {
|
|
163
172
|
return this._origin.isAlmostEqual(other._origin) && this._normal.isAlmostEqual(other._normal);
|
|
164
173
|
}
|
|
@@ -177,8 +186,11 @@ export class Plane3dByOriginAndUnitNormal extends Plane3d {
|
|
|
177
186
|
* Convert to a JSON object.
|
|
178
187
|
* @return {*} [origin,normal]
|
|
179
188
|
*/
|
|
180
|
-
toJSON() {
|
|
181
|
-
|
|
189
|
+
toJSON() {
|
|
190
|
+
return { origin: this._origin.toJSON(), normal: this._normal.toJSON() };
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Create a new Plane3dByOriginAndUnitNormal from json fragment.
|
|
182
194
|
* * See `Plane3dByOriginAndUnitNormal.setFromJSON`
|
|
183
195
|
*/
|
|
184
196
|
static fromJSON(json) {
|
|
@@ -187,10 +199,15 @@ export class Plane3dByOriginAndUnitNormal extends Plane3d {
|
|
|
187
199
|
return result;
|
|
188
200
|
}
|
|
189
201
|
/** Return a reference to the origin. */
|
|
190
|
-
getOriginRef() {
|
|
202
|
+
getOriginRef() {
|
|
203
|
+
return this._origin;
|
|
204
|
+
}
|
|
191
205
|
/** Return a reference to the unit normal. */
|
|
192
|
-
getNormalRef() {
|
|
193
|
-
|
|
206
|
+
getNormalRef() {
|
|
207
|
+
return this._normal;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Return coordinate axes (as a transform) with
|
|
194
211
|
* * origin at plane origin
|
|
195
212
|
* * z axis in direction of plane normal.
|
|
196
213
|
* * x,y axes in plane.
|
|
@@ -199,8 +216,7 @@ export class Plane3dByOriginAndUnitNormal extends Plane3d {
|
|
|
199
216
|
const axes = Matrix3d.createRigidHeadsUp(this._normal, AxisOrder.ZXY);
|
|
200
217
|
return Transform.createRefs(this._origin.clone(), axes);
|
|
201
218
|
}
|
|
202
|
-
/** Return a (singular) transform which projects points to this plane.
|
|
203
|
-
*/
|
|
219
|
+
/** Return a (singular) transform which projects points to this plane. */
|
|
204
220
|
getProjectionToPlane() {
|
|
205
221
|
const axes = Matrix3d.createIdentity();
|
|
206
222
|
axes.addScaledOuterProductInPlace(this._normal, this._normal, -1.0);
|
|
@@ -212,7 +228,7 @@ export class Plane3dByOriginAndUnitNormal extends Plane3d {
|
|
|
212
228
|
this._origin.setFrom(origin);
|
|
213
229
|
this._normal.setFrom(normal);
|
|
214
230
|
}
|
|
215
|
-
/**
|
|
231
|
+
/** Return a deep clone (point and normal cloned) */
|
|
216
232
|
clone(result) {
|
|
217
233
|
if (result) {
|
|
218
234
|
result.set(this._origin, this._normal);
|
|
@@ -242,51 +258,56 @@ export class Plane3dByOriginAndUnitNormal extends Plane3d {
|
|
|
242
258
|
this.set(source._origin, source._normal);
|
|
243
259
|
}
|
|
244
260
|
/** Return the altitude of spacePoint above or below the plane. (Below is negative) */
|
|
245
|
-
altitude(spacePoint) {
|
|
261
|
+
altitude(spacePoint) {
|
|
262
|
+
return this._normal.dotProductStartEnd(this._origin, spacePoint);
|
|
263
|
+
}
|
|
246
264
|
/** Return the altitude of point (x,y) given xy parts using only the xy parts of origin and unit normal */
|
|
247
265
|
altitudeXY(x, y) {
|
|
248
266
|
return (x - this._origin.x) * this._normal.x + (y - this._origin.y) * this._normal.y;
|
|
249
267
|
}
|
|
250
|
-
/**
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Return (a clone of) the unit normal.
|
|
264
|
-
*/
|
|
268
|
+
/** Return the x component of the normal used to evaluate altitude. */
|
|
269
|
+
normalX() {
|
|
270
|
+
return this._normal.x;
|
|
271
|
+
}
|
|
272
|
+
/** Return the x component of the normal used to evaluate altitude. */
|
|
273
|
+
normalY() {
|
|
274
|
+
return this._normal.y;
|
|
275
|
+
}
|
|
276
|
+
/** Return the z component of the normal used to evaluate altitude. */
|
|
277
|
+
normalZ() {
|
|
278
|
+
return this._normal.z;
|
|
279
|
+
}
|
|
280
|
+
/** Return (a clone of) the unit normal. */
|
|
265
281
|
getUnitNormal(result) {
|
|
266
282
|
return this._normal.clone(result);
|
|
267
283
|
}
|
|
268
|
-
/**
|
|
269
|
-
* Return (a clone of) the origin.
|
|
270
|
-
*/
|
|
284
|
+
/** Return (a clone of) the origin. */
|
|
271
285
|
getAnyPointOnPlane(result) {
|
|
286
|
+
// This function returns the plane origin. In general, a point x is on the plane if and only if (x-o).n = 0.
|
|
272
287
|
return this._origin.clone(result);
|
|
273
288
|
}
|
|
274
289
|
/** Return the signed altitude of weighted spacePoint above or below the plane. (Below is negative) */
|
|
275
290
|
weightedAltitude(spacePoint) {
|
|
276
291
|
return this._normal.dotProductStart3dEnd4d(this._origin, spacePoint);
|
|
277
292
|
}
|
|
278
|
-
/**
|
|
293
|
+
/** Return any point at specified (signed) altitude. */
|
|
279
294
|
altitudeToPoint(altitude, result) {
|
|
280
295
|
return this._origin.plusScaled(this._normal, altitude, result);
|
|
281
296
|
}
|
|
282
|
-
/**
|
|
297
|
+
/**
|
|
298
|
+
* Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude
|
|
283
299
|
* for a point moving at speed one along the spaceVector.
|
|
284
300
|
*/
|
|
285
|
-
velocityXYZ(x, y, z) {
|
|
286
|
-
|
|
301
|
+
velocityXYZ(x, y, z) {
|
|
302
|
+
return this._normal.dotProductXYZ(x, y, z);
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude
|
|
287
306
|
* for a point moving at speed one along the spaceVector.
|
|
288
307
|
*/
|
|
289
|
-
velocity(spaceVector) {
|
|
308
|
+
velocity(spaceVector) {
|
|
309
|
+
return this._normal.dotProduct(spaceVector);
|
|
310
|
+
}
|
|
290
311
|
/** Return the altitude of a point given as separate x,y,z components. */
|
|
291
312
|
altitudeXYZ(x, y, z) {
|
|
292
313
|
return this._normal.dotProductStartEndXYZ(this._origin, x, y, z);
|
|
@@ -299,9 +320,10 @@ export class Plane3dByOriginAndUnitNormal extends Plane3d {
|
|
|
299
320
|
projectPointToPlane(spacePoint, result) {
|
|
300
321
|
return spacePoint.plusScaled(this._normal, -this._normal.dotProductStartEnd(this._origin, spacePoint), result);
|
|
301
322
|
}
|
|
302
|
-
/**
|
|
323
|
+
/**
|
|
324
|
+
* Returns true if spacePoint is within distance tolerance of the plane.
|
|
303
325
|
* * This logic is identical to the [[Plane3d]] method but avoids a level of function call.
|
|
304
|
-
|
|
326
|
+
*/
|
|
305
327
|
isPointInPlane(spacePoint, tolerance = Geometry.smallMetricDistance) {
|
|
306
328
|
const altitude = this._normal.dotProductStartEnd(this._origin, spacePoint);
|
|
307
329
|
return Math.abs(altitude) <= tolerance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plane3dByOriginAndUnitNormal.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOri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AAE,CAAS,EAAE,CAAS,IAAY,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3G;;OAEG;IACI,QAAQ,CAAC,WAAqB,IAAY,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC/F,yEAAyE;IAClE,WAAW,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,2EAA2E;IACpE,YAAY,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,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;;MAEE;IACc,cAAc,CAAC,UAAmB,EAAE,YAAoB,QAAQ,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","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 /** 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,OAAO,EAAE,SAAS,EAAmB,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;;;GAKG;AACH,MAAM,OAAO,4BAA6B,SAAQ,OAAO;IAGvD,sCAAsC;IACtC,YAAoB,MAAe,EAAE,MAAgB;QACnD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAA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AY,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,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,QAAQ,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","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,EAA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;IACI,OAAO,IAAI,MAAM;IAIxB;;;OAGG;IACI,OAAO,IAAI,MAAM;IAIxB;;;OAGG;IACI,OAAO,IAAI,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"}
|
|
@@ -249,6 +249,8 @@ export class Plane3dByOriginAndVectors extends Plane3d {
|
|
|
249
249
|
* Return some point on the plane.
|
|
250
250
|
*/
|
|
251
251
|
getAnyPointOnPlane(result) {
|
|
252
|
+
// This function returns the plane origin. In general, a point x is on the plane if
|
|
253
|
+
// and only if x = o + a*u + b*v, where a and b are scalars.
|
|
252
254
|
return this.origin.clone(result);
|
|
253
255
|
}
|
|
254
256
|
/** Return (if possible) a ray with origin at plane origin, direction as unit normal to the plane */
|