@math.gl/geospatial 4.2.0-alpha.3 → 4.2.0-alpha.5
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/LICENSE +51 -0
- package/dist/ellipsoid-tangent-plane.d.ts +9 -7
- package/dist/ellipsoid-tangent-plane.d.ts.map +1 -1
- package/dist/ellipsoid-tangent-plane.js +14 -24
- package/dist/ellipsoid-tangent-plane.js.map +1 -1
- package/dist/ellipsoid.d.ts +12 -5
- package/dist/ellipsoid.d.ts.map +1 -1
- package/dist/ellipsoid.js.map +1 -1
- package/dist/index.cjs +227 -26
- package/dist/index.cjs.map +3 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lng-lat-rectangle.d.ts.map +1 -1
- package/dist/make-obb-from-region.d.ts +23 -6
- package/dist/make-obb-from-region.d.ts.map +1 -1
- package/dist/make-obb-from-region.js +111 -38
- package/dist/make-obb-from-region.js.map +1 -1
- package/package.json +5 -5
- package/src/ellipsoid-tangent-plane.ts +22 -33
- package/src/ellipsoid.ts +12 -5
- package/src/index.ts +2 -0
- package/src/lng-lat-rectangle.ts +1 -1
- package/src/make-obb-from-region.ts +179 -68
package/LICENSE
CHANGED
|
@@ -22,6 +22,33 @@ THE SOFTWARE.
|
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
|
+
Some primitive tessellation approaches were originally inspired by the TDL WebGL samples under
|
|
26
|
+
the New BSD License:
|
|
27
|
+
|
|
28
|
+
Copyright (c) 2011, Google Inc. All rights reserved.
|
|
29
|
+
|
|
30
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted
|
|
31
|
+
provided that the following conditions are met:
|
|
32
|
+
|
|
33
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions
|
|
34
|
+
and the following disclaimer.
|
|
35
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of
|
|
36
|
+
conditions and the following disclaimer in the documentation and/or other materials provided
|
|
37
|
+
with the distribution.
|
|
38
|
+
3. Neither the name of Google Inc. nor the names of its contributors may be used to endorse or
|
|
39
|
+
promote products derived from this software without specific prior written permission.
|
|
40
|
+
|
|
41
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
|
42
|
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
43
|
+
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
44
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
45
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
46
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
|
47
|
+
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
48
|
+
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
25
52
|
math.gl builds on docs and code from "gl-matrix", which is MIT licensed as follows:
|
|
26
53
|
|
|
27
54
|
Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.
|
|
@@ -87,3 +114,27 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
87
114
|
See the License for the specific language governing permissions and limitations under the License.
|
|
88
115
|
|
|
89
116
|
Cesium-derived code can be found in the submodule: modules/3d-tiles
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
The @math.gl/geometry primitive tessellators are adapted from luma.gl under the MIT License:
|
|
121
|
+
|
|
122
|
+
Copyright (c) 2020 vis.gl contributors
|
|
123
|
+
|
|
124
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
125
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
126
|
+
in the Software without restriction, including without limitation the rights
|
|
127
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
128
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
129
|
+
furnished to do so, subject to the following conditions:
|
|
130
|
+
|
|
131
|
+
The above copyright notice and this permission notice shall be included in
|
|
132
|
+
all copies or substantial portions of the Software.
|
|
133
|
+
|
|
134
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
135
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
136
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
137
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
138
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
139
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
140
|
+
THE SOFTWARE.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Vector2, Vector3 } from '@math.gl/core';
|
|
2
2
|
import { Plane } from '@math.gl/culling';
|
|
3
|
-
|
|
3
|
+
import { Ellipsoid } from "./ellipsoid.js";
|
|
4
|
+
/** A two-dimensional east-north plane tangent to an ellipsoid. */
|
|
4
5
|
export declare class EllipsoidTangentPlane {
|
|
5
6
|
private _origin;
|
|
6
7
|
private _xAxis;
|
|
@@ -8,17 +9,18 @@ export declare class EllipsoidTangentPlane {
|
|
|
8
9
|
private _plane;
|
|
9
10
|
/**
|
|
10
11
|
* Creates a new plane tangent to the WGS84 ellipsoid at the provided origin.
|
|
11
|
-
* If origin is not on the surface of the ellipsoid,
|
|
12
|
+
* If origin is not on the surface of the ellipsoid, its surface projection will be used.
|
|
12
13
|
*
|
|
13
|
-
* @param
|
|
14
|
+
* @param origin A nonzero Cartesian point on or near the ellipsoid.
|
|
15
|
+
* @param ellipsoid The ellipsoid to which the origin belongs. Defaults to WGS84.
|
|
14
16
|
*/
|
|
15
|
-
constructor(origin: number[]);
|
|
17
|
+
constructor(origin: number[], ellipsoid?: Ellipsoid);
|
|
16
18
|
/**
|
|
17
19
|
* Computes the projection of the provided 3D position onto the 2D plane, along the plane normal.
|
|
18
20
|
*
|
|
19
|
-
* @param
|
|
20
|
-
* @param
|
|
21
|
-
* @returns
|
|
21
|
+
* @param cartesian The WGS84 Cartesian point to project.
|
|
22
|
+
* @param result The optional object in which to store the local east-north coordinates.
|
|
23
|
+
* @returns The supplied result or a new Vector2.
|
|
22
24
|
*/
|
|
23
25
|
projectPointToNearestOnPlane(cartesian: Vector3, result?: Vector2): Vector2;
|
|
24
26
|
get plane(): Plane;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ellipsoid-tangent-plane.d.ts","sourceRoot":"","sources":["../src/ellipsoid-tangent-plane.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,OAAO,EAAE,OAAO,EAAU,MAAM,eAAe,CAAC;AACxD,OAAO,EAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"ellipsoid-tangent-plane.d.ts","sourceRoot":"","sources":["../src/ellipsoid-tangent-plane.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,OAAO,EAAE,OAAO,EAAU,MAAM,eAAe,CAAC;AACxD,OAAO,EAAC,KAAK,EAAC,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAC,SAAS,EAAC,uBAAoB;AAOtC,kEAAkE;AAClE,qBAAa,qBAAqB;IAChC,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,MAAM,CAAQ;IAEtB;;;;;;OAMG;gBACS,MAAM,EAAE,MAAM,EAAE,EAAE,SAAS,GAAE,SAA2B;IAapE;;;;;;OAMG;IACH,4BAA4B,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAiB3E,IAAI,KAAK,IAAI,KAAK,CAEjB;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED,IAAI,KAAK,IAAI,OAAO,CAEnB;CACF"}
|
|
@@ -4,51 +4,41 @@
|
|
|
4
4
|
// This file is derived from the Cesium library under Apache 2 license
|
|
5
5
|
// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
|
|
6
6
|
import { Vector2, Vector3, Matrix4 } from '@math.gl/core';
|
|
7
|
-
import { Plane
|
|
7
|
+
import { Plane } from '@math.gl/culling';
|
|
8
8
|
import { Ellipsoid } from "./ellipsoid.js";
|
|
9
9
|
const scratchOrigin = new Vector3();
|
|
10
10
|
const scratchCart3 = new Vector3();
|
|
11
11
|
const scratchEastNorthUp = new Matrix4();
|
|
12
|
-
const scratchPlane = new Plane();
|
|
13
|
-
const scratchProjectPointOntoPlaneRay = new Ray();
|
|
14
12
|
const scratchProjectPointOntoPlaneCartesian3 = new Vector3();
|
|
15
|
-
|
|
16
|
-
/** A plane tangent to the WGS84 ellipsoid at the provided origin */
|
|
13
|
+
/** A two-dimensional east-north plane tangent to an ellipsoid. */
|
|
17
14
|
export class EllipsoidTangentPlane {
|
|
18
15
|
/**
|
|
19
16
|
* Creates a new plane tangent to the WGS84 ellipsoid at the provided origin.
|
|
20
|
-
* If origin is not on the surface of the ellipsoid,
|
|
17
|
+
* If origin is not on the surface of the ellipsoid, its surface projection will be used.
|
|
21
18
|
*
|
|
22
|
-
* @param
|
|
19
|
+
* @param origin A nonzero Cartesian point on or near the ellipsoid.
|
|
20
|
+
* @param ellipsoid The ellipsoid to which the origin belongs. Defaults to WGS84.
|
|
23
21
|
*/
|
|
24
|
-
constructor(origin) {
|
|
25
|
-
|
|
26
|
-
const eastNorthUp =
|
|
27
|
-
this._origin =
|
|
22
|
+
constructor(origin, ellipsoid = Ellipsoid.WGS84) {
|
|
23
|
+
const originOnSurface = ellipsoid.scaleToGeodeticSurface(origin, scratchOrigin);
|
|
24
|
+
const eastNorthUp = ellipsoid.eastNorthUpToFixedFrame(originOnSurface, scratchEastNorthUp);
|
|
25
|
+
this._origin = new Vector3(originOnSurface);
|
|
28
26
|
this._xAxis = new Vector3(scratchCart3.from(eastNorthUp.getColumn(0)));
|
|
29
27
|
this._yAxis = new Vector3(scratchCart3.from(eastNorthUp.getColumn(1)));
|
|
30
28
|
const normal = new Vector3(scratchCart3.from(eastNorthUp.getColumn(2)));
|
|
31
|
-
this._plane =
|
|
29
|
+
this._plane = new Plane().fromPointNormal(this._origin, normal);
|
|
32
30
|
}
|
|
33
31
|
/**
|
|
34
32
|
* Computes the projection of the provided 3D position onto the 2D plane, along the plane normal.
|
|
35
33
|
*
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
38
|
-
* @returns
|
|
34
|
+
* @param cartesian The WGS84 Cartesian point to project.
|
|
35
|
+
* @param result The optional object in which to store the local east-north coordinates.
|
|
36
|
+
* @returns The supplied result or a new Vector2.
|
|
39
37
|
*/
|
|
40
38
|
projectPointToNearestOnPlane(cartesian, result) {
|
|
41
39
|
if (!result)
|
|
42
40
|
result = new Vector2();
|
|
43
|
-
const
|
|
44
|
-
const ray = scratchProjectPointOntoPlaneRay;
|
|
45
|
-
scratchProjectPointOntoPlaneRay.origin = cartesian;
|
|
46
|
-
scratchProjectPointOntoPlaneRay.direction = scratchDirection.copy(plane.normal);
|
|
47
|
-
let intersectionPoint = plane.intersectWithRay(ray, scratchProjectPointOntoPlaneCartesian3);
|
|
48
|
-
if (!intersectionPoint) {
|
|
49
|
-
ray.direction = ray.direction.negate();
|
|
50
|
-
intersectionPoint = plane.intersectWithRay(ray, scratchProjectPointOntoPlaneCartesian3);
|
|
51
|
-
}
|
|
41
|
+
const intersectionPoint = this._plane.projectPointOntoPlane(cartesian, scratchProjectPointOntoPlaneCartesian3);
|
|
52
42
|
const v = intersectionPoint.subtract(this._origin);
|
|
53
43
|
const x = this._xAxis.dot(v);
|
|
54
44
|
const y = this._yAxis.dot(v);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ellipsoid-tangent-plane.js","sourceRoot":"","sources":["../src/ellipsoid-tangent-plane.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,8CAA8C;AAC9C,oCAAoC;AAEpC,sEAAsE;AACtE,4FAA4F;AAE5F,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AACxD,OAAO,EAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"ellipsoid-tangent-plane.js","sourceRoot":"","sources":["../src/ellipsoid-tangent-plane.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,8CAA8C;AAC9C,oCAAoC;AAEpC,sEAAsE;AACtE,4FAA4F;AAE5F,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AACxD,OAAO,EAAC,KAAK,EAAC,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAC,SAAS,EAAC,uBAAoB;AAEtC,MAAM,aAAa,GAAG,IAAI,OAAO,EAAE,CAAC;AACpC,MAAM,YAAY,GAAG,IAAI,OAAO,EAAE,CAAC;AACnC,MAAM,kBAAkB,GAAG,IAAI,OAAO,EAAE,CAAC;AACzC,MAAM,sCAAsC,GAAG,IAAI,OAAO,EAAE,CAAC;AAE7D,kEAAkE;AAClE,MAAM,OAAO,qBAAqB;IAMhC;;;;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,CAAC,CAAC;QAE7B,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;QACb,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;QACb,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;IAC5B,CAAC;CACF"}
|
package/dist/ellipsoid.d.ts
CHANGED
|
@@ -24,11 +24,16 @@ export declare class Ellipsoid {
|
|
|
24
24
|
equals(right: Ellipsoid): boolean;
|
|
25
25
|
/** Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'. */
|
|
26
26
|
toString(): string;
|
|
27
|
-
/** Converts the provided cartographic to Cartesian representation.
|
|
27
|
+
/** Converts the provided cartographic position to Cartesian representation.
|
|
28
|
+
* The position is supplied as [longitude, latitude, height], where longitude and latitude
|
|
29
|
+
* are in degrees and height is in meters above the ellipsoid.
|
|
30
|
+
*/
|
|
28
31
|
cartographicToCartesian(cartographic: number[], result: Vector3): Vector3;
|
|
29
32
|
cartographicToCartesian(cartographic: number[], result?: number[]): number[];
|
|
30
|
-
/** Converts the provided
|
|
31
|
-
*
|
|
33
|
+
/** Converts the provided Cartesian position to [longitude, latitude, height],
|
|
34
|
+
* where longitude and latitude are in degrees and height is in meters above the ellipsoid.
|
|
35
|
+
* The cartographic position is undefined at the center of the ellipsoid.
|
|
36
|
+
*/
|
|
32
37
|
cartesianToCartographic(cartesian: Readonly<NumericArray>, result: Vector3): Vector3;
|
|
33
38
|
cartesianToCartographic(cartesian: Readonly<NumericArray>, result?: number[]): number[];
|
|
34
39
|
/** Computes a 4x4 transformation matrix from a reference frame with an east-north-up axes
|
|
@@ -39,12 +44,14 @@ export declare class Ellipsoid {
|
|
|
39
44
|
* the provided origin to the ellipsoid's fixed reference frame.
|
|
40
45
|
*/
|
|
41
46
|
localFrameToFixedFrame(firstAxis: AxisDirection, secondAxis: AxisDirection, thirdAxis: AxisDirection, origin: Readonly<NumericArray>, result?: Matrix4): Matrix4;
|
|
42
|
-
localFrameToFixedFrame<
|
|
47
|
+
localFrameToFixedFrame<_Matrix4T>(firstAxis: AxisDirection, secondAxis: AxisDirection, thirdAxis: AxisDirection, origin: Readonly<NumericArray>, result: number[]): number[];
|
|
43
48
|
/** Computes the unit vector directed from the center of this ellipsoid toward
|
|
44
49
|
* the provided Cartesian position. */
|
|
45
50
|
geocentricSurfaceNormal(cartesian: number[], result?: number[]): number[];
|
|
46
51
|
geocentricSurfaceNormal<NumArray>(cartesian: number[], result: NumArray): NumArray;
|
|
47
|
-
/** Computes the normal of the plane tangent to the surface of the ellipsoid at provided
|
|
52
|
+
/** Computes the normal of the plane tangent to the surface of the ellipsoid at the provided
|
|
53
|
+
* [longitude, latitude, height], where longitude and latitude are in degrees.
|
|
54
|
+
*/
|
|
48
55
|
geodeticSurfaceNormalCartographic<NumArray>(cartographic: Readonly<NumericArray>, result: NumArray): NumArray;
|
|
49
56
|
geodeticSurfaceNormalCartographic(cartographic: number[]): number[];
|
|
50
57
|
/** Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position. */
|
package/dist/ellipsoid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ellipsoid.d.ts","sourceRoot":"","sources":["../src/ellipsoid.ts"],"names":[],"mappings":"AAQA,OAAO,EAAC,OAAO,EAAE,OAAO,EAA8B,YAAY,EAAO,MAAM,eAAe,CAAC;AAK/F,OAAO,KAAK,EAAC,aAAa,EAAC,mDAAgD;AAW3E;;;;GAIG;AACH,qBAAa,SAAS;IACpB,+DAA+D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AC;IACrD,CAAC;;AAxPD,+DAA+D;AAC/C,eAAK,GAAc,IAAI,SAAS,CAAC,cAAc,EAAE,cAAc,EAAE,cAAc,CAAC,AAA3E,CAA4E"}
|
package/dist/index.cjs
CHANGED
|
@@ -17,14 +17,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
19
|
// dist/index.js
|
|
20
|
-
var
|
|
21
|
-
__export(
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
22
|
Ellipsoid: () => Ellipsoid,
|
|
23
23
|
EllipsoidTangentPlane: () => EllipsoidTangentPlane,
|
|
24
24
|
LngLatRectangle: () => LngLatRectangle,
|
|
25
|
-
isWGS84: () => isWGS84
|
|
25
|
+
isWGS84: () => isWGS84,
|
|
26
|
+
makeOBBFromRegion: () => makeOBBFromRegion
|
|
26
27
|
});
|
|
27
|
-
module.exports = __toCommonJS(
|
|
28
|
+
module.exports = __toCommonJS(index_exports);
|
|
28
29
|
|
|
29
30
|
// dist/ellipsoid.js
|
|
30
31
|
var import_core4 = require("@math.gl/core");
|
|
@@ -407,45 +408,35 @@ var import_culling = require("@math.gl/culling");
|
|
|
407
408
|
var scratchOrigin2 = new import_core5.Vector3();
|
|
408
409
|
var scratchCart3 = new import_core5.Vector3();
|
|
409
410
|
var scratchEastNorthUp = new import_core5.Matrix4();
|
|
410
|
-
var scratchPlane = new import_culling.Plane();
|
|
411
|
-
var scratchProjectPointOntoPlaneRay = new import_culling.Ray();
|
|
412
411
|
var scratchProjectPointOntoPlaneCartesian3 = new import_core5.Vector3();
|
|
413
|
-
var scratchDirection = new import_core5.Vector3();
|
|
414
412
|
var EllipsoidTangentPlane = class {
|
|
415
413
|
/**
|
|
416
414
|
* Creates a new plane tangent to the WGS84 ellipsoid at the provided origin.
|
|
417
|
-
* If origin is not on the surface of the ellipsoid,
|
|
415
|
+
* If origin is not on the surface of the ellipsoid, its surface projection will be used.
|
|
418
416
|
*
|
|
419
|
-
* @param
|
|
417
|
+
* @param origin A nonzero Cartesian point on or near the ellipsoid.
|
|
418
|
+
* @param ellipsoid The ellipsoid to which the origin belongs. Defaults to WGS84.
|
|
420
419
|
*/
|
|
421
|
-
constructor(origin) {
|
|
422
|
-
|
|
423
|
-
const eastNorthUp =
|
|
424
|
-
this._origin =
|
|
420
|
+
constructor(origin, ellipsoid = Ellipsoid.WGS84) {
|
|
421
|
+
const originOnSurface = ellipsoid.scaleToGeodeticSurface(origin, scratchOrigin2);
|
|
422
|
+
const eastNorthUp = ellipsoid.eastNorthUpToFixedFrame(originOnSurface, scratchEastNorthUp);
|
|
423
|
+
this._origin = new import_core5.Vector3(originOnSurface);
|
|
425
424
|
this._xAxis = new import_core5.Vector3(scratchCart3.from(eastNorthUp.getColumn(0)));
|
|
426
425
|
this._yAxis = new import_core5.Vector3(scratchCart3.from(eastNorthUp.getColumn(1)));
|
|
427
426
|
const normal = new import_core5.Vector3(scratchCart3.from(eastNorthUp.getColumn(2)));
|
|
428
|
-
this._plane =
|
|
427
|
+
this._plane = new import_culling.Plane().fromPointNormal(this._origin, normal);
|
|
429
428
|
}
|
|
430
429
|
/**
|
|
431
430
|
* Computes the projection of the provided 3D position onto the 2D plane, along the plane normal.
|
|
432
431
|
*
|
|
433
|
-
* @param
|
|
434
|
-
* @param
|
|
435
|
-
* @returns
|
|
432
|
+
* @param cartesian The WGS84 Cartesian point to project.
|
|
433
|
+
* @param result The optional object in which to store the local east-north coordinates.
|
|
434
|
+
* @returns The supplied result or a new Vector2.
|
|
436
435
|
*/
|
|
437
436
|
projectPointToNearestOnPlane(cartesian, result) {
|
|
438
437
|
if (!result)
|
|
439
438
|
result = new import_core5.Vector2();
|
|
440
|
-
const
|
|
441
|
-
const ray = scratchProjectPointOntoPlaneRay;
|
|
442
|
-
scratchProjectPointOntoPlaneRay.origin = cartesian;
|
|
443
|
-
scratchProjectPointOntoPlaneRay.direction = scratchDirection.copy(plane.normal);
|
|
444
|
-
let intersectionPoint = plane.intersectWithRay(ray, scratchProjectPointOntoPlaneCartesian3);
|
|
445
|
-
if (!intersectionPoint) {
|
|
446
|
-
ray.direction = ray.direction.negate();
|
|
447
|
-
intersectionPoint = plane.intersectWithRay(ray, scratchProjectPointOntoPlaneCartesian3);
|
|
448
|
-
}
|
|
439
|
+
const intersectionPoint = this._plane.projectPointOntoPlane(cartesian, scratchProjectPointOntoPlaneCartesian3);
|
|
449
440
|
const v = intersectionPoint.subtract(this._origin);
|
|
450
441
|
const x = this._xAxis.dot(v);
|
|
451
442
|
const y = this._yAxis.dot(v);
|
|
@@ -518,4 +509,214 @@ var LngLatRectangle = class {
|
|
|
518
509
|
return east - west;
|
|
519
510
|
}
|
|
520
511
|
};
|
|
512
|
+
|
|
513
|
+
// dist/make-obb-from-region.js
|
|
514
|
+
var import_core7 = require("@math.gl/core");
|
|
515
|
+
var import_culling2 = require("@math.gl/culling");
|
|
516
|
+
var scratchOffset = new import_core7.Vector3();
|
|
517
|
+
var scratchTangentPoint = new import_core7.Vector3();
|
|
518
|
+
var scratchPerimeterCartographicNC = new import_core7.Vector3();
|
|
519
|
+
var scratchPerimeterCartographicNW = new import_core7.Vector3();
|
|
520
|
+
var scratchPerimeterCartographicCW = new import_core7.Vector3();
|
|
521
|
+
var scratchPerimeterCartographicSW = new import_core7.Vector3();
|
|
522
|
+
var scratchPerimeterCartographicSC = new import_core7.Vector3();
|
|
523
|
+
var scratchPerimeterCartesianNC = new import_core7.Vector3();
|
|
524
|
+
var scratchPerimeterCartesianNW = new import_core7.Vector3();
|
|
525
|
+
var scratchPerimeterCartesianCW = new import_core7.Vector3();
|
|
526
|
+
var scratchPerimeterCartesianSW = new import_core7.Vector3();
|
|
527
|
+
var scratchPerimeterCartesianSC = new import_core7.Vector3();
|
|
528
|
+
var scratchPerimeterProjectedNC = new import_core7.Vector2();
|
|
529
|
+
var scratchPerimeterProjectedNW = new import_core7.Vector2();
|
|
530
|
+
var scratchPerimeterProjectedCW = new import_core7.Vector2();
|
|
531
|
+
var scratchPerimeterProjectedSW = new import_core7.Vector2();
|
|
532
|
+
var scratchPerimeterProjectedSC = new import_core7.Vector2();
|
|
533
|
+
var scratchPlane = new import_culling2.Plane();
|
|
534
|
+
var scratchPlaneOrigin = new import_core7.Vector3();
|
|
535
|
+
var scratchPlaneNormal = new import_core7.Vector3();
|
|
536
|
+
var scratchPlaneXAxis = new import_core7.Vector3();
|
|
537
|
+
var scratchHorizonCartesian = new import_core7.Vector3();
|
|
538
|
+
var scratchHorizonProjected = new import_core7.Vector2();
|
|
539
|
+
var scratchMaxY = new import_core7.Vector3();
|
|
540
|
+
var scratchZ = new import_core7.Vector3();
|
|
541
|
+
var VECTOR3_UNIT_X = new import_core7.Vector3(1, 0, 0);
|
|
542
|
+
var VECTOR3_UNIT_Z = new import_core7.Vector3(0, 0, 1);
|
|
543
|
+
function makeOBBFromRegion(region, ellipsoid = Ellipsoid.WGS84, options = {}) {
|
|
544
|
+
if (!region || region.length !== 6 || region.some((value) => !Number.isFinite(value))) {
|
|
545
|
+
throw new Error("makeOBBFromRegion: region must contain exactly six finite numbers");
|
|
546
|
+
}
|
|
547
|
+
const unitScale = options.units === "degrees" ? (0, import_core7.radians)(1) : 1;
|
|
548
|
+
const [rawWest, rawSouth, rawEast, rawNorth, minimumHeight, maximumHeight] = region;
|
|
549
|
+
if (minimumHeight > maximumHeight) {
|
|
550
|
+
throw new Error("makeOBBFromRegion: minimumHeight must not exceed maximumHeight");
|
|
551
|
+
}
|
|
552
|
+
const south = rawSouth * unitScale;
|
|
553
|
+
const north = rawNorth * unitScale;
|
|
554
|
+
const west = normalizeLongitude(rawWest * unitScale);
|
|
555
|
+
let east = normalizeLongitude(rawEast * unitScale);
|
|
556
|
+
const directedSpan = rawEast * unitScale - rawWest * unitScale;
|
|
557
|
+
if (directedSpan >= import_core7._MathUtils.TWO_PI - 1e-12) {
|
|
558
|
+
east = west + import_core7._MathUtils.TWO_PI;
|
|
559
|
+
}
|
|
560
|
+
const latitudeTolerance = 1e-12;
|
|
561
|
+
if (south > north || south < -import_core7._MathUtils.PI_OVER_TWO - latitudeTolerance || north > import_core7._MathUtils.PI_OVER_TWO + latitudeTolerance) {
|
|
562
|
+
throw new Error("makeOBBFromRegion: latitude must be within [-\u03C0/2, \u03C0/2] and south \u2264 north");
|
|
563
|
+
}
|
|
564
|
+
const clampedSouth = Math.max(-import_core7._MathUtils.PI_OVER_TWO, Math.min(import_core7._MathUtils.PI_OVER_TWO, south));
|
|
565
|
+
const clampedNorth = Math.max(-import_core7._MathUtils.PI_OVER_TWO, Math.min(import_core7._MathUtils.PI_OVER_TWO, north));
|
|
566
|
+
return makeOBBFromNormalizedRegion([west, clampedSouth, east, clampedNorth, minimumHeight, maximumHeight], ellipsoid, options.transform);
|
|
567
|
+
}
|
|
568
|
+
function normalizeLongitude(value) {
|
|
569
|
+
const normalized = ((value + Math.PI) % import_core7._MathUtils.TWO_PI + import_core7._MathUtils.TWO_PI) % import_core7._MathUtils.TWO_PI - Math.PI;
|
|
570
|
+
return normalized === -Math.PI && value > 0 ? Math.PI : normalized;
|
|
571
|
+
}
|
|
572
|
+
function makeOBBFromNormalizedRegion(region, ellipsoid, transform) {
|
|
573
|
+
const obb = new import_culling2.OrientedBoundingBox();
|
|
574
|
+
const [west, south, east, north, minimumHeight, maximumHeight] = region;
|
|
575
|
+
const northDeg = (0, import_core7.degrees)(north);
|
|
576
|
+
const southDeg = (0, import_core7.degrees)(south);
|
|
577
|
+
let maxX;
|
|
578
|
+
let maxY;
|
|
579
|
+
let maxZ;
|
|
580
|
+
let minX;
|
|
581
|
+
let minY;
|
|
582
|
+
let minZ;
|
|
583
|
+
let plane;
|
|
584
|
+
const rectangle = new LngLatRectangle(west, south, east, north);
|
|
585
|
+
const tangentPoint = LngLatRectangle.center(rectangle, scratchTangentPoint);
|
|
586
|
+
const tangentPointCartographic = new import_core7.Vector3([
|
|
587
|
+
(0, import_core7.degrees)(tangentPoint.x),
|
|
588
|
+
(0, import_core7.degrees)(tangentPoint.y),
|
|
589
|
+
0
|
|
590
|
+
]);
|
|
591
|
+
const lonCenter = tangentPoint.x;
|
|
592
|
+
const lonCenterDeg = tangentPointCartographic.x;
|
|
593
|
+
if (rectangle.width <= import_core7._MathUtils.PI) {
|
|
594
|
+
const westDeg = (0, import_core7.degrees)(west);
|
|
595
|
+
const tangentPoint2 = ellipsoid.cartographicToCartesian(tangentPointCartographic);
|
|
596
|
+
const ellipsoidTangentPlane = new EllipsoidTangentPlane(tangentPoint2, ellipsoid);
|
|
597
|
+
const latCenter = southDeg < 0 && northDeg > 0 ? 0 : tangentPointCartographic.y;
|
|
598
|
+
const perimeterCartographicNC = scratchPerimeterCartographicNC.copy([
|
|
599
|
+
lonCenterDeg,
|
|
600
|
+
northDeg,
|
|
601
|
+
maximumHeight
|
|
602
|
+
]);
|
|
603
|
+
const perimeterCartographicNW = scratchPerimeterCartographicNW.copy([
|
|
604
|
+
westDeg,
|
|
605
|
+
northDeg,
|
|
606
|
+
maximumHeight
|
|
607
|
+
]);
|
|
608
|
+
const perimeterCartographicCW = scratchPerimeterCartographicCW.copy([
|
|
609
|
+
westDeg,
|
|
610
|
+
latCenter,
|
|
611
|
+
maximumHeight
|
|
612
|
+
]);
|
|
613
|
+
const perimeterCartographicSW = scratchPerimeterCartographicSW.copy([
|
|
614
|
+
westDeg,
|
|
615
|
+
southDeg,
|
|
616
|
+
maximumHeight
|
|
617
|
+
]);
|
|
618
|
+
const perimeterCartographicSC = scratchPerimeterCartographicSC.copy([
|
|
619
|
+
lonCenterDeg,
|
|
620
|
+
southDeg,
|
|
621
|
+
maximumHeight
|
|
622
|
+
]);
|
|
623
|
+
const perimeterCartesianNC = ellipsoid.cartographicToCartesian(perimeterCartographicNC, scratchPerimeterCartesianNC);
|
|
624
|
+
let perimeterCartesianNW = ellipsoid.cartographicToCartesian(perimeterCartographicNW, scratchPerimeterCartesianNW);
|
|
625
|
+
const perimeterCartesianCW = ellipsoid.cartographicToCartesian(perimeterCartographicCW, scratchPerimeterCartesianCW);
|
|
626
|
+
let perimeterCartesianSW = ellipsoid.cartographicToCartesian(perimeterCartographicSW, scratchPerimeterCartesianSW);
|
|
627
|
+
const perimeterCartesianSC = ellipsoid.cartographicToCartesian(perimeterCartographicSC, scratchPerimeterCartesianSC);
|
|
628
|
+
const perimeterProjectedNC = ellipsoidTangentPlane.projectPointToNearestOnPlane(perimeterCartesianNC, scratchPerimeterProjectedNC);
|
|
629
|
+
const perimeterProjectedNW = ellipsoidTangentPlane.projectPointToNearestOnPlane(perimeterCartesianNW, scratchPerimeterProjectedNW);
|
|
630
|
+
const perimeterProjectedCW = ellipsoidTangentPlane.projectPointToNearestOnPlane(perimeterCartesianCW, scratchPerimeterProjectedCW);
|
|
631
|
+
const perimeterProjectedSW = ellipsoidTangentPlane.projectPointToNearestOnPlane(perimeterCartesianSW, scratchPerimeterProjectedSW);
|
|
632
|
+
const perimeterProjectedSC = ellipsoidTangentPlane.projectPointToNearestOnPlane(perimeterCartesianSC, scratchPerimeterProjectedSC);
|
|
633
|
+
minX = Math.min(perimeterProjectedNW.x, perimeterProjectedCW.x, perimeterProjectedSW.x);
|
|
634
|
+
maxX = -minX;
|
|
635
|
+
maxY = Math.max(perimeterProjectedNW.y, perimeterProjectedNC.y);
|
|
636
|
+
minY = Math.min(perimeterProjectedSW.y, perimeterProjectedSC.y);
|
|
637
|
+
perimeterCartographicNW.z = perimeterCartographicSW.z = minimumHeight;
|
|
638
|
+
perimeterCartesianNW = ellipsoid.cartographicToCartesian(perimeterCartographicNW, scratchPerimeterCartesianNW);
|
|
639
|
+
perimeterCartesianSW = ellipsoid.cartographicToCartesian(perimeterCartographicSW, scratchPerimeterCartesianSW);
|
|
640
|
+
plane = ellipsoidTangentPlane.plane;
|
|
641
|
+
minZ = Math.min(plane.getPointDistance(perimeterCartesianNW), plane.getPointDistance(perimeterCartesianSW));
|
|
642
|
+
maxZ = maximumHeight;
|
|
643
|
+
return applyTransform(fromPlaneExtents(ellipsoidTangentPlane.origin, ellipsoidTangentPlane.xAxis, ellipsoidTangentPlane.yAxis, ellipsoidTangentPlane.zAxis, minX, maxX, minY, maxY, minZ, maxZ, obb), transform);
|
|
644
|
+
}
|
|
645
|
+
const eastDeg = (0, import_core7.degrees)(east);
|
|
646
|
+
const fullyAboveEquator = south > 0;
|
|
647
|
+
const fullyBelowEquator = north < 0;
|
|
648
|
+
const latitudeNearestToEquator = fullyAboveEquator ? southDeg : fullyBelowEquator ? northDeg : 0;
|
|
649
|
+
const planeOrigin = ellipsoid.cartographicToCartesian([lonCenterDeg, latitudeNearestToEquator, maximumHeight], scratchPlaneOrigin);
|
|
650
|
+
planeOrigin.z = 0;
|
|
651
|
+
const isPole = Math.abs(planeOrigin.x) < import_core7._MathUtils.EPSILON10 && Math.abs(planeOrigin.y) < import_core7._MathUtils.EPSILON10;
|
|
652
|
+
const planeNormal = !isPole ? scratchPlaneNormal.copy(planeOrigin).normalize() : VECTOR3_UNIT_X;
|
|
653
|
+
const planeYAxis = VECTOR3_UNIT_Z;
|
|
654
|
+
const planeXAxis = scratchPlaneXAxis.copy(planeNormal).cross(planeYAxis);
|
|
655
|
+
plane = scratchPlane.fromPointNormal(planeOrigin, planeNormal);
|
|
656
|
+
const horizonCartesian = ellipsoid.cartographicToCartesian([(0, import_core7.degrees)(lonCenter + import_core7._MathUtils.PI_OVER_TWO), latitudeNearestToEquator, maximumHeight], scratchHorizonCartesian);
|
|
657
|
+
const projectedPoint = plane.projectPointOntoPlane(horizonCartesian, scratchHorizonProjected);
|
|
658
|
+
maxX = projectedPoint.dot(planeXAxis);
|
|
659
|
+
minX = -maxX;
|
|
660
|
+
const northHeight = fullyBelowEquator ? minimumHeight : maximumHeight;
|
|
661
|
+
const southHeight = fullyAboveEquator ? minimumHeight : maximumHeight;
|
|
662
|
+
maxY = latitudeZExtent(ellipsoid, northDeg, northHeight, true);
|
|
663
|
+
minY = latitudeZExtent(ellipsoid, southDeg, southHeight, false);
|
|
664
|
+
const farZ = ellipsoid.cartographicToCartesian([eastDeg, latitudeNearestToEquator, maximumHeight], scratchZ);
|
|
665
|
+
minZ = plane.getPointDistance(farZ);
|
|
666
|
+
maxZ = 0;
|
|
667
|
+
return applyTransform(fromPlaneExtents(planeOrigin, planeXAxis, planeYAxis, planeNormal, minX, maxX, minY, maxY, minZ, maxZ, obb), transform);
|
|
668
|
+
}
|
|
669
|
+
function applyTransform(obb, transform) {
|
|
670
|
+
if (!transform)
|
|
671
|
+
return obb;
|
|
672
|
+
const axes = [0, 1, 2].map((column) => obb.halfAxes.getColumn(column, new import_core7.Vector3()));
|
|
673
|
+
const center = transform.transformAsPoint(obb.center);
|
|
674
|
+
const minimum = [Infinity, Infinity, Infinity];
|
|
675
|
+
const maximum = [-Infinity, -Infinity, -Infinity];
|
|
676
|
+
for (let mask = 0; mask < 8; mask++) {
|
|
677
|
+
const corner = new import_core7.Vector3(center);
|
|
678
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
679
|
+
const transformedAxis = transform.transformAsVector(axes[axis]);
|
|
680
|
+
corner.add(new import_core7.Vector3(transformedAxis).scale((mask & 1 << axis) === 0 ? -1 : 1));
|
|
681
|
+
}
|
|
682
|
+
for (let component = 0; component < 3; component++) {
|
|
683
|
+
minimum[component] = Math.min(minimum[component], corner[component]);
|
|
684
|
+
maximum[component] = Math.max(maximum[component], corner[component]);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
obb.center.copy(minimum).add(maximum).scale(0.5);
|
|
688
|
+
const halfSize = new import_core7.Vector3(maximum).subtract(minimum).scale(0.5);
|
|
689
|
+
obb.halfAxes = new import_core7.Matrix3().set(halfSize.x, 0, 0, 0, halfSize.y, 0, 0, 0, halfSize.z);
|
|
690
|
+
return obb;
|
|
691
|
+
}
|
|
692
|
+
function latitudeZExtent(ellipsoid, latitude, height, maximum) {
|
|
693
|
+
let extent = maximum ? -Infinity : Infinity;
|
|
694
|
+
for (const longitude of [0, 90, 180, 270]) {
|
|
695
|
+
const z = ellipsoid.cartographicToCartesian([longitude, latitude, height], scratchMaxY).z;
|
|
696
|
+
extent = maximum ? Math.max(extent, z) : Math.min(extent, z);
|
|
697
|
+
}
|
|
698
|
+
return extent;
|
|
699
|
+
}
|
|
700
|
+
function fromPlaneExtents(planeOrigin, planeXAxis, planeYAxis, planeZAxis, minimumX, maximumX, minimumY, maximumY, minimumZ, maximumZ, result) {
|
|
701
|
+
const center = result.center;
|
|
702
|
+
const halfAxes = result.halfAxes;
|
|
703
|
+
halfAxes.setColumn(0, planeXAxis);
|
|
704
|
+
halfAxes.setColumn(1, planeYAxis);
|
|
705
|
+
halfAxes.setColumn(2, planeZAxis);
|
|
706
|
+
const centerOffset = scratchOffset.set((minimumX + maximumX) / 2, (minimumY + maximumY) / 2, (minimumZ + maximumZ) / 2).transformByMatrix3(halfAxes);
|
|
707
|
+
const scaleX = (maximumX - minimumX) / 2;
|
|
708
|
+
const scaleY = (maximumY - minimumY) / 2;
|
|
709
|
+
const scaleZ = (maximumZ - minimumZ) / 2;
|
|
710
|
+
halfAxes[0] *= scaleX;
|
|
711
|
+
halfAxes[1] *= scaleX;
|
|
712
|
+
halfAxes[2] *= scaleX;
|
|
713
|
+
halfAxes[3] *= scaleY;
|
|
714
|
+
halfAxes[4] *= scaleY;
|
|
715
|
+
halfAxes[5] *= scaleY;
|
|
716
|
+
halfAxes[6] *= scaleZ;
|
|
717
|
+
halfAxes[7] *= scaleZ;
|
|
718
|
+
halfAxes[8] *= scaleZ;
|
|
719
|
+
center.copy(planeOrigin).add(centerOffset);
|
|
720
|
+
return result;
|
|
721
|
+
}
|
|
521
722
|
//# sourceMappingURL=index.cjs.map
|