@equinor/videx-3d 3.1.0 → 3.2.0
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/dist/{chunk-DKAquGKk.js → chunk-r8Ybij6M.js} +331 -316
- package/dist/generators.js +147 -147
- package/dist/main.js +1151 -1129
- package/dist/sdk.js +2 -2
- package/dist/types/components/Distance/Bounds.d.ts +37 -0
- package/dist/types/components/Distance/Distance.d.ts +22 -11
- package/dist/types/components/Distance/index.d.ts +1 -0
- package/dist/types/sdk/utils/vector-operations.d.ts +25 -0
- package/package.json +2 -2
package/dist/sdk.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as e, $t as t, A as n, At as r, Bt as i, C as a, Cn as o, Ct as s, D as c, Dn as l, Dt as u, E as d, En as f, Et as p, F as m, Ft as h, Gt as g, H as _, Ht as v, It as y, J as b, Jt as x, Kt as S, Lt as C, M as w, Mt as T, N as E, Nt as D, O,
|
|
2
|
-
export {
|
|
1
|
+
import { $ as e, $t as t, A as n, At as r, Bt as i, C as a, Cn as o, Ct as s, D as c, Dn as l, Dt as u, E as d, En as f, Et as p, F as m, Ft as h, Gt as g, H as _, Ht as v, It as y, J as b, Jt as x, Kt as S, Lt as C, M as w, Mt as T, N as E, Nt as D, O, On as k, Ot as A, P as j, Pt as M, Q as N, Qt as P, Rt as F, S as I, Sn as L, St as R, T as z, Tn as B, Tt as V, Ut as H, Vt as U, Wt as W, X as G, Xt as K, Y as q, Yt as J, Z as Y, Zt as X, _ as Z, _n as Q, _t as $, an as ee, at as te, b as ne, bn as re, bt as ie, c as ae, cn as oe, ct as se, d as ce, dn as le, dt as ue, en as de, et as fe, f as pe, fn as me, ft as he, g as ge, gn as _e, gt as ve, h as ye, hn as be, ht as xe, in as Se, it as Ce, j as we, jt as Te, k as Ee, kt as De, l as Oe, ln as ke, lt as Ae, m as je, mn as Me, mt as Ne, n as Pe, nn as Fe, nt as Ie, on as Le, ot as Re, p as ze, pn as Be, pt as Ve, q as He, qt as Ue, rn as We, rt as Ge, s as Ke, sn as qe, st as Je, t as Ye, tn as Xe, tt as Ze, u as Qe, un as $e, ut as et, v as tt, vn as nt, vt as rt, w as it, wn as at, wt as ot, x as st, xn as ct, xt as lt, y as ut, yn as dt, yt as ft, zt as pt } from "./chunk-r8Ybij6M.js";
|
|
2
|
+
export { we as CRS, _ as CameraManager, k as DataLoader, V as Delatin, it as DepthReadMaterial, l as GeneratorRegistry, ke as PI, $e as PI2, le as PI4, me as PI8, b as PlanarGeometry, q as PlanarLineGeometry, G as PlanarPointGeometry, Y as PlanarPolygonGeometry, Be as TAU, Pe as TubeMaterial, ae as Typed2DArray, m as WellboreManager, D as addVec2, M as addVec3, h as angleVec3, y as asVec2, Ne as buildMaskedGridPlane, r as calculateFrenetFrames, Oe as calculateHashValue, o as calculateWellSegments, be as clamp, $ as computePlanarXZUv, Z as computeSurfaceNormalsRG, rt as computeUpwardNormals, C as copyVec3, ge as createConfig, tt as createElevationTexture, lt as createFenceGeometry, ft as createIndexedGeometry, ut as createNormalTexture, Re as createOceanBox, Je as createOceanBoxFromPolygon, se as createOceanBoxFromSurface, Ae as createOceanEllipseBox, et as createOceanPlane, ne as createPackedNormalTexture, p as createTubeGeometries, u as createTubeGeometry, F as crossVec3, z as degreesToRadians, pt as directionVec2, i as directionVec3, U as distanceToBounds, v as distanceVec2, H as distanceVec3, W as dotVec2, g as dotVec3, Me as edgeOfRectangle, st as elevationMapNormalsToRGBA, re as extractBoundaryLoops, d as feetToMeters, xe as floodFillExternalHoles, Te as getCurvePositions, at as getFormationMarkers, pe as getObjectByCustomProperty, R as getProjectedTrajectory, w as getProjectionDefFromUtmZone, T as getSplineCurve, s as getTrajectory, N as getTypedArrayFromBuffer, e as getTypedArrayType, E as getUtmZoneFromLatLng, S as getVec2, Ue as getVec3, B as getWellboreFormations, Ee as idToHexColor, _e as inverseLerp, x as lengthVec2, J as lengthVec3, Q as lerp, f as mergeFormationIntervals, A as mergeGeometries, K as mixVec2, X as mixVec3, ze as multiply, je as negate, P as negateVec2, t as negateVec3, de as normalizeVec2, Xe as normalizeVec3, c as normalizedDeviceToScreen, fe as packAttribute, Ze as packBufferGeometries, Ie as packBufferGeometry, Ge as packBufferGeometryLike, ye as parseIrapbin, n as randomColor, a as readDepth, he as refineInteriorEdges, nt as remap, ie as rotateGeometryY, Fe as rotateVec3, ve as sampleValidGrid, We as scaleVec2, Se as scaleVec3, O as screenToNormalizedDevice, ee as setVec2, Le as setVec3, ot as simplifyCurve2D, ct as smoothBoundaryLoops, L as snapBoundaryToOutline, qe as subVec2, oe as subVec3, Ve as subdivideGeometry, Qe as titleCase, De as toBufferGeometry, Ke as toFloat32Array, dt as toRGB, ce as toSegments, I as triangleNormal, He as triangulateGrid, ue as triangulateGridDelaunay, Ce as unpackBufferGeometries, te as unpackBufferGeometry, Ye as uvMaterial, j as wgs84Def };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BoundsShape } from '../../sdk';
|
|
3
|
+
/**
|
|
4
|
+
* Bounds props
|
|
5
|
+
* @expand
|
|
6
|
+
*/
|
|
7
|
+
export type BoundsProps = BoundsShape & {
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A generic provider of the {@link DistanceContext}, so the {@link Distance} component
|
|
12
|
+
* (and anything else reading the context) can be used for ANY object — not just
|
|
13
|
+
* wellbores. Supply a bounding `sphere`, `box` or a single `position` and `Bounds`
|
|
14
|
+
* publishes the camera's distance to it each frame, measured in this component's local
|
|
15
|
+
* space and divided by `camera.zoom` (matching {@link WellboreBounds}, so `Distance`'s
|
|
16
|
+
* `min`/`max` behave identically).
|
|
17
|
+
*
|
|
18
|
+
* If more than one shape is provided the precedence is `sphere` > `box` > `position`.
|
|
19
|
+
* With none, the distance stays `Infinity` (so distance-gated children remain hidden).
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* <Bounds sphere={{ center: [0, 0, 0], radius: 5 }}>
|
|
23
|
+
* <Distance min={0} max={50}>
|
|
24
|
+
* <mesh>
|
|
25
|
+
* <sphereGeometry />
|
|
26
|
+
* <meshStandardMaterial color="red" />
|
|
27
|
+
* </mesh>
|
|
28
|
+
* </Distance>
|
|
29
|
+
* </Bounds>
|
|
30
|
+
*
|
|
31
|
+
* @see {@link Distance}
|
|
32
|
+
* @see {@link DistanceContext}
|
|
33
|
+
* @see {@link WellboreBounds}
|
|
34
|
+
*
|
|
35
|
+
* @group Components
|
|
36
|
+
*/
|
|
37
|
+
export declare const Bounds: ({ sphere, box, position, children }: BoundsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,23 +10,34 @@ export type DistanceProps = {
|
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
|
-
* The Distance component can be used to conditionally render
|
|
13
|
+
* The Distance component can be used to conditionally render (or, with `onDemand`,
|
|
14
|
+
* mount/unmount) child components based on the camera's distance to a bounds — for
|
|
15
|
+
* example to swap geometry level-of-detail. It reads the {@link DistanceContext}, which a
|
|
16
|
+
* parent must provide: use the generic {@link Bounds} for any object, or
|
|
17
|
+
* {@link WellboreBounds} for a wellbore.
|
|
14
18
|
*
|
|
15
19
|
* @example
|
|
16
|
-
* <
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
20
|
+
* <Bounds sphere={{ center: [0, 0, 0], radius: 5 }}>
|
|
21
|
+
* <Distance min={0} max={50}>
|
|
22
|
+
* <mesh>
|
|
23
|
+
* <sphereGeometry />
|
|
24
|
+
* <meshStandardMaterial color="red" />
|
|
25
|
+
* </mesh>
|
|
26
|
+
* </Distance>
|
|
27
|
+
* <Distance min={50} max={Infinity}>
|
|
28
|
+
* <mesh>
|
|
29
|
+
* <boxGeometry />
|
|
30
|
+
* <meshStandardMaterial color="blue" />
|
|
31
|
+
* </mesh>
|
|
32
|
+
* </Distance>
|
|
33
|
+
* </Bounds>
|
|
25
34
|
*
|
|
26
35
|
* @remarks
|
|
27
|
-
* This component depends on a `DistanceContext` being provided by a parent component
|
|
36
|
+
* This component depends on a `DistanceContext` being provided by a parent component
|
|
37
|
+
* (e.g. {@link Bounds} or {@link WellboreBounds}).
|
|
28
38
|
*
|
|
29
39
|
* @see [Storybook](/videx-3d/?path=/docs/components-misc-distance--docs)
|
|
40
|
+
* @see {@link Bounds}
|
|
30
41
|
* @see {@link DistanceContext}
|
|
31
42
|
* @see {@link WellboreBounds}
|
|
32
43
|
*
|
|
@@ -14,6 +14,31 @@ export declare function copyVec3(vec: Vec3): Vec3;
|
|
|
14
14
|
export declare function angleVec3(v1: Vec3, v2: Vec3): number;
|
|
15
15
|
export declare function rotateVec3(vector: Vec3, axis?: Vec3, angle?: number): Vec3;
|
|
16
16
|
export declare function directionVec3(v1: Vec3, v2: Vec3): Vec3;
|
|
17
|
+
/**
|
|
18
|
+
* A bounds shape for distance-based level of detail: a bounding `sphere`, an
|
|
19
|
+
* axis-aligned bounding `box` (as `[min, max]`) or a single `position`. Consumed by the
|
|
20
|
+
* `Bounds` component and {@link distanceToBounds}.
|
|
21
|
+
*/
|
|
22
|
+
export type BoundsShape = {
|
|
23
|
+
/** Bounding sphere. Highest precedence. */
|
|
24
|
+
sphere?: {
|
|
25
|
+
center: Vec3;
|
|
26
|
+
radius: number;
|
|
27
|
+
};
|
|
28
|
+
/** Axis-aligned bounding box as `[min, max]`. Used when `sphere` is unset. */
|
|
29
|
+
box?: [Vec3, Vec3];
|
|
30
|
+
/** A single point. Lowest precedence. */
|
|
31
|
+
position?: Vec3;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Non-negative distance from `point` to a {@link BoundsShape} — `0` when the point is
|
|
35
|
+
* inside or on the shape. Precedence when several are set: `sphere` > `box` >
|
|
36
|
+
* `position`; returns `Infinity` when none is provided. Pure math (no rendering
|
|
37
|
+
* dependencies), so it can drive level-of-detail decisions and be unit tested directly.
|
|
38
|
+
*
|
|
39
|
+
* Mirrors three.js' `Sphere`/`Box3.distanceToPoint` (clamped to `0` on the inside).
|
|
40
|
+
*/
|
|
41
|
+
export declare function distanceToBounds(point: Vec3, bounds: BoundsShape): number;
|
|
17
42
|
export declare function distanceVec3(v1: Vec3, v2: Vec3): number;
|
|
18
43
|
/**
|
|
19
44
|
* Resolve a `number | Vec2 | undefined` parameter into a concrete `Vec2`. A
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/videx-3d",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"dist"
|
|
21
21
|
],
|
|
22
22
|
"engines": {
|
|
23
|
-
"npm": "^
|
|
23
|
+
"npm": "^12.0.0"
|
|
24
24
|
},
|
|
25
25
|
"exports": {
|
|
26
26
|
".": {
|