bimatter-viewer-react 0.11.8 → 0.11.9
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/Model.d.ts +2 -1
- package/lib/index.js +906 -896
- package/lib/utils/GeometryUtils/trueNorth.d.ts +2 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -2,9 +2,9 @@ import { d as e, l as t, n, t as r } from "./three.webgpu-7Fqpf016.js";
|
|
|
2
2
|
import { I as i, N as a, R as o, h as s, l as c, o as l } from "./three.tsl-Dfou2CS1.js";
|
|
3
3
|
import u, { Suspense as d, createContext as f, forwardRef as p, memo as m, useCallback as h, useContext as g, useEffect as _, useImperativeHandle as v, useLayoutEffect as y, useMemo as b, useRef as x, useState as S } from "react";
|
|
4
4
|
import { createRoot as C } from "react-dom/client";
|
|
5
|
-
import { Canvas as w, applyProps as
|
|
5
|
+
import { Canvas as w, applyProps as T, extend as E, useFrame as D, useThree as O } from "@react-three/fiber";
|
|
6
6
|
import "three";
|
|
7
|
-
import { AlwaysDepth as
|
|
7
|
+
import { AlwaysDepth as k, BackSide as ee, BasicDepthPacking as A, Box3 as j, BoxGeometry as te, BufferAttribute as M, BufferGeometry as ne, CanvasTexture as re, CatmullRomCurve3 as ie, Color as N, ConeGeometry as ae, DataTexture as oe, DepthStencilFormat as se, DepthTexture as ce, DoubleSide as le, DynamicDrawUsage as ue, Euler as P, EventDispatcher as de, Float32BufferAttribute as F, FloatType as I, FrontSide as fe, Group as L, HalfFloatType as pe, Line as me, Line3 as he, LineBasicMaterial as ge, LineDashedMaterial as _e, LineSegments as ve, LinearFilter as R, LinearSRGBColorSpace as ye, Material as be, MathUtils as xe, Matrix4 as z, Mesh as B, MeshBasicMaterial as Se, MeshLambertMaterial as Ce, MeshNormalMaterial as we, NearestFilter as V, NoBlending as Te, NoColorSpace as Ee, NoToneMapping as De, Object3D as Oe, OrthographicCamera as ke, PerspectiveCamera as Ae, Plane as je, REVISION as Me, RGBAFormat as Ne, RGFormat as Pe, Ray as Fe, Raycaster as Ie, RedFormat as Le, RepeatWrapping as Re, SRGBColorSpace as ze, Scene as Be, ShaderMaterial as Ve, ShapeUtils as He, Sphere as Ue, SphereGeometry as We, Sprite as Ge, SpriteMaterial as Ke, Texture as qe, TubeGeometry as Je, Uint32BufferAttribute as Ye, Uniform as H, UnsignedByteType as Xe, UnsignedInt248Type as Ze, UnsignedIntType as Qe, Vector2 as U, Vector3 as W, WebGLRenderTarget as $e } from "three";
|
|
8
8
|
import { createStore as et } from "zustand/vanilla";
|
|
9
9
|
import { Fragment as tt, jsx as G, jsxs as nt } from "react/jsx-runtime";
|
|
10
10
|
import { useStore as rt } from "zustand";
|
|
@@ -2479,7 +2479,7 @@ var bi = new class {
|
|
|
2479
2479
|
}
|
|
2480
2480
|
return i;
|
|
2481
2481
|
}
|
|
2482
|
-
}(), xi = .5, Si = .04, Ci = .16, wi = Ci, Ti = xi * 2 - Ci * 2, Ei = xi - Si / 2, Di = xi - Ci / 2, Oi = xi - wi / 2, ki = .63, Ai = "#dfe6ec", ji = 260, Mi = 30, Ni = .3, Pi = 8, Fi = new W(0, 1, 0), Ii = 1e-8, Li = new
|
|
2482
|
+
}(), xi = .5, Si = .04, Ci = .16, wi = Ci, Ti = xi * 2 - Ci * 2, Ei = xi - Si / 2, Di = xi - Ci / 2, Oi = xi - wi / 2, ki = .63, Ai = "#dfe6ec", ji = 260, Mi = 30, Ni = .3, Pi = 8, Fi = new W(0, 1, 0), Ii = 1e-8, Li = new j(), Ri = new Ue(), zi = [
|
|
2483
2483
|
{
|
|
2484
2484
|
direction: [
|
|
2485
2485
|
0,
|
|
@@ -2740,7 +2740,7 @@ function Gi(e, t) {
|
|
|
2740
2740
|
r.font = i;
|
|
2741
2741
|
let a = r.measureText(e), o = a.actualBoundingBoxAscent || Mi * .8, s = a.actualBoundingBoxDescent || Mi * .2, c = Math.ceil(a.width + 36), l = Math.ceil(o + s + 20);
|
|
2742
2742
|
n.width = c, n.height = l, r.clearRect(0, 0, c, l), r.font = i, r.fillStyle = t, r.textAlign = "center", r.textBaseline = "alphabetic", r.fillText(e, c / 2, 10 + o);
|
|
2743
|
-
let u = new
|
|
2743
|
+
let u = new re(n);
|
|
2744
2744
|
return u.colorSpace = ze, u.generateMipmaps = !1, u.magFilter = R, u.minFilter = R, u.anisotropy = Pi, u.needsUpdate = !0, {
|
|
2745
2745
|
aspect: c / l,
|
|
2746
2746
|
texture: u
|
|
@@ -2841,7 +2841,7 @@ function $i({ active: e = !0, cameraRef: t, controlRef: n, modelRef: r }) {
|
|
|
2841
2841
|
return e.addEventListener("controlstart", r), () => {
|
|
2842
2842
|
e.removeEventListener("controlstart", r);
|
|
2843
2843
|
};
|
|
2844
|
-
}, [t, n]),
|
|
2844
|
+
}, [t, n]), D(() => {
|
|
2845
2845
|
if (!e) return;
|
|
2846
2846
|
let r = t.current;
|
|
2847
2847
|
if (!r) return;
|
|
@@ -2892,8 +2892,8 @@ var ea = /* @__PURE__ */ (() => {
|
|
|
2892
2892
|
0,
|
|
2893
2893
|
0,
|
|
2894
2894
|
2
|
|
2895
|
-
]), n = new
|
|
2896
|
-
return n.setAttribute("position", new
|
|
2895
|
+
]), n = new ne();
|
|
2896
|
+
return n.setAttribute("position", new M(e, 3)), n.setAttribute("uv", new M(t, 2)), n;
|
|
2897
2897
|
})(), ta = class e {
|
|
2898
2898
|
static get fullscreenGeometry() {
|
|
2899
2899
|
return ea;
|
|
@@ -2937,7 +2937,7 @@ var ea = /* @__PURE__ */ (() => {
|
|
|
2937
2937
|
getDepthTexture() {
|
|
2938
2938
|
return null;
|
|
2939
2939
|
}
|
|
2940
|
-
setDepthTexture(e, t =
|
|
2940
|
+
setDepthTexture(e, t = A) {}
|
|
2941
2941
|
render(e, t, n, r, i) {
|
|
2942
2942
|
throw Error("Render method not implemented!");
|
|
2943
2943
|
}
|
|
@@ -2979,7 +2979,7 @@ var ea = /* @__PURE__ */ (() => {
|
|
|
2979
2979
|
depthTest: !1,
|
|
2980
2980
|
fragmentShader: ra,
|
|
2981
2981
|
vertexShader: ia
|
|
2982
|
-
}), this.depthFunc =
|
|
2982
|
+
}), this.depthFunc = k;
|
|
2983
2983
|
}
|
|
2984
2984
|
get inputBuffer() {
|
|
2985
2985
|
return this.uniforms.inputBuffer.value;
|
|
@@ -3052,7 +3052,7 @@ var ea = /* @__PURE__ */ (() => {
|
|
|
3052
3052
|
initialize(e, t, n) {
|
|
3053
3053
|
n !== void 0 && (this.renderTarget.texture.type = n, n === Xe ? e !== null && e.outputColorSpace === ze && (this.renderTarget.texture.colorSpace = ze) : this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH = "1");
|
|
3054
3054
|
}
|
|
3055
|
-
}, sa = /* @__PURE__ */ new
|
|
3055
|
+
}, sa = /* @__PURE__ */ new N(), ca = class extends ta {
|
|
3056
3056
|
constructor(e = !0, t = !0, n = !1) {
|
|
3057
3057
|
super("ClearPass", null, null), this.needsSwap = !1, this.color = e, this.depth = t, this.stencil = n, this.overrideClearColor = null, this.overrideClearAlpha = -1;
|
|
3058
3058
|
}
|
|
@@ -3298,7 +3298,7 @@ var ea = /* @__PURE__ */ (() => {
|
|
|
3298
3298
|
case le:
|
|
3299
3299
|
t = this.materialsFlatShadedDoubleSide;
|
|
3300
3300
|
break;
|
|
3301
|
-
case
|
|
3301
|
+
case ee:
|
|
3302
3302
|
t = this.materialsFlatShadedBackSide;
|
|
3303
3303
|
break;
|
|
3304
3304
|
default:
|
|
@@ -3309,7 +3309,7 @@ var ea = /* @__PURE__ */ (() => {
|
|
|
3309
3309
|
case le:
|
|
3310
3310
|
t = this.materialsDoubleSide;
|
|
3311
3311
|
break;
|
|
3312
|
-
case
|
|
3312
|
+
case ee:
|
|
3313
3313
|
t = this.materialsBackSide;
|
|
3314
3314
|
break;
|
|
3315
3315
|
default:
|
|
@@ -3341,7 +3341,7 @@ var ea = /* @__PURE__ */ (() => {
|
|
|
3341
3341
|
for (let n of t) n.uniforms = Object.assign({}, e.uniforms), n.side = fe;
|
|
3342
3342
|
t[2].skinning = !0, this.materialsBackSide = t.map((t) => {
|
|
3343
3343
|
let n = this.cloneMaterial(t);
|
|
3344
|
-
return n.uniforms = Object.assign({}, e.uniforms), n.side =
|
|
3344
|
+
return n.uniforms = Object.assign({}, e.uniforms), n.side = ee, n;
|
|
3345
3345
|
}), this.materialsDoubleSide = t.map((t) => {
|
|
3346
3346
|
let n = this.cloneMaterial(t);
|
|
3347
3347
|
return n.uniforms = Object.assign({}, e.uniforms), n.side = le, n;
|
|
@@ -3350,7 +3350,7 @@ var ea = /* @__PURE__ */ (() => {
|
|
|
3350
3350
|
return n.uniforms = Object.assign({}, e.uniforms), n.flatShading = !0, n;
|
|
3351
3351
|
}), this.materialsFlatShadedBackSide = t.map((t) => {
|
|
3352
3352
|
let n = this.cloneMaterial(t);
|
|
3353
|
-
return n.uniforms = Object.assign({}, e.uniforms), n.flatShading = !0, n.side =
|
|
3353
|
+
return n.uniforms = Object.assign({}, e.uniforms), n.flatShading = !0, n.side = ee, n;
|
|
3354
3354
|
}), this.materialsFlatShadedDoubleSide = t.map((t) => {
|
|
3355
3355
|
let n = this.cloneMaterial(t);
|
|
3356
3356
|
return n.uniforms = Object.assign({}, e.uniforms), n.flatShading = !0, n.side = le, n;
|
|
@@ -3635,7 +3635,7 @@ var ea = /* @__PURE__ */ (() => {
|
|
|
3635
3635
|
setChanged() {
|
|
3636
3636
|
this.dispatchEvent({ type: "change" });
|
|
3637
3637
|
}
|
|
3638
|
-
setDepthTexture(e, t =
|
|
3638
|
+
setDepthTexture(e, t = A) {}
|
|
3639
3639
|
update(e, t, n) {}
|
|
3640
3640
|
setSize(e, t) {}
|
|
3641
3641
|
initialize(e, t, n) {}
|
|
@@ -3879,7 +3879,7 @@ var ja = "#include <common>\n#include <packing>\nuniform vec2 cameraNearFar;\n#d
|
|
|
3879
3879
|
set depthPacking(e) {
|
|
3880
3880
|
this.defines.DEPTH_PACKING = e.toFixed(0), this.needsUpdate = !0;
|
|
3881
3881
|
}
|
|
3882
|
-
setDepthBuffer(e, t =
|
|
3882
|
+
setDepthBuffer(e, t = A) {
|
|
3883
3883
|
this.depthBuffer = e, this.depthPacking = t;
|
|
3884
3884
|
}
|
|
3885
3885
|
set noiseTexture(e) {
|
|
@@ -4077,7 +4077,7 @@ var ja = "#include <common>\n#include <packing>\nuniform vec2 cameraNearFar;\n#d
|
|
|
4077
4077
|
set depthPacking(e) {
|
|
4078
4078
|
this.defines.DEPTH_PACKING = e.toFixed(0), this.needsUpdate = !0;
|
|
4079
4079
|
}
|
|
4080
|
-
setDepthBuffer(e, t =
|
|
4080
|
+
setDepthBuffer(e, t = A) {
|
|
4081
4081
|
this.depthBuffer = e, this.depthPacking = t;
|
|
4082
4082
|
}
|
|
4083
4083
|
set normalBuffer(e) {
|
|
@@ -4114,7 +4114,7 @@ var ja = "#include <common>\n#include <packing>\nuniform vec2 cameraNearFar;\n#d
|
|
|
4114
4114
|
getResolution() {
|
|
4115
4115
|
return this.resolution;
|
|
4116
4116
|
}
|
|
4117
|
-
setDepthTexture(e, t =
|
|
4117
|
+
setDepthTexture(e, t = A) {
|
|
4118
4118
|
this.fullscreenMaterial.depthBuffer = e, this.fullscreenMaterial.depthPacking = t;
|
|
4119
4119
|
}
|
|
4120
4120
|
render(e, t, n, r, i) {
|
|
@@ -4129,7 +4129,7 @@ var ja = "#include <common>\n#include <packing>\nuniform vec2 cameraNearFar;\n#d
|
|
|
4129
4129
|
if (!(r.getExtension("EXT_color_buffer_float") || r.getExtension("EXT_color_buffer_half_float"))) throw Error("Rendering to float texture is not supported.");
|
|
4130
4130
|
}
|
|
4131
4131
|
}, Ra = "uniform lowp sampler2D aoBuffer;uniform float luminanceInfluence;uniform float intensity;\n#if defined(DEPTH_AWARE_UPSAMPLING) && defined(NORMAL_DEPTH)\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D normalDepthBuffer;\n#else\nuniform mediump sampler2D normalDepthBuffer;\n#endif\n#endif\n#ifdef COLORIZE\nuniform vec3 color;\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){float aoLinear=texture2D(aoBuffer,uv).r;\n#if defined(DEPTH_AWARE_UPSAMPLING) && defined(NORMAL_DEPTH) && __VERSION__ == 300\nvec4 normalDepth[4];normalDepth[0]=textureOffset(normalDepthBuffer,uv,ivec2(0,0));normalDepth[1]=textureOffset(normalDepthBuffer,uv,ivec2(0,1));normalDepth[2]=textureOffset(normalDepthBuffer,uv,ivec2(1,0));normalDepth[3]=textureOffset(normalDepthBuffer,uv,ivec2(1,1));float dot01=dot(normalDepth[0].rgb,normalDepth[1].rgb);float dot02=dot(normalDepth[0].rgb,normalDepth[2].rgb);float dot03=dot(normalDepth[0].rgb,normalDepth[3].rgb);float minDot=min(dot01,min(dot02,dot03));float s=step(THRESHOLD,minDot);float smallestDistance=1.0;int index;for(int i=0;i<4;++i){float distance=abs(depth-normalDepth[i].a);if(distance<smallestDistance){smallestDistance=distance;index=i;}}ivec2 offsets[4];offsets[0]=ivec2(0,0);offsets[1]=ivec2(0,1);offsets[2]=ivec2(1,0);offsets[3]=ivec2(1,1);ivec2 coord=ivec2(uv*vec2(textureSize(aoBuffer,0)))+offsets[index];float aoNearest=texelFetch(aoBuffer,coord,0).r;float ao=mix(aoNearest,aoLinear,s);\n#else\nfloat ao=aoLinear;\n#endif\nfloat l=luminance(inputColor.rgb);ao=mix(ao,0.0,l*luminanceInfluence);ao=clamp(ao*intensity,0.0,1.0);\n#ifdef COLORIZE\noutputColor=vec4(1.0-ao*(1.0-color),inputColor.a);\n#else\noutputColor=vec4(vec3(1.0-ao),inputColor.a);\n#endif\n}", za = 64, Ba = class extends Sa {
|
|
4132
|
-
constructor(e, t, { blendFunction: n = J.MULTIPLY, samples: r = 9, rings: i = 7, normalDepthBuffer: a = null, depthAwareUpsampling: o = !0, worldDistanceThreshold: s, worldDistanceFalloff: c, worldProximityThreshold: l, worldProximityFalloff: u, distanceThreshold: d = .97, distanceFalloff: f = .03, rangeThreshold: p = 5e-4, rangeFalloff: m = .001, minRadiusScale: h = .1, luminanceInfluence: g = .7, radius: _ = .1825, intensity: v = 1, bias: y = .025, fade: b = .01, color: x = null, resolutionScale: S = 1, width: C = ya.AUTO_SIZE, height: w = ya.AUTO_SIZE, resolutionX:
|
|
4132
|
+
constructor(e, t, { blendFunction: n = J.MULTIPLY, samples: r = 9, rings: i = 7, normalDepthBuffer: a = null, depthAwareUpsampling: o = !0, worldDistanceThreshold: s, worldDistanceFalloff: c, worldProximityThreshold: l, worldProximityFalloff: u, distanceThreshold: d = .97, distanceFalloff: f = .03, rangeThreshold: p = 5e-4, rangeFalloff: m = .001, minRadiusScale: h = .1, luminanceInfluence: g = .7, radius: _ = .1825, intensity: v = 1, bias: y = .025, fade: b = .01, color: x = null, resolutionScale: S = 1, width: C = ya.AUTO_SIZE, height: w = ya.AUTO_SIZE, resolutionX: T = C, resolutionY: E = w } = {}) {
|
|
4133
4133
|
super("SSAOEffect", Ra, {
|
|
4134
4134
|
blendFunction: n,
|
|
4135
4135
|
attributes: ma.DEPTH,
|
|
@@ -4143,15 +4143,15 @@ var ja = "#include <common>\n#include <packing>\nuniform vec2 cameraNearFar;\n#d
|
|
|
4143
4143
|
["scale", new H(0)]
|
|
4144
4144
|
])
|
|
4145
4145
|
}), this.renderTarget = new $e(1, 1, { depthBuffer: !1 }), this.renderTarget.texture.name = "AO.Target", this.uniforms.get("aoBuffer").value = this.renderTarget.texture;
|
|
4146
|
-
let
|
|
4147
|
-
|
|
4146
|
+
let D = this.resolution = new ya(this, T, E, S);
|
|
4147
|
+
D.addEventListener("change", (e) => this.setSize(D.baseWidth, D.baseHeight)), this.camera = e, this.depthDownsamplingPass = new La({
|
|
4148
4148
|
normalBuffer: t,
|
|
4149
4149
|
resolutionScale: S
|
|
4150
4150
|
}), this.depthDownsamplingPass.enabled = a === null, this.ssaoPass = new Ca(new Na(e));
|
|
4151
|
-
let
|
|
4152
|
-
|
|
4153
|
-
let
|
|
4154
|
-
|
|
4151
|
+
let O = new Ta(za, za, Ne);
|
|
4152
|
+
O.wrapS = O.wrapT = Re;
|
|
4153
|
+
let k = this.ssaoMaterial;
|
|
4154
|
+
k.normalBuffer = t, k.noiseTexture = O, k.minRadiusScale = h, k.samples = r, k.radius = _, k.rings = i, k.fade = b, k.bias = y, k.distanceThreshold = d, k.distanceFalloff = f, k.proximityThreshold = p, k.proximityFalloff = m, s !== void 0 && (k.worldDistanceThreshold = s), c !== void 0 && (k.worldDistanceFalloff = c), l !== void 0 && (k.worldProximityThreshold = l), u !== void 0 && (k.worldProximityFalloff = u), a !== null && (this.ssaoMaterial.normalDepthBuffer = a, this.defines.set("NORMAL_DEPTH", "1")), this.depthAwareUpsampling = o, this.color = x;
|
|
4155
4155
|
}
|
|
4156
4156
|
set mainCamera(e) {
|
|
4157
4157
|
this.camera = e, this.ssaoMaterial.copyCameraSettings(e);
|
|
@@ -4210,7 +4210,7 @@ var ja = "#include <common>\n#include <packing>\nuniform vec2 cameraNearFar;\n#d
|
|
|
4210
4210
|
}
|
|
4211
4211
|
set color(e) {
|
|
4212
4212
|
let t = this.uniforms, n = this.defines;
|
|
4213
|
-
e === null ? n.has("COLORIZE") && (n.delete("COLORIZE"), t.get("color").value = null, this.setChanged()) : n.has("COLORIZE") ? t.get("color").value.set(e) : (n.set("COLORIZE", "1"), t.get("color").value = new
|
|
4213
|
+
e === null ? n.has("COLORIZE") && (n.delete("COLORIZE"), t.get("color").value = null, this.setChanged()) : n.has("COLORIZE") ? t.get("color").value.set(e) : (n.set("COLORIZE", "1"), t.get("color").value = new N(e), this.setChanged());
|
|
4214
4214
|
}
|
|
4215
4215
|
get luminanceInfluence() {
|
|
4216
4216
|
return this.uniforms.get("luminanceInfluence").value;
|
|
@@ -4236,7 +4236,7 @@ var ja = "#include <common>\n#include <packing>\nuniform vec2 cameraNearFar;\n#d
|
|
|
4236
4236
|
setProximityCutoff(e, t) {
|
|
4237
4237
|
this.ssaoMaterial.proximityThreshold = e, this.ssaoMaterial.proximityFalloff = t;
|
|
4238
4238
|
}
|
|
4239
|
-
setDepthTexture(e, t =
|
|
4239
|
+
setDepthTexture(e, t = A) {
|
|
4240
4240
|
this.depthDownsamplingPass.setDepthTexture(e, t), this.ssaoMaterial.depthBuffer = e, this.ssaoMaterial.depthPacking = t;
|
|
4241
4241
|
}
|
|
4242
4242
|
update(e, t, n) {
|
|
@@ -4301,7 +4301,7 @@ var ja = "#include <common>\n#include <packing>\nuniform vec2 cameraNearFar;\n#d
|
|
|
4301
4301
|
set depthPacking(e) {
|
|
4302
4302
|
this.defines.DEPTH_PACKING = e.toFixed(0), this.needsUpdate = !0;
|
|
4303
4303
|
}
|
|
4304
|
-
setDepthBuffer(e, t =
|
|
4304
|
+
setDepthBuffer(e, t = A) {
|
|
4305
4305
|
this.depthBuffer = e, this.depthPacking = t;
|
|
4306
4306
|
}
|
|
4307
4307
|
setShaderData(e) {
|
|
@@ -4456,7 +4456,7 @@ var qa = class extends ta {
|
|
|
4456
4456
|
getDepthTexture() {
|
|
4457
4457
|
return this.fullscreenMaterial.depthBuffer;
|
|
4458
4458
|
}
|
|
4459
|
-
setDepthTexture(e, t =
|
|
4459
|
+
setDepthTexture(e, t = A) {
|
|
4460
4460
|
this.fullscreenMaterial.depthBuffer = e, this.fullscreenMaterial.depthPacking = t;
|
|
4461
4461
|
for (let n of this.effects) n.setDepthTexture(e, t);
|
|
4462
4462
|
}
|
|
@@ -4493,7 +4493,7 @@ var qa = class extends ta {
|
|
|
4493
4493
|
let c = this.renderPass;
|
|
4494
4494
|
c.ignoreBackground = !0, c.skipShadowMapUpdate = !0;
|
|
4495
4495
|
let l = c.getClearPass();
|
|
4496
|
-
l.overrideClearColor = new
|
|
4496
|
+
l.overrideClearColor = new N(7829503), l.overrideClearAlpha = 1, this.renderTarget = n, this.renderTarget === void 0 && (this.renderTarget = new $e(1, 1, {
|
|
4497
4497
|
minFilter: V,
|
|
4498
4498
|
magFilter: V
|
|
4499
4499
|
}), this.renderTarget.texture.name = "NormalPass.Target");
|
|
@@ -5048,17 +5048,17 @@ new function e(t) {
|
|
|
5048
5048
|
}(Math.random());
|
|
5049
5049
|
//#endregion
|
|
5050
5050
|
//#region node_modules/@react-three/postprocessing/node_modules/maath/dist/easing-3be59c6d.esm.js
|
|
5051
|
-
var oo = /* @__PURE__ */ new class extends
|
|
5051
|
+
var oo = /* @__PURE__ */ new class extends ne {
|
|
5052
5052
|
boundingSphere = new Ue();
|
|
5053
5053
|
constructor() {
|
|
5054
|
-
super(), this.setAttribute("position", new
|
|
5054
|
+
super(), this.setAttribute("position", new M(new Float32Array([
|
|
5055
5055
|
-1,
|
|
5056
5056
|
-1,
|
|
5057
5057
|
3,
|
|
5058
5058
|
-1,
|
|
5059
5059
|
-1,
|
|
5060
5060
|
3
|
|
5061
|
-
]), 2)), this.setAttribute("uv", new
|
|
5061
|
+
]), 2)), this.setAttribute("uv", new M(new Float32Array([
|
|
5062
5062
|
0,
|
|
5063
5063
|
0,
|
|
5064
5064
|
2,
|
|
@@ -5247,7 +5247,7 @@ var _o = class extends ta {
|
|
|
5247
5247
|
renderMode: 0,
|
|
5248
5248
|
biasOffset: 0,
|
|
5249
5249
|
biasMultiplier: 0,
|
|
5250
|
-
color: new
|
|
5250
|
+
color: new N(0, 0, 0),
|
|
5251
5251
|
gammaCorrection: !0,
|
|
5252
5252
|
depthBufferType: vo.Default,
|
|
5253
5253
|
screenSpaceRadius: !1,
|
|
@@ -5296,7 +5296,7 @@ var _o = class extends ta {
|
|
|
5296
5296
|
opacity: 1,
|
|
5297
5297
|
vertexShader: "\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = vec4(position, 1);\n }",
|
|
5298
5298
|
fragmentShader: "\n uniform sampler2D tDiffuse;\n uniform float frame;\n varying vec2 vUv;\n void main() {\n vec4 color = texture2D(tDiffuse, vUv);\n gl_FragColor = vec4(color.rgb, 1.0 / (frame + 1.0));\n }\n "
|
|
5299
|
-
})), this.bluenoise = new oe(mo, 128, 128), this.bluenoise.colorSpace = Ee, this.bluenoise.wrapS = Re, this.bluenoise.wrapT = Re, this.bluenoise.minFilter = V, this.bluenoise.magFilter = V, this.bluenoise.needsUpdate = !0, this.lastTime = 0, this.timeRollingAverage = .99, this.needsDepthTexture = !0, this.needsSwap = !0, this._r = new U(), this._c = new
|
|
5299
|
+
})), this.bluenoise = new oe(mo, 128, 128), this.bluenoise.colorSpace = Ee, this.bluenoise.wrapS = Re, this.bluenoise.wrapT = Re, this.bluenoise.minFilter = V, this.bluenoise.magFilter = V, this.bluenoise.needsUpdate = !0, this.lastTime = 0, this.timeRollingAverage = .99, this.needsDepthTexture = !0, this.needsSwap = !0, this._r = new U(), this._c = new N();
|
|
5300
5300
|
}
|
|
5301
5301
|
configureHalfResTargets() {
|
|
5302
5302
|
this.firstFrame(), this.configuration.halfRes ? (this.depthDownsampleTarget = new ho(this.width / 2, this.height / 2, 2), Me <= 161 && (this.depthDownsampleTarget.textures = this.depthDownsampleTarget.texture), this.depthDownsampleTarget.textures[0].format = Le, this.depthDownsampleTarget.textures[0].type = I, this.depthDownsampleTarget.textures[0].minFilter = V, this.depthDownsampleTarget.textures[0].magFilter = V, this.depthDownsampleTarget.textures[0].depthBuffer = !1, this.depthDownsampleTarget.textures[1].format = Ne, this.depthDownsampleTarget.textures[1].type = pe, this.depthDownsampleTarget.textures[1].minFilter = V, this.depthDownsampleTarget.textures[1].magFilter = V, this.depthDownsampleTarget.textures[1].depthBuffer = !1, this.depthDownsampleQuad = new co(new Ve(po))) : (this.depthDownsampleTarget &&= (this.depthDownsampleTarget.dispose(), null), this.depthDownsampleQuad &&= (this.depthDownsampleQuad.dispose(), null));
|
|
@@ -5330,10 +5330,10 @@ var _o = class extends ta {
|
|
|
5330
5330
|
}))) : (this.transparencyRenderTargetDWFalse &&= (this.transparencyRenderTargetDWFalse.dispose(), null), this.transparencyRenderTargetDWTrue &&= (this.transparencyRenderTargetDWTrue.dispose(), null), this.depthCopyPass &&= (this.depthCopyPass.dispose(), null));
|
|
5331
5331
|
}
|
|
5332
5332
|
renderTransparency(e) {
|
|
5333
|
-
let t = this.scene.background, n = e.getClearColor(new
|
|
5333
|
+
let t = this.scene.background, n = e.getClearColor(new N()), r = e.getClearAlpha(), i = /* @__PURE__ */ new Map(), a = e.autoClearDepth;
|
|
5334
5334
|
this.scene.traverse((e) => {
|
|
5335
5335
|
i.set(e, e.visible);
|
|
5336
|
-
}), this.scene.background = null, e.autoClearDepth = !1, e.setClearColor(new
|
|
5336
|
+
}), this.scene.background = null, e.autoClearDepth = !1, e.setClearColor(new N(0, 0, 0), 0), this.depthCopyPass.material.uniforms.depthTexture.value = this.depthTexture, this.depthCopyPass.material.uniforms.reverseDepthBuffer.value = this.configuration.depthBufferType === vo.Reverse, e.setRenderTarget(this.transparencyRenderTargetDWFalse), this.scene.traverse((e) => {
|
|
5337
5337
|
e.material && (e.visible = i.get(e) && (e.material.transparent && !e.material.depthWrite && !e.userData.treatAsOpaque || !!e.userData.cannotReceiveAO));
|
|
5338
5338
|
}), e.clear(!0, !0, !0), this.depthCopyPass.render(e), e.render(this.scene, this.camera), e.setRenderTarget(this.transparencyRenderTargetDWTrue), this.scene.traverse((e) => {
|
|
5339
5339
|
e.material && (e.visible = i.get(e) && e.material.transparent && e.material.depthWrite && !e.userData.treatAsOpaque);
|
|
@@ -5421,7 +5421,7 @@ var _o = class extends ta {
|
|
|
5421
5421
|
Log: 2,
|
|
5422
5422
|
Reverse: 3
|
|
5423
5423
|
}, yo = /* @__PURE__ */ f(null), bo = (e) => (e.getAttributes() & 2) == 2, xo = /* @__PURE__ */ m(/* @__PURE__ */ p(({ children: e, camera: t, scene: n, resolutionScale: r, enabled: i = !0, renderPriority: a = 1, autoClear: o = !0, depthBuffer: s, enableNormalPass: c, stencilBuffer: l, multisampling: u = 8, frameBufferType: d = pe }, f) => {
|
|
5424
|
-
let { gl: p, scene: m, camera: h, size: g } =
|
|
5424
|
+
let { gl: p, scene: m, camera: h, size: g } = O(), S = n || m, C = t || h, [w, T, E] = b(() => {
|
|
5425
5425
|
let e = new pa(p, {
|
|
5426
5426
|
depthBuffer: s,
|
|
5427
5427
|
stencilBuffer: l,
|
|
@@ -5449,15 +5449,15 @@ var _o = class extends ta {
|
|
|
5449
5449
|
c,
|
|
5450
5450
|
r
|
|
5451
5451
|
]);
|
|
5452
|
-
_(() => w?.setSize(g.width, g.height), [w, g]),
|
|
5452
|
+
_(() => w?.setSize(g.width, g.height), [w, g]), D((e, t) => {
|
|
5453
5453
|
if (i) {
|
|
5454
5454
|
let e = p.autoClear;
|
|
5455
5455
|
p.autoClear = o, l && !o && p.clearStencil(), w.render(t), p.autoClear = e;
|
|
5456
5456
|
}
|
|
5457
5457
|
}, i ? a : 0);
|
|
5458
|
-
let
|
|
5458
|
+
let k = x(null);
|
|
5459
5459
|
y(() => {
|
|
5460
|
-
let e = [], t =
|
|
5460
|
+
let e = [], t = k.current.__r3f;
|
|
5461
5461
|
if (t && w) {
|
|
5462
5462
|
let n = t.children;
|
|
5463
5463
|
for (let t = 0; t < n.length; t++) {
|
|
@@ -5473,43 +5473,43 @@ var _o = class extends ta {
|
|
|
5473
5473
|
} else r instanceof ta && e.push(r);
|
|
5474
5474
|
}
|
|
5475
5475
|
for (let t of e) w?.addPass(t);
|
|
5476
|
-
|
|
5476
|
+
T && (T.enabled = !0), E && (E.enabled = !0);
|
|
5477
5477
|
}
|
|
5478
5478
|
return () => {
|
|
5479
5479
|
for (let t of e) w?.removePass(t);
|
|
5480
|
-
|
|
5480
|
+
T && (T.enabled = !1), E && (E.enabled = !1);
|
|
5481
5481
|
};
|
|
5482
5482
|
}, [
|
|
5483
5483
|
w,
|
|
5484
5484
|
e,
|
|
5485
5485
|
C,
|
|
5486
|
-
|
|
5487
|
-
|
|
5486
|
+
T,
|
|
5487
|
+
E
|
|
5488
5488
|
]), _(() => {
|
|
5489
5489
|
let e = p.toneMapping;
|
|
5490
5490
|
return p.toneMapping = De, () => {
|
|
5491
5491
|
p.toneMapping = e;
|
|
5492
5492
|
};
|
|
5493
5493
|
}, [p]);
|
|
5494
|
-
let
|
|
5494
|
+
let ee = b(() => ({
|
|
5495
5495
|
composer: w,
|
|
5496
|
-
normalPass:
|
|
5497
|
-
downSamplingPass:
|
|
5496
|
+
normalPass: T,
|
|
5497
|
+
downSamplingPass: E,
|
|
5498
5498
|
resolutionScale: r,
|
|
5499
5499
|
camera: C,
|
|
5500
5500
|
scene: S
|
|
5501
5501
|
}), [
|
|
5502
5502
|
w,
|
|
5503
|
-
ee,
|
|
5504
5503
|
T,
|
|
5504
|
+
E,
|
|
5505
5505
|
r,
|
|
5506
5506
|
C,
|
|
5507
5507
|
S
|
|
5508
5508
|
]);
|
|
5509
5509
|
return v(f, () => w, [w]), /* @__PURE__ */ G(yo.Provider, {
|
|
5510
|
-
value:
|
|
5510
|
+
value: ee,
|
|
5511
5511
|
children: /* @__PURE__ */ G("group", {
|
|
5512
|
-
ref:
|
|
5512
|
+
ref: k,
|
|
5513
5513
|
children: e
|
|
5514
5514
|
})
|
|
5515
5515
|
});
|
|
@@ -5517,9 +5517,9 @@ var _o = class extends ta {
|
|
|
5517
5517
|
let a = Co.get(e);
|
|
5518
5518
|
if (!a) {
|
|
5519
5519
|
let t = `@react-three/postprocessing/${e.name}-${So++}`;
|
|
5520
|
-
|
|
5520
|
+
E({ [t]: e }), Co.set(e, a = t);
|
|
5521
5521
|
}
|
|
5522
|
-
let o =
|
|
5522
|
+
let o = O((e) => e.camera), s = u.useMemo(() => [...t?.args ?? [], ...i.args ?? [{
|
|
5523
5523
|
...t,
|
|
5524
5524
|
...i
|
|
5525
5525
|
}]], [JSON.stringify(i)]);
|
|
@@ -5560,9 +5560,9 @@ var _o = class extends ta {
|
|
|
5560
5560
|
dispose: null
|
|
5561
5561
|
});
|
|
5562
5562
|
}), Eo = /* @__PURE__ */ p(({ halfRes: e, screenSpaceRadius: t, quality: n, depthAwareUpsampling: r = !0, aoRadius: i = 5, aoSamples: a = 16, denoiseSamples: o = 4, denoiseRadius: s = 12, distanceFalloff: c = 1, intensity: l = 1, color: u, renderMode: d = 0 }, f) => {
|
|
5563
|
-
let { camera: p, scene: m } =
|
|
5563
|
+
let { camera: p, scene: m } = O(), h = b(() => new _o(m, p), [p, m]);
|
|
5564
5564
|
return y(() => {
|
|
5565
|
-
|
|
5565
|
+
T(h.configuration, {
|
|
5566
5566
|
color: u,
|
|
5567
5567
|
aoRadius: i,
|
|
5568
5568
|
distanceFalloff: c,
|
|
@@ -5598,8 +5598,8 @@ var _o = class extends ta {
|
|
|
5598
5598
|
//#endregion
|
|
5599
5599
|
//#region src/viewer/ViewerComponents/Postproduction.tsx
|
|
5600
5600
|
function Do({ pipelineRef: e }) {
|
|
5601
|
-
let t =
|
|
5602
|
-
return
|
|
5601
|
+
let t = O((e) => e.camera), n = O((e) => e.gl), r = O((e) => e.scene);
|
|
5602
|
+
return D(() => {
|
|
5603
5603
|
let i = e.current;
|
|
5604
5604
|
if (i) {
|
|
5605
5605
|
i.render();
|
|
@@ -5667,7 +5667,7 @@ function Ao({ enabled: e }) {
|
|
|
5667
5667
|
});
|
|
5668
5668
|
}
|
|
5669
5669
|
function jo({ enabled: e }) {
|
|
5670
|
-
let t =
|
|
5670
|
+
let t = O((e) => e.camera), n = O((e) => e.gl), r = O((e) => e.invalidate), i = O((e) => e.scene), a = K((e) => e.postproductionPassType), o = K((e) => e.postproductionSaturation), s = K((e) => e.setPostproductionActivePassFilter), c = Oo(a), l = o !== 0, u = e && (c || l), d = x(null), [f, p] = S(null);
|
|
5671
5671
|
return _(() => {
|
|
5672
5672
|
u || s(null);
|
|
5673
5673
|
}, [u, s]), _(() => {
|
|
@@ -5769,7 +5769,7 @@ function Po(e, t, n = !1) {
|
|
|
5769
5769
|
}
|
|
5770
5770
|
}
|
|
5771
5771
|
function Fo({ active: e }) {
|
|
5772
|
-
let t =
|
|
5772
|
+
let t = O((e) => e.gl), n = O((e) => e.size), r = O((e) => e.viewport.dpr);
|
|
5773
5773
|
return _(() => {
|
|
5774
5774
|
if (!e) return;
|
|
5775
5775
|
let n = null, i = null, a = () => {
|
|
@@ -5802,7 +5802,7 @@ function Io({ active: e, onReady: t }) {
|
|
|
5802
5802
|
};
|
|
5803
5803
|
}, [
|
|
5804
5804
|
e,
|
|
5805
|
-
|
|
5805
|
+
O((e) => e.gl),
|
|
5806
5806
|
t
|
|
5807
5807
|
]), null;
|
|
5808
5808
|
}
|
|
@@ -5951,8 +5951,8 @@ function cs(e, t, n, r, i = Infinity, a, o) {
|
|
|
5951
5951
|
u = e.x - p, d = e.y - m, f = e.z - h;
|
|
5952
5952
|
let S = (n.x + s * p) * a, C = (n.y + s * m) * a, w = (n.z + s * h) * a;
|
|
5953
5953
|
n.x = (n.x - s * S) * l, n.y = (n.y - s * C) * l, n.z = (n.z - s * w) * l, o.x = u + (p + S) * l, o.y = d + (m + C) * l, o.z = f + (h + w) * l;
|
|
5954
|
-
let
|
|
5955
|
-
return
|
|
5954
|
+
let T = g - e.x, E = _ - e.y, D = v - e.z, O = o.x - g, k = o.y - _, ee = o.z - v;
|
|
5955
|
+
return T * O + E * k + D * ee > 0 && (o.x = g, o.y = _, o.z = v, n.x = (o.x - g) / a, n.y = (o.y - _) / a, n.z = (o.z - v) / a), o;
|
|
5956
5956
|
}
|
|
5957
5957
|
function ls(e, t) {
|
|
5958
5958
|
t.set(0, 0), e.forEach((e) => {
|
|
@@ -6710,7 +6710,7 @@ function zs(e) {
|
|
|
6710
6710
|
return !0;
|
|
6711
6711
|
}
|
|
6712
6712
|
function Bs(e) {
|
|
6713
|
-
let t =
|
|
6713
|
+
let t = O((e) => e.camera), n = O((e) => e.gl), r = O((e) => e.raycaster), i = x(null), a = x(null), o = x(new U()), s = h((e) => {
|
|
6714
6714
|
i.current = e;
|
|
6715
6715
|
}, []), c = h(() => {
|
|
6716
6716
|
let e = i.current;
|
|
@@ -6774,7 +6774,7 @@ function Ks(e) {
|
|
|
6774
6774
|
r.font = i;
|
|
6775
6775
|
let a = r.measureText(e), o = a.actualBoundingBoxAscent || Vs * .8, s = a.actualBoundingBoxDescent || Vs * .2, c = Math.max(1, Math.ceil(a.width + Hs * 2)), l = Math.max(1, Math.ceil(o + s + Us * 2));
|
|
6776
6776
|
n.width = Math.ceil(c * t), n.height = Math.ceil(l * t), r.scale(t, t), r.clearRect(0, 0, c, l), r.fillStyle = "rgba(255, 255, 255, 0.86)", r.strokeStyle = "rgba(29, 39, 51, 0.22)", r.lineWidth = 1, r.beginPath(), r.roundRect(.5, .5, c - 1, l - 1, 4), r.fill(), r.stroke(), r.font = i, r.fillStyle = "#111827", r.textAlign = "center", r.textBaseline = "middle", r.fillText(e, c / 2, l / 2);
|
|
6777
|
-
let u = new
|
|
6777
|
+
let u = new re(n);
|
|
6778
6778
|
return u.colorSpace = ze, u.generateMipmaps = !1, u.magFilter = R, u.minFilter = R, u.needsUpdate = !0, {
|
|
6779
6779
|
height: l,
|
|
6780
6780
|
texture: u,
|
|
@@ -6794,7 +6794,7 @@ var qs = class e {
|
|
|
6794
6794
|
boundingMaterial;
|
|
6795
6795
|
endpointGeometry;
|
|
6796
6796
|
endpointMaterial;
|
|
6797
|
-
lineGeometry = new
|
|
6797
|
+
lineGeometry = new ne();
|
|
6798
6798
|
lineMaterial;
|
|
6799
6799
|
ownerRoot;
|
|
6800
6800
|
endpointBaseScale;
|
|
@@ -6865,7 +6865,7 @@ var qs = class e {
|
|
|
6865
6865
|
return e.renderOrder = 5, e;
|
|
6866
6866
|
}
|
|
6867
6867
|
createBoundingBoxMesh() {
|
|
6868
|
-
let e = new B(new
|
|
6868
|
+
let e = new B(new te(1, 1, Math.max(this.length, .001)), this.boundingMaterial);
|
|
6869
6869
|
return e.renderOrder = 3, e;
|
|
6870
6870
|
}
|
|
6871
6871
|
getTextContent() {
|
|
@@ -6884,7 +6884,7 @@ var qs = class e {
|
|
|
6884
6884
|
e.setXYZ(0, this.start.x, this.start.y, this.start.z), e.setXYZ(1, this.end.x, this.end.y, this.end.z), e.needsUpdate = !0, this.lineGeometry.computeBoundingSphere(), this.line.computeLineDistances(), this.endpointMeshes[0]?.position.copy(this.start), this.endpointMeshes[1]?.position.copy(this.end), this.endpointMeshes[0]?.lookAt(this.end), this.endpointMeshes[1]?.lookAt(this.start), this.labelSprite.position.copy(this.center), this.updateLabel(), this.updateBoundingBox();
|
|
6885
6885
|
}
|
|
6886
6886
|
updateBoundingBox() {
|
|
6887
|
-
this.boundingMesh && (this.boundingMesh.position.copy(this.center), this.boundingMesh.lookAt(this.end), this.boundingMesh.geometry.dispose(), this.boundingMesh.geometry = new
|
|
6887
|
+
this.boundingMesh && (this.boundingMesh.position.copy(this.center), this.boundingMesh.lookAt(this.end), this.boundingMesh.geometry.dispose(), this.boundingMesh.geometry = new te(1, 1, Math.max(this.length, .001)));
|
|
6888
6888
|
}
|
|
6889
6889
|
rescaleMesh(t, n, r) {
|
|
6890
6890
|
let i = Gs(n, t.position.distanceTo(n.position)) / Math.max(1, r) * 12 * e.scaleFactor;
|
|
@@ -6992,7 +6992,7 @@ var nc = class e {
|
|
|
6992
6992
|
this.setActive(!this.active);
|
|
6993
6993
|
}
|
|
6994
6994
|
setColor(e) {
|
|
6995
|
-
let t = e instanceof
|
|
6995
|
+
let t = e instanceof N ? e : new N(e);
|
|
6996
6996
|
this.endpointMaterial.color.copy(t), this.lineMaterial.color.copy(t), this.dimensions.forEach((e) => {
|
|
6997
6997
|
e.dimensionColor = t;
|
|
6998
6998
|
}), this.invalidate();
|
|
@@ -7235,7 +7235,7 @@ var nc = class e {
|
|
|
7235
7235
|
this.axis = this.axis === e ? null : e, this.shiftAxis = null, this.tabAxisOverride = !1;
|
|
7236
7236
|
}
|
|
7237
7237
|
static createEndpointGeometry(e = .1, t = .03) {
|
|
7238
|
-
let n = new
|
|
7238
|
+
let n = new ae(t, e);
|
|
7239
7239
|
return n.translate(0, -e / 2, 0), n.rotateX(-Math.PI / 2), n;
|
|
7240
7240
|
}
|
|
7241
7241
|
static createPreviewGeometry() {
|
|
@@ -7243,7 +7243,7 @@ var nc = class e {
|
|
|
7243
7243
|
}
|
|
7244
7244
|
};
|
|
7245
7245
|
function rc(e, t, n, r, i, a) {
|
|
7246
|
-
let o =
|
|
7246
|
+
let o = O((e) => e.camera), s = O((e) => e.gl), c = O((e) => e.scene), l = O((e) => e.size), u = Tt(), d = b(() => new nc({
|
|
7247
7247
|
camera: o,
|
|
7248
7248
|
cameraUtils: n,
|
|
7249
7249
|
controlRef: t,
|
|
@@ -7323,7 +7323,7 @@ function rc(e, t, n, r, i, a) {
|
|
|
7323
7323
|
c,
|
|
7324
7324
|
l.height,
|
|
7325
7325
|
u
|
|
7326
|
-
]), _(() => () => d.dispose(), [d]),
|
|
7326
|
+
]), _(() => () => d.dispose(), [d]), D(() => {
|
|
7327
7327
|
d.updateFrame();
|
|
7328
7328
|
}), b(() => ({
|
|
7329
7329
|
cancelDrawing: () => d.cancelDrawing(),
|
|
@@ -7359,7 +7359,7 @@ var ic = {
|
|
|
7359
7359
|
}, ac = "#ee2fe4", oc = .08, sc = .2, cc = .3, lc = 2, uc = {
|
|
7360
7360
|
x: 52,
|
|
7361
7361
|
y: -18
|
|
7362
|
-
}, dc = "Note", fc = "Comment", pc = 6, mc = new
|
|
7362
|
+
}, dc = "Note", fc = "Comment", pc = 6, mc = new j(), hc = new W(), gc = new W(), _c = new W(), vc = new W(), yc = new W(), bc = new W(), xc = new U();
|
|
7363
7363
|
function Sc(e) {
|
|
7364
7364
|
return e instanceof W ? e.clone() : Array.isArray(e) ? new W(e[0], e[1], e[2]) : new W(e.x, e.y, e.z);
|
|
7365
7365
|
}
|
|
@@ -7409,7 +7409,7 @@ function jc(e) {
|
|
|
7409
7409
|
function Mc(e, t, n, r) {
|
|
7410
7410
|
let { right: i, up: a } = kc(n), o = e.clone().add(t).multiplyScalar(.5), s = t.clone().sub(e).multiplyScalar(.5), c = Math.max(Math.abs(s.dot(i)), .15), l = Math.max(Math.abs(s.dot(a)), .15), u = Math.max(c, l) * oc, d = c + u, f = l + u, p = o.clone().addScaledVector(i, -d).addScaledVector(a, -f), m = o.clone().addScaledVector(i, d).addScaledVector(a, -f), h = o.clone().addScaledVector(i, d).addScaledVector(a, f), g = o.clone().addScaledVector(i, -d).addScaledVector(a, f), _ = cc, v = jc(d * 2), y = jc(f * 2), b = [];
|
|
7411
7411
|
Ac(b, p, m, a.clone().negate(), v, _), Ac(b, m, h, i, y, _), Ac(b, h, g, a, v, _), Ac(b, g, p, i.clone().negate(), y, _), b.push(b[0].clone());
|
|
7412
|
-
let x = new Je(new
|
|
7412
|
+
let x = new Je(new ie(b, !0, "catmullrom", .35), Math.max(b.length * 2, 80), sc, 6, !0);
|
|
7413
7413
|
x.computeBoundingSphere();
|
|
7414
7414
|
let S = new B(x, new Se({
|
|
7415
7415
|
color: Ec(r),
|
|
@@ -7510,7 +7510,7 @@ function Fc({ note: e, onContentChange: t, onOffsetChange: n }) {
|
|
|
7510
7510
|
outline: "none",
|
|
7511
7511
|
padding: 0,
|
|
7512
7512
|
width: "100%"
|
|
7513
|
-
},
|
|
7513
|
+
}, T = {
|
|
7514
7514
|
...w,
|
|
7515
7515
|
color: "#92400e",
|
|
7516
7516
|
fontSize: 11,
|
|
@@ -7518,13 +7518,13 @@ function Fc({ note: e, onContentChange: t, onOffsetChange: n }) {
|
|
|
7518
7518
|
letterSpacing: .4,
|
|
7519
7519
|
marginBottom: 4,
|
|
7520
7520
|
textTransform: "uppercase"
|
|
7521
|
-
},
|
|
7521
|
+
}, E = {
|
|
7522
7522
|
...w,
|
|
7523
7523
|
color: "#374151",
|
|
7524
7524
|
fontSize: 12,
|
|
7525
7525
|
lineHeight: 1.35,
|
|
7526
7526
|
resize: "none"
|
|
7527
|
-
},
|
|
7527
|
+
}, D = h(() => {
|
|
7528
7528
|
let e = r.current;
|
|
7529
7529
|
if (!e) return;
|
|
7530
7530
|
let t = e.getBoundingClientRect(), n = Math.max(t.width || e.offsetWidth || 1, 1), i = Math.max(t.height || e.offsetHeight || 1, 1);
|
|
@@ -7540,28 +7540,28 @@ function Fc({ note: e, onContentChange: t, onOffsetChange: n }) {
|
|
|
7540
7540
|
e.id,
|
|
7541
7541
|
n
|
|
7542
7542
|
]);
|
|
7543
|
-
let
|
|
7543
|
+
let O = h((e) => {
|
|
7544
7544
|
let t = s.current;
|
|
7545
7545
|
t && (e.preventDefault(), o.current(i.current, {
|
|
7546
7546
|
x: t.startOffset.x + e.clientX - t.startX,
|
|
7547
7547
|
y: t.startOffset.y + e.clientY - t.startY
|
|
7548
7548
|
}));
|
|
7549
|
-
}, []),
|
|
7550
|
-
s.current && (s.current = null, document.removeEventListener("pointermove",
|
|
7551
|
-
}, [
|
|
7549
|
+
}, []), k = h(() => {
|
|
7550
|
+
s.current && (s.current = null, document.removeEventListener("pointermove", O), document.removeEventListener("pointerup", k), document.removeEventListener("pointercancel", k));
|
|
7551
|
+
}, [O]), ee = h((e) => {
|
|
7552
7552
|
e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement || e.target instanceof HTMLButtonElement || (e.preventDefault(), e.stopPropagation(), e.nativeEvent.stopImmediatePropagation?.(), e.currentTarget.setPointerCapture?.(e.pointerId), s.current = {
|
|
7553
7553
|
startOffset: { ...a.current },
|
|
7554
7554
|
startX: e.clientX,
|
|
7555
7555
|
startY: e.clientY
|
|
7556
|
-
}, document.addEventListener("pointermove",
|
|
7557
|
-
}, [
|
|
7556
|
+
}, document.addEventListener("pointermove", O), document.addEventListener("pointerup", k), document.addEventListener("pointercancel", k));
|
|
7557
|
+
}, [O, k]);
|
|
7558
7558
|
return y(() => {
|
|
7559
7559
|
let e = r.current;
|
|
7560
7560
|
if (!e) return;
|
|
7561
|
-
|
|
7561
|
+
D();
|
|
7562
7562
|
let t = 0, n = requestAnimationFrame(() => {
|
|
7563
|
-
|
|
7564
|
-
}), i = typeof ResizeObserver < "u" ? new ResizeObserver(
|
|
7563
|
+
D(), t = requestAnimationFrame(D);
|
|
7564
|
+
}), i = typeof ResizeObserver < "u" ? new ResizeObserver(D) : null;
|
|
7565
7565
|
return i?.observe(e), () => {
|
|
7566
7566
|
cancelAnimationFrame(n), t && cancelAnimationFrame(t), i?.disconnect();
|
|
7567
7567
|
};
|
|
@@ -7569,10 +7569,10 @@ function Fc({ note: e, onContentChange: t, onOffsetChange: n }) {
|
|
|
7569
7569
|
e.settings?.render,
|
|
7570
7570
|
e.text,
|
|
7571
7571
|
e.title,
|
|
7572
|
-
|
|
7572
|
+
D
|
|
7573
7573
|
]), _(() => () => {
|
|
7574
|
-
document.removeEventListener("pointermove",
|
|
7575
|
-
}, [
|
|
7574
|
+
document.removeEventListener("pointermove", O), document.removeEventListener("pointerup", k), document.removeEventListener("pointercancel", k);
|
|
7575
|
+
}, [O, k]), /* @__PURE__ */ G(ot, {
|
|
7576
7576
|
center: !1,
|
|
7577
7577
|
position: e.point.toArray(),
|
|
7578
7578
|
transform: !1,
|
|
@@ -7589,18 +7589,18 @@ function Fc({ note: e, onContentChange: t, onOffsetChange: n }) {
|
|
|
7589
7589
|
/* @__PURE__ */ nt("div", {
|
|
7590
7590
|
ref: r,
|
|
7591
7591
|
style: v,
|
|
7592
|
-
onPointerDownCapture:
|
|
7592
|
+
onPointerDownCapture: ee,
|
|
7593
7593
|
children: [/* @__PURE__ */ G("div", {
|
|
7594
7594
|
style: b,
|
|
7595
|
-
onPointerDownCapture:
|
|
7595
|
+
onPointerDownCapture: ee,
|
|
7596
7596
|
children: /* @__PURE__ */ G("div", { style: C })
|
|
7597
7597
|
}), e.settings?.render ? /* @__PURE__ */ G(Nc, { content: e.settings.render }) : /* @__PURE__ */ nt(tt, { children: [/* @__PURE__ */ G("input", {
|
|
7598
|
-
style:
|
|
7598
|
+
style: T,
|
|
7599
7599
|
value: e.title,
|
|
7600
7600
|
onChange: (n) => t(e.id, n.target.value, e.text)
|
|
7601
7601
|
}), /* @__PURE__ */ G("textarea", {
|
|
7602
7602
|
rows: 2,
|
|
7603
|
-
style:
|
|
7603
|
+
style: E,
|
|
7604
7604
|
value: e.text,
|
|
7605
7605
|
onChange: (n) => t(e.id, e.title, n.target.value)
|
|
7606
7606
|
})] })]
|
|
@@ -7829,7 +7829,7 @@ var Ic = class {
|
|
|
7829
7829
|
};
|
|
7830
7830
|
};
|
|
7831
7831
|
function Lc(e, t) {
|
|
7832
|
-
let n =
|
|
7832
|
+
let n = O((e) => e.camera), r = O((e) => e.gl), i = O((e) => e.scene), a = t?.is2DView, o = t?.onChange, [s, c] = S(0), l = h(() => {
|
|
7833
7833
|
c((e) => e + 1), o?.();
|
|
7834
7834
|
}, [o]), u = b(() => new Ic({
|
|
7835
7835
|
camera: n,
|
|
@@ -7936,7 +7936,7 @@ function Zc(e, t) {
|
|
|
7936
7936
|
return n.size;
|
|
7937
7937
|
}
|
|
7938
7938
|
function Qc(e, t) {
|
|
7939
|
-
return new
|
|
7939
|
+
return new M(t ? new Uint32Array(e) : new Uint8Array(e), 1);
|
|
7940
7940
|
}
|
|
7941
7941
|
function $c(e) {
|
|
7942
7942
|
let t = e;
|
|
@@ -7953,8 +7953,8 @@ var tl = class {
|
|
|
7953
7953
|
capMesh;
|
|
7954
7954
|
context;
|
|
7955
7955
|
root = new L();
|
|
7956
|
-
box = new
|
|
7957
|
-
meshBox = new
|
|
7956
|
+
box = new j();
|
|
7957
|
+
meshBox = new j();
|
|
7958
7958
|
inverseMatrix = new z();
|
|
7959
7959
|
localPlane = new je();
|
|
7960
7960
|
tempLine = new he();
|
|
@@ -7972,7 +7972,7 @@ var tl = class {
|
|
|
7972
7972
|
colorIndex: [0],
|
|
7973
7973
|
ids: [0],
|
|
7974
7974
|
modelID: [0]
|
|
7975
|
-
}, this.updateBaseMaterialColor(), e.getUseWebGPU() ? this.setupWebGpuCapMaterial() : this.setupCapMaterialShader(), this.capMesh = new B(new
|
|
7975
|
+
}, this.updateBaseMaterialColor(), e.getUseWebGPU() ? this.setupWebGpuCapMaterial() : this.setupCapMaterialShader(), this.capMesh = new B(new ne(), this.capMaterial), this.capMesh.frustumCulled = !1, this.capMesh.renderOrder = Uc, this.root.add(this.capMesh), this.root.visible = this.active, this.root.name = "clipping-caps", this.root.renderOrder = Uc, this.context.getScene().add(this.root), this.context.caps.push(this), this.update();
|
|
7976
7976
|
}
|
|
7977
7977
|
createCapMaterial() {
|
|
7978
7978
|
return this.context.getUseWebGPU() ? new r({
|
|
@@ -8038,7 +8038,7 @@ var tl = class {
|
|
|
8038
8038
|
$c(this.capMesh.geometry), this.capMesh.geometry.dispose(), this.capMesh.geometry = e, this.updateVisualState(), this.capMesh.visible = (e.getAttribute("position")?.count ?? 0) >= 3;
|
|
8039
8039
|
}
|
|
8040
8040
|
setupWebGpuCapMaterial() {
|
|
8041
|
-
let e = s(c("colorIndex", "uint")), t = s(c("ids", "uint")), n = s(c("modelID", "uint")), r = i(new
|
|
8041
|
+
let e = s(c("colorIndex", "uint")), t = s(c("ids", "uint")), n = s(c("modelID", "uint")), r = i(new N(this.context.getPreselectionColor())), a = i(new N(this.context.getSelectionColor())), o = i(-1), u = i(-1), d = i(new N(this.context.getCapsColor())), f = e.greaterThan(.5), p = t.equal(o).and(n.equal(u)).and(l(e.sub(1)).greaterThan(.5));
|
|
8042
8042
|
this.capMaterial.colorNode = p.select(r, f.select(a, d)), this.capMaterial.userData.shader = { uniforms: {
|
|
8043
8043
|
capPreSelectionColor: r,
|
|
8044
8044
|
capSelectionColor: a,
|
|
@@ -8049,7 +8049,7 @@ var tl = class {
|
|
|
8049
8049
|
}
|
|
8050
8050
|
setupCapMaterialShader() {
|
|
8051
8051
|
this.capMaterial.onBeforeCompile = (e) => {
|
|
8052
|
-
e.uniforms.capPreSelectionColor = { value: new
|
|
8052
|
+
e.uniforms.capPreSelectionColor = { value: new N(this.context.getPreselectionColor()) }, e.uniforms.capSelectionColor = { value: new N(this.context.getSelectionColor()) }, e.uniforms.capPreSelectionId = { value: -1 }, e.uniforms.capPreSelectionModelID = { value: -1 }, e.vertexShader = e.vertexShader.replace("#include <common>", "\n #include <common>\n attribute float colorIndex;\n attribute uint ids;\n attribute uint modelID;\n flat varying float vCapColorIndex;\n flat varying float vCapId;\n flat varying float vCapModelID;\n "), e.vertexShader = e.vertexShader.replace("#include <begin_vertex>", "\n #include <begin_vertex>\n vCapColorIndex = colorIndex;\n vCapId = float(ids);\n vCapModelID = float(modelID);\n "), e.fragmentShader = e.fragmentShader.replace("#include <common>", "\n #include <common>\n uniform vec3 capPreSelectionColor;\n uniform vec3 capSelectionColor;\n uniform float capPreSelectionId;\n uniform float capPreSelectionModelID;\n flat varying float vCapColorIndex;\n flat varying float vCapId;\n flat varying float vCapModelID;\n "), e.fragmentShader = e.fragmentShader.replace("#include <map_fragment>", "\n #include <map_fragment>\n if(\n capPreSelectionId == vCapId &&\n capPreSelectionModelID == vCapModelID &&\n abs(vCapColorIndex - 1.0) > 0.5\n ){\n diffuseColor.rgb = capPreSelectionColor;\n }\n else if(vCapColorIndex > 0.5){\n diffuseColor.rgb = capSelectionColor;\n }\n "), this.capShader = e, this.capShaders.add(this.capShader), this.capMaterial.userData.shaders = this.capShaders, this.updateColorUniforms(), this.updatePreselectionUniforms();
|
|
8053
8053
|
};
|
|
8054
8054
|
}
|
|
8055
8055
|
updateBaseMaterialColor() {
|
|
@@ -8058,7 +8058,7 @@ var tl = class {
|
|
|
8058
8058
|
updateColorUniform(e, t) {
|
|
8059
8059
|
this.capShaders.forEach((n) => {
|
|
8060
8060
|
let r = n.uniforms[e];
|
|
8061
|
-
r && (r.value instanceof
|
|
8061
|
+
r && (r.value instanceof N ? r.value.set(t) : r.value = new N(t));
|
|
8062
8062
|
});
|
|
8063
8063
|
}
|
|
8064
8064
|
updateColorUniforms() {
|
|
@@ -8083,7 +8083,7 @@ var tl = class {
|
|
|
8083
8083
|
this.capMaterial.clippingPlanes = t, this.capMaterial.needsUpdate = !0;
|
|
8084
8084
|
}
|
|
8085
8085
|
createCapGeometry() {
|
|
8086
|
-
let e = new
|
|
8086
|
+
let e = new ne(), t = this.getModelWorldBox();
|
|
8087
8087
|
if (!t) return e;
|
|
8088
8088
|
let n = t.getSize(new W()).length();
|
|
8089
8089
|
this.tolerance = Math.max(Rc, n * zc), this.closeGapTolerance = Math.max(this.tolerance * Vc, n * Bc);
|
|
@@ -8275,14 +8275,14 @@ var tl = class {
|
|
|
8275
8275
|
}
|
|
8276
8276
|
}, nl = 1024, rl = 1, il = "__bimatterCameraMotionHidden";
|
|
8277
8277
|
function al(e) {
|
|
8278
|
-
let t = new
|
|
8278
|
+
let t = new M(new Float32Array(e * 3), 3, !1);
|
|
8279
8279
|
return t.setUsage(ue), t;
|
|
8280
8280
|
}
|
|
8281
8281
|
function ol(e) {
|
|
8282
8282
|
return Math.max(1, Math.ceil((e.geometry.index?.count ?? 0) / 3));
|
|
8283
8283
|
}
|
|
8284
8284
|
function sl(e, t) {
|
|
8285
|
-
let n = new
|
|
8285
|
+
let n = new ne(), r = Math.ceil(Math.min(Math.max(nl, ol(t) * .05), 32768));
|
|
8286
8286
|
n.setAttribute("position", al(r)), n.setDrawRange(0, 0);
|
|
8287
8287
|
let i = new ve(n, e);
|
|
8288
8288
|
return i.frustumCulled = !1, i.renderOrder = rl, i.visible = !1, i;
|
|
@@ -8450,7 +8450,7 @@ function Sl(e, t, n, r) {
|
|
|
8450
8450
|
}
|
|
8451
8451
|
function Cl({ camera: e, controls: t, invalidate: n, model: r, plane: i, size: a, viewNormal: o }) {
|
|
8452
8452
|
if (!r) return null;
|
|
8453
|
-
let s = new
|
|
8453
|
+
let s = new j().setFromObject(r);
|
|
8454
8454
|
if (s.isEmpty()) return null;
|
|
8455
8455
|
let c = i.clone().normalize(), l = (o && o.lengthSq() > 0 ? o.clone().normalize() : c.normal.clone()).negate();
|
|
8456
8456
|
l.lengthSq() === 0 && l.set(0, 0, -1), l.normalize();
|
|
@@ -8478,7 +8478,7 @@ function El(e) {
|
|
|
8478
8478
|
return e instanceof W ? e.clone() : Array.isArray(e) ? new W(e[0], e[1], e[2]) : new W(e.x, e.y, e.z);
|
|
8479
8479
|
}
|
|
8480
8480
|
function Dl(e, t, n) {
|
|
8481
|
-
let r = new
|
|
8481
|
+
let r = new j();
|
|
8482
8482
|
e && r.setFromObject(e);
|
|
8483
8483
|
let i = (e) => {
|
|
8484
8484
|
let r = Math.abs(n.x), i = Math.abs(n.y), a = Math.abs(n.z);
|
|
@@ -8665,36 +8665,36 @@ function ql({ clippingPlanes: e, modelRoot: t, plane: n, scene: r, useWebGPU: i,
|
|
|
8665
8665
|
};
|
|
8666
8666
|
}
|
|
8667
8667
|
function Jl({ getExtraObjects: e, onPreselectionChange: t, plane: n, registerInvalidate: r, registerNotesApi: i, sourceModel: a, useLocalClippingVisuals: o = !1, useWebGPU: s, viewNormal: c }) {
|
|
8668
|
-
let l =
|
|
8668
|
+
let l = O((e) => e.camera), u = O((e) => e.gl), d = O((e) => e.invalidate), f = O((e) => e.raycaster), p = O((e) => e.scene), m = O((e) => e.size), g = x(null), v = Tt(), y = K((e) => e.selected), C = K((e) => e.dimensionsActive), w = K((e) => e.preselectionColor), T = K((e) => e.selectionColor), E = b(() => jl(a, {
|
|
8669
8669
|
ignoreCameraMotionVisibility: !0,
|
|
8670
8670
|
skipLineSegments: !0
|
|
8671
|
-
}), [a]),
|
|
8671
|
+
}), [a]), k = x(E.root), ee = Bs(k), [A, j] = S([]), te = x([]), M = x(null), [ne, re] = S(() => e()), ie = x(""), N = b(() => ne.map((e) => jl(e, {
|
|
8672
8672
|
ignoreCameraMotionVisibility: !0,
|
|
8673
8673
|
rootInWorldSpace: !0
|
|
8674
|
-
}).root), [
|
|
8675
|
-
|
|
8676
|
-
...
|
|
8677
|
-
...
|
|
8674
|
+
}).root), [ne]), ae = x(N), oe = b(() => [
|
|
8675
|
+
E.root,
|
|
8676
|
+
...N,
|
|
8677
|
+
...A
|
|
8678
8678
|
], [
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8679
|
+
A,
|
|
8680
|
+
N,
|
|
8681
|
+
E.root
|
|
8682
8682
|
]), se = b(() => [
|
|
8683
|
-
|
|
8684
|
-
...
|
|
8685
|
-
...
|
|
8683
|
+
E.root,
|
|
8684
|
+
...N,
|
|
8685
|
+
...A
|
|
8686
8686
|
], [
|
|
8687
|
-
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
]), ce = h(() => Bl([...
|
|
8691
|
-
let r = n.projectPoint(e, ue.current), i =
|
|
8687
|
+
A,
|
|
8688
|
+
N,
|
|
8689
|
+
E.root
|
|
8690
|
+
]), ce = h(() => Bl([...N, ...A]), [A, N]), le = h(() => Bl([...N, ...A]), [A, N]), ue = x(new W()), P = h((e, t) => {
|
|
8691
|
+
let r = n.projectPoint(e, ue.current), i = te.current.flatMap((e) => (e.getObject().updateMatrixWorld(!0), e.getSnapPoints(r, t))), a = Hl([...N, ...A], r, t);
|
|
8692
8692
|
return [...i, ...a];
|
|
8693
8693
|
}, [
|
|
8694
|
-
|
|
8694
|
+
A,
|
|
8695
8695
|
n,
|
|
8696
|
-
|
|
8697
|
-
]), de = h((e, t) => n.projectPoint(e, t), [n]), F = rc(
|
|
8696
|
+
N
|
|
8697
|
+
]), de = h((e, t) => n.projectPoint(e, t), [n]), F = rc(k, g, ee, ce, P, {
|
|
8698
8698
|
disableSelectionInteraction: !1,
|
|
8699
8699
|
getPrioritySnapObjects: le,
|
|
8700
8700
|
onChange: d,
|
|
@@ -8702,16 +8702,16 @@ function Jl({ getExtraObjects: e, onPreselectionChange: t, plane: n, registerInv
|
|
|
8702
8702
|
previewMarkerOffset: b(() => n.normal.clone().multiplyScalar(.12), [n]),
|
|
8703
8703
|
previewMarkerScaleFactor: 2.2,
|
|
8704
8704
|
projectPoint: de
|
|
8705
|
-
}), I = Lc(
|
|
8705
|
+
}), I = Lc(k, {
|
|
8706
8706
|
is2DView: !0,
|
|
8707
8707
|
onChange: d
|
|
8708
8708
|
}), fe = x(!1), L = x(!1);
|
|
8709
|
-
_(() => (
|
|
8710
|
-
|
|
8711
|
-
}), [
|
|
8709
|
+
_(() => (k.current = E.root, () => {
|
|
8710
|
+
k.current === E.root && (k.current = null);
|
|
8711
|
+
}), [E.root]), _(() => (ee.setClippingSource({
|
|
8712
8712
|
getActive: () => !0,
|
|
8713
8713
|
getPlanes: () => [n]
|
|
8714
|
-
}), () =>
|
|
8714
|
+
}), () => ee.setClippingSource(null)), [ee, n]), _(() => {
|
|
8715
8715
|
F.setActive(C), d();
|
|
8716
8716
|
}, [
|
|
8717
8717
|
C,
|
|
@@ -8744,49 +8744,49 @@ function Jl({ getExtraObjects: e, onPreselectionChange: t, plane: n, registerInv
|
|
|
8744
8744
|
d,
|
|
8745
8745
|
I
|
|
8746
8746
|
]), _(() => {
|
|
8747
|
-
|
|
8748
|
-
}, [
|
|
8747
|
+
ae.current = N;
|
|
8748
|
+
}, [N]), _(() => {
|
|
8749
8749
|
if (!o) return;
|
|
8750
8750
|
let e = ql({
|
|
8751
|
-
clippingPlanes: Wl([
|
|
8752
|
-
modelRoot:
|
|
8751
|
+
clippingPlanes: Wl([E.root, ...ae.current], n),
|
|
8752
|
+
modelRoot: E.root,
|
|
8753
8753
|
plane: n,
|
|
8754
8754
|
scene: p,
|
|
8755
8755
|
useWebGPU: s,
|
|
8756
8756
|
viewerStore: v
|
|
8757
8757
|
});
|
|
8758
|
-
|
|
8758
|
+
M.current = e;
|
|
8759
8759
|
let t = new ul(e, n);
|
|
8760
8760
|
t.create(), t.update();
|
|
8761
8761
|
let r = new tl(e, n);
|
|
8762
|
-
return r.setPreselection(null),
|
|
8763
|
-
|
|
8762
|
+
return r.setPreselection(null), te.current = [r], j(e.caps.map((e) => e.getObject()).filter((e) => e.visible)), d(), () => {
|
|
8763
|
+
te.current = [], M.current === e && (M.current = null), j([]), r.dispose(), t.dispose(), d();
|
|
8764
8764
|
};
|
|
8765
8765
|
}, [
|
|
8766
8766
|
d,
|
|
8767
8767
|
n,
|
|
8768
8768
|
p,
|
|
8769
|
-
|
|
8769
|
+
E.root,
|
|
8770
8770
|
o,
|
|
8771
8771
|
s,
|
|
8772
8772
|
v
|
|
8773
8773
|
]), _(() => {
|
|
8774
8774
|
if (!o) return;
|
|
8775
|
-
let e =
|
|
8776
|
-
e && Kl(e, n, Wl([
|
|
8775
|
+
let e = M.current;
|
|
8776
|
+
e && Kl(e, n, Wl([E.root, ...N], n)) && d();
|
|
8777
8777
|
}, [
|
|
8778
8778
|
d,
|
|
8779
8779
|
n,
|
|
8780
|
-
|
|
8781
|
-
|
|
8780
|
+
N,
|
|
8781
|
+
E.root,
|
|
8782
8782
|
o
|
|
8783
8783
|
]), _(() => {
|
|
8784
|
-
|
|
8784
|
+
te.current.forEach((e) => e.updateVisualState()), d();
|
|
8785
8785
|
}, [
|
|
8786
8786
|
d,
|
|
8787
8787
|
w,
|
|
8788
8788
|
y,
|
|
8789
|
-
|
|
8789
|
+
T
|
|
8790
8790
|
]);
|
|
8791
8791
|
let pe = h((e) => {
|
|
8792
8792
|
let t = Pl(e);
|
|
@@ -8849,12 +8849,12 @@ function Jl({ getExtraObjects: e, onPreselectionChange: t, plane: n, registerInv
|
|
|
8849
8849
|
f,
|
|
8850
8850
|
se
|
|
8851
8851
|
]);
|
|
8852
|
-
return
|
|
8852
|
+
return D(() => {
|
|
8853
8853
|
let t = e(), n = Fl(t);
|
|
8854
|
-
|
|
8854
|
+
ie.current !== n && (ie.current = n, re(t));
|
|
8855
8855
|
}), _(() => {
|
|
8856
8856
|
d();
|
|
8857
|
-
}, [
|
|
8857
|
+
}, [ne, d]), _(() => {
|
|
8858
8858
|
let e = u, t = e.localClippingEnabled, r = e.clippingPlanes;
|
|
8859
8859
|
return e.localClippingEnabled = !0, e.clippingPlanes = [n], () => {
|
|
8860
8860
|
e.localClippingEnabled = t, e.clippingPlanes = r;
|
|
@@ -8864,7 +8864,7 @@ function Jl({ getExtraObjects: e, onPreselectionChange: t, plane: n, registerInv
|
|
|
8864
8864
|
camera: l,
|
|
8865
8865
|
controls: g.current,
|
|
8866
8866
|
invalidate: d,
|
|
8867
|
-
model:
|
|
8867
|
+
model: E.root,
|
|
8868
8868
|
plane: n,
|
|
8869
8869
|
size: m,
|
|
8870
8870
|
viewNormal: c
|
|
@@ -8873,20 +8873,20 @@ function Jl({ getExtraObjects: e, onPreselectionChange: t, plane: n, registerInv
|
|
|
8873
8873
|
l,
|
|
8874
8874
|
d,
|
|
8875
8875
|
n,
|
|
8876
|
-
|
|
8876
|
+
E.root,
|
|
8877
8877
|
m,
|
|
8878
8878
|
c
|
|
8879
8879
|
]), /* @__PURE__ */ nt(tt, { children: [
|
|
8880
8880
|
/* @__PURE__ */ G("ambientLight", { intensity: 1.2 }),
|
|
8881
8881
|
/* @__PURE__ */ G("primitive", {
|
|
8882
|
-
object:
|
|
8882
|
+
object: E.root,
|
|
8883
8883
|
onClick: ge,
|
|
8884
8884
|
onPointerDown: pe,
|
|
8885
8885
|
onPointerLeave: _e,
|
|
8886
8886
|
onPointerMove: ve,
|
|
8887
8887
|
onPointerUp: he
|
|
8888
8888
|
}),
|
|
8889
|
-
|
|
8889
|
+
N.map((e) => /* @__PURE__ */ G("primitive", {
|
|
8890
8890
|
object: e,
|
|
8891
8891
|
onClick: ge,
|
|
8892
8892
|
onPointerDown: pe,
|
|
@@ -8894,7 +8894,7 @@ function Jl({ getExtraObjects: e, onPreselectionChange: t, plane: n, registerInv
|
|
|
8894
8894
|
onPointerMove: ve,
|
|
8895
8895
|
onPointerUp: he
|
|
8896
8896
|
}, e.uuid)),
|
|
8897
|
-
|
|
8897
|
+
A.map((e) => /* @__PURE__ */ G("primitive", {
|
|
8898
8898
|
object: e,
|
|
8899
8899
|
onClick: ge,
|
|
8900
8900
|
onPointerDown: pe,
|
|
@@ -8976,7 +8976,7 @@ function ru(e, t, n, r) {
|
|
|
8976
8976
|
o.font = s;
|
|
8977
8977
|
let u = o.measureText(t), d = u.actualBoundingBoxAscent || r * .8, f = u.actualBoundingBoxDescent || r * .2, p = Math.max(1, Math.ceil(u.width + c * 2)), m = Math.max(1, Math.ceil(d + f + l * 2));
|
|
8978
8978
|
a.width = Math.ceil(p * i), a.height = Math.ceil(m * i), o.scale(i, i), o.clearRect(0, 0, p, m), o.font = s, o.fillStyle = n, o.textAlign = "left", o.textBaseline = "alphabetic", o.fillText(t, c, l + d);
|
|
8979
|
-
let h = new
|
|
8979
|
+
let h = new re(a);
|
|
8980
8980
|
return h.colorSpace = ze, h.generateMipmaps = !1, h.magFilter = R, h.minFilter = R, h.needsUpdate = !0, {
|
|
8981
8981
|
disposeTimer: null,
|
|
8982
8982
|
height: m,
|
|
@@ -9037,8 +9037,8 @@ function du(e) {
|
|
|
9037
9037
|
return t < .55 && n >= .5 || t >= .55 && n >= .75 ? "#000000" : "#ffffff";
|
|
9038
9038
|
}
|
|
9039
9039
|
function fu(e) {
|
|
9040
|
-
let t =
|
|
9041
|
-
return b(() => e || (t instanceof
|
|
9040
|
+
let t = O((e) => e.scene.background);
|
|
9041
|
+
return b(() => e || (t instanceof N ? du(t) : Zl), [t, e]);
|
|
9042
9042
|
}
|
|
9043
9043
|
function pu({ axis: e, grid: t, endSide: n, startSide: r }) {
|
|
9044
9044
|
return Object.entries(e).flatMap(([e, i]) => {
|
|
@@ -9122,7 +9122,7 @@ function yu(e, t, n) {
|
|
|
9122
9122
|
}), r;
|
|
9123
9123
|
}
|
|
9124
9124
|
function bu({ color: e, fontSize: t, position: n, text: r }) {
|
|
9125
|
-
let { camera: i, size: a } =
|
|
9125
|
+
let { camera: i, size: a } = O(), o = x(null), s = x({
|
|
9126
9126
|
projectionScale: 0,
|
|
9127
9127
|
viewportHeight: 0
|
|
9128
9128
|
}), c = au(r, e, t), l = h((e, t) => {
|
|
@@ -9137,7 +9137,7 @@ function bu({ color: e, fontSize: t, position: n, text: r }) {
|
|
|
9137
9137
|
i,
|
|
9138
9138
|
a.height,
|
|
9139
9139
|
l
|
|
9140
|
-
]),
|
|
9140
|
+
]), D(({ camera: e, size: t }) => {
|
|
9141
9141
|
l(e, t.height);
|
|
9142
9142
|
}), /* @__PURE__ */ G("sprite", {
|
|
9143
9143
|
ref: o,
|
|
@@ -9155,7 +9155,7 @@ function bu({ color: e, fontSize: t, position: n, text: r }) {
|
|
|
9155
9155
|
});
|
|
9156
9156
|
}
|
|
9157
9157
|
function xu({ cameraPosition: e, color: t, floorY: n, fontSize: r, labelOffset: i, line: a, showBottom: o, showLeft: s, showRight: c, showTop: l }) {
|
|
9158
|
-
let u = b(() => new
|
|
9158
|
+
let u = b(() => new ne().setFromPoints(a.points), [a.points]), d = gu({
|
|
9159
9159
|
cameraPosition: e,
|
|
9160
9160
|
floorY: n,
|
|
9161
9161
|
line: a,
|
|
@@ -9184,7 +9184,7 @@ function xu({ cameraPosition: e, color: t, floorY: n, fontSize: r, labelOffset:
|
|
|
9184
9184
|
});
|
|
9185
9185
|
}
|
|
9186
9186
|
function Su({ color: e, floorY: t, fontSize: n = Xl, grids: r, labelOffset: i = Ql, showBottom: a = !0, showLeft: o = !0, showRight: s = !0, showTop: c = !0, visible: l = !0 }) {
|
|
9187
|
-
let u =
|
|
9187
|
+
let u = O((e) => e.camera), d = x(null), f = x(new W()), [p, m] = S(() => new W()), h = fu(e), g = b(() => r ? mu({
|
|
9188
9188
|
flattenToFloor: t !== void 0,
|
|
9189
9189
|
grids: r,
|
|
9190
9190
|
showBottom: a,
|
|
@@ -9204,7 +9204,7 @@ function Su({ color: e, floorY: t, fontSize: n = Xl, grids: r, labelOffset: i =
|
|
|
9204
9204
|
i,
|
|
9205
9205
|
g
|
|
9206
9206
|
]);
|
|
9207
|
-
return
|
|
9207
|
+
return D(() => {
|
|
9208
9208
|
let e = d.current;
|
|
9209
9209
|
if (!e) return;
|
|
9210
9210
|
let t = f.current.copy(u.position);
|
|
@@ -9242,7 +9242,7 @@ function Su({ color: e, floorY: t, fontSize: n = Xl, grids: r, labelOffset: i =
|
|
|
9242
9242
|
var Cu = 2;
|
|
9243
9243
|
function wu() {
|
|
9244
9244
|
let e = new oe(new Uint8Array(256 * 4), 256, 1, Ne, Xe);
|
|
9245
|
-
return e.magFilter = V, e.minFilter = V, e.generateMipmaps = !1, e.needsUpdate = !0, Eu(e, 1, new
|
|
9245
|
+
return e.magFilter = V, e.minFilter = V, e.generateMipmaps = !1, e.needsUpdate = !0, Eu(e, 1, new N(mt)), e;
|
|
9246
9246
|
}
|
|
9247
9247
|
function Tu(e) {
|
|
9248
9248
|
return `${e.r.toFixed(6)}:${e.g.toFixed(6)}:${e.b.toFixed(6)}`;
|
|
@@ -9257,7 +9257,7 @@ function Du(e) {
|
|
|
9257
9257
|
function Ou(e) {
|
|
9258
9258
|
let t = e.mesh.geometry.attributes.ids;
|
|
9259
9259
|
if (!t) return null;
|
|
9260
|
-
let n = new
|
|
9260
|
+
let n = new M(e.mesh.userData.useUint32ColorIndex === !0 ? new Uint32Array(t.count) : new Uint8Array(t.count), 1);
|
|
9261
9261
|
return e.mesh.geometry.setAttribute("colorIndex", n), n;
|
|
9262
9262
|
}
|
|
9263
9263
|
function ku(e, t) {
|
|
@@ -9320,7 +9320,7 @@ function Ru(e) {
|
|
|
9320
9320
|
_(() => {
|
|
9321
9321
|
s.current = t;
|
|
9322
9322
|
}, [t]), _(() => () => r.dispose(), [r]), _(() => {
|
|
9323
|
-
Eu(r, 1, new
|
|
9323
|
+
Eu(r, 1, new N(n));
|
|
9324
9324
|
}, [r, n]);
|
|
9325
9325
|
let d = h((e, t) => s.current[e]?.has(t) ? 1 : o.current.get(e)?.get(t) ?? 0, []), f = h((t, n) => {
|
|
9326
9326
|
let r = e.buildIndex();
|
|
@@ -9328,7 +9328,7 @@ function Ru(e) {
|
|
|
9328
9328
|
Pu(r.elementIndex.get(e), t, e, d(t, e), l.current, u.current);
|
|
9329
9329
|
});
|
|
9330
9330
|
}, [e, d]), p = h((e) => {
|
|
9331
|
-
let t = new
|
|
9331
|
+
let t = new N(e), n = Tu(t), o = i.current.get(n);
|
|
9332
9332
|
if (o !== void 0) return o;
|
|
9333
9333
|
let s = a.current;
|
|
9334
9334
|
if (s >= 256) throw Error("Element color palette is full. Maximum colors: 255.");
|
|
@@ -9449,7 +9449,7 @@ function Ku(e) {
|
|
|
9449
9449
|
return t.shaders ? Array.from(t.shaders) : t.shader ? [t.shader] : [];
|
|
9450
9450
|
}
|
|
9451
9451
|
function qu({ colorPaletteTexture: e, material: t, materialMode: n = "quality", preselectionColor: r, useDoubleSideMaterial: i = !1 }) {
|
|
9452
|
-
let a = new
|
|
9452
|
+
let a = new N(t.r, t.g, t.b);
|
|
9453
9453
|
n === "performance" && a.multiplyScalar(Wu);
|
|
9454
9454
|
let o = {
|
|
9455
9455
|
color: a.clone(),
|
|
@@ -9463,7 +9463,7 @@ function qu({ colorPaletteTexture: e, material: t, materialMode: n = "quality",
|
|
|
9463
9463
|
...l.defaultAttributeValues,
|
|
9464
9464
|
colorIndex: [0]
|
|
9465
9465
|
}, c.onBeforeCompile = (t) => {
|
|
9466
|
-
let n = new
|
|
9466
|
+
let n = new N(r);
|
|
9467
9467
|
t.uniforms.baseColor = { value: a.clone() }, t.uniforms.preSelectionColor = { value: n }, t.uniforms.preSelectionId = { value: -1 }, t.uniforms.elementColorPalette = { value: e }, t.vertexShader = t.vertexShader.replace("#include <common>", "\n #include <common>\n attribute float colorIndex;\n attribute uint ids;\n flat varying float vColorIndex;\n flat varying float vPreselectId;\n "), t.vertexShader = t.vertexShader.replace("#include <begin_vertex>", "\n #include <begin_vertex>\n vColorIndex = colorIndex;\n vPreselectId = float(ids);\n "), t.fragmentShader = t.fragmentShader.replace("#include <common>", "\n #include <common>\n uniform vec3 baseColor;\n uniform vec3 preSelectionColor;\n uniform sampler2D elementColorPalette;\n flat varying float vPreselectId;\n flat varying float vColorIndex;\n uniform float preSelectionId;\n "), t.fragmentShader = t.fragmentShader.replace("vec4 diffuseColor = vec4( diffuse, opacity );", `
|
|
9468
9468
|
vec4 diffuseColor;
|
|
9469
9469
|
if(preSelectionId == vPreselectId && abs(vColorIndex - 1.0) > 0.5){
|
|
@@ -9485,7 +9485,7 @@ function qu({ colorPaletteTexture: e, material: t, materialMode: n = "quality",
|
|
|
9485
9485
|
function Ju(e, t) {
|
|
9486
9486
|
Ku(e).forEach((e) => {
|
|
9487
9487
|
let n = e.uniforms.preSelectionColor;
|
|
9488
|
-
n && (n.value instanceof
|
|
9488
|
+
n && (n.value instanceof N ? n.value.set(t) : n.value = new N(t));
|
|
9489
9489
|
});
|
|
9490
9490
|
}
|
|
9491
9491
|
var Yu = u.memo(function({ colorPaletteTexture: e, material: t, materialMode: n = "quality", data: r, isIfcSpace: i = !1, meshMatrix: a, onReady: o, readyKey: s, useDoubleSideMaterial: c = !1 }) {
|
|
@@ -9553,7 +9553,7 @@ var Yu = u.memo(function({ colorPaletteTexture: e, material: t, materialMode: n
|
|
|
9553
9553
|
});
|
|
9554
9554
|
}), Xu = 1 / 1.5;
|
|
9555
9555
|
function Zu({ colorPaletteTexture: e, material: t, materialMode: u, preselectionColor: d, selectionColor: f, useDoubleSideMaterial: p }) {
|
|
9556
|
-
let m = new
|
|
9556
|
+
let m = new N(t.r, t.g, t.b);
|
|
9557
9557
|
u === "performance" && m.multiplyScalar(Xu);
|
|
9558
9558
|
let h = t.opacity ?? 1, g = {
|
|
9559
9559
|
color: m.clone(),
|
|
@@ -9568,8 +9568,8 @@ function Zu({ colorPaletteTexture: e, material: t, materialMode: u, preselection
|
|
|
9568
9568
|
colorIndex: [0],
|
|
9569
9569
|
ids: [0]
|
|
9570
9570
|
};
|
|
9571
|
-
let y = s(c("colorIndex", "uint")), b = s(c("ids", "uint")), x = i(-1), S = i(new
|
|
9572
|
-
return v.colorNode =
|
|
9571
|
+
let y = s(c("colorIndex", "uint")), b = s(c("ids", "uint")), x = i(-1), S = i(new N(d)), C = i(new N(f)), w = i(m.clone()), T = i(h), E = a(e, o(y.add(.5).div(256), .5)).rgb, D = y.greaterThan(.5), O = l(y.sub(1)), k = O.lessThan(.5), ee = O.greaterThan(.5), A = b.equal(x).and(ee);
|
|
9572
|
+
return v.colorNode = A.select(S, k.select(C, D.select(E, w))), v.opacityNode = A.select(s(1), k.select(s(1), D.select(s(1), T))), v.userData.shader = { uniforms: {
|
|
9573
9573
|
elementColorPalette: { value: e },
|
|
9574
9574
|
preSelectionColor: S,
|
|
9575
9575
|
preSelectionId: x,
|
|
@@ -9580,7 +9580,7 @@ function Qu(e, { preselectionColor: t, selectionColor: n }) {
|
|
|
9580
9580
|
let r = e.userData, i = r.shaders ? Array.from(r.shaders) : r.shader ? [r.shader] : [], a = (e, t) => {
|
|
9581
9581
|
i.forEach((n) => {
|
|
9582
9582
|
let r = n.uniforms?.[e];
|
|
9583
|
-
r && (r.value instanceof
|
|
9583
|
+
r && (r.value instanceof N ? r.value.set(t) : r.value = new N(t));
|
|
9584
9584
|
});
|
|
9585
9585
|
};
|
|
9586
9586
|
a("preSelectionColor", t), a("selectionColor", n);
|
|
@@ -9589,8 +9589,8 @@ var $u = u.memo(function({ colorPaletteTexture: e, material: t, materialMode: n
|
|
|
9589
9589
|
let l = x(null), u = x(o), d = b(() => new Uint32Array(r.ids.length), [r.ids]);
|
|
9590
9590
|
u.current = o;
|
|
9591
9591
|
let f = b(() => {
|
|
9592
|
-
let e = new
|
|
9593
|
-
return e.setAttribute("position", new
|
|
9592
|
+
let e = new ne();
|
|
9593
|
+
return e.setAttribute("position", new M(r.pos, 3)), r.norm && e.setAttribute("normal", new M(r.norm, 3)), e.setAttribute("ids", new M(r.ids, 1)), e.setAttribute("colorIndex", new M(d, 1)), e.setIndex(new M(r.ind, 1)), n !== "performance" && !e.attributes.normal && e.computeVertexNormals(), r.boundsTree && Hu(e), e;
|
|
9594
9594
|
}, [
|
|
9595
9595
|
d,
|
|
9596
9596
|
r,
|
|
@@ -9654,8 +9654,15 @@ var $u = u.memo(function({ colorPaletteTexture: e, material: t, materialMode: n
|
|
|
9654
9654
|
object: f
|
|
9655
9655
|
}), /* @__PURE__ */ G("primitive", { object: v })]
|
|
9656
9656
|
});
|
|
9657
|
-
}), ed =
|
|
9658
|
-
function
|
|
9657
|
+
}), ed = -1;
|
|
9658
|
+
function td(e, t, n) {
|
|
9659
|
+
let r = e.clone();
|
|
9660
|
+
return !n && Number.isFinite(t) && t !== 0 && r.multiply(new z().makeRotationY(t * ed)), r;
|
|
9661
|
+
}
|
|
9662
|
+
//#endregion
|
|
9663
|
+
//#region src/viewer/Model.tsx
|
|
9664
|
+
var nd = new z(), rd = /* @__PURE__ */ new WeakMap(), id = /* @__PURE__ */ new WeakMap();
|
|
9665
|
+
function ad(e) {
|
|
9659
9666
|
if (!e) return null;
|
|
9660
9667
|
try {
|
|
9661
9668
|
let t = JSON.parse(e);
|
|
@@ -9664,34 +9671,34 @@ function rd(e) {
|
|
|
9664
9671
|
return console.warn("Model matrix parsing error", e), null;
|
|
9665
9672
|
}
|
|
9666
9673
|
}
|
|
9667
|
-
function
|
|
9668
|
-
return
|
|
9674
|
+
function od(e) {
|
|
9675
|
+
return ad(sd(e));
|
|
9669
9676
|
}
|
|
9670
|
-
function
|
|
9677
|
+
function sd(e) {
|
|
9671
9678
|
if (e.coordinationMatrix) return e.coordinationMatrix;
|
|
9672
9679
|
for (let t in e.data) {
|
|
9673
9680
|
let n = e.data[Number(t)]?.matrix;
|
|
9674
9681
|
if (n) return n;
|
|
9675
9682
|
}
|
|
9676
9683
|
}
|
|
9677
|
-
function
|
|
9678
|
-
let n = e.matrix ?? t ?? "", r =
|
|
9684
|
+
function cd(e, t) {
|
|
9685
|
+
let n = e.matrix ?? t ?? "", r = rd.get(e);
|
|
9679
9686
|
if (r && r.sourceMatrixKey === n) return r;
|
|
9680
|
-
let i = (
|
|
9687
|
+
let i = (ad(n) ?? new z()).clone().invert(), a = e.pos, o = new W(), s = Infinity;
|
|
9681
9688
|
for (let e = 0; e < a.length; e += 3) o.set(a[e], a[e + 1], a[e + 2]).applyMatrix4(i), Number.isFinite(o.y) && (s = Math.min(s, o.y));
|
|
9682
9689
|
let c = {
|
|
9683
9690
|
floorY: s,
|
|
9684
9691
|
meshMatrix: i,
|
|
9685
9692
|
sourceMatrixKey: n
|
|
9686
9693
|
};
|
|
9687
|
-
return
|
|
9694
|
+
return rd.set(e, c), c;
|
|
9688
9695
|
}
|
|
9689
|
-
function
|
|
9696
|
+
function ld(e, t) {
|
|
9690
9697
|
let n = e[t];
|
|
9691
9698
|
return n === void 0 ? 0 : Number.isFinite(n) ? n : null;
|
|
9692
9699
|
}
|
|
9693
|
-
function
|
|
9694
|
-
let r =
|
|
9700
|
+
function ud(e, t, n) {
|
|
9701
|
+
let r = ld(e, "x"), i = ld(e, "y"), a = ld(e, "z"), o = ld(t, "x"), s = ld(t, "y"), c = ld(t, "z");
|
|
9695
9702
|
if (r === null || i === null || a === null || o === null || s === null || c === null) return null;
|
|
9696
9703
|
let l = new W(r + o, i + s, a + c).applyMatrix4(n);
|
|
9697
9704
|
return {
|
|
@@ -9700,14 +9707,14 @@ function cd(e, t, n) {
|
|
|
9700
9707
|
z: l.z
|
|
9701
9708
|
};
|
|
9702
9709
|
}
|
|
9703
|
-
function
|
|
9710
|
+
function dd(e, t, n) {
|
|
9704
9711
|
let r = {};
|
|
9705
9712
|
return Object.entries(e).forEach(([e, i]) => {
|
|
9706
|
-
let a = i.map((e) =>
|
|
9713
|
+
let a = i.map((e) => ud(e, t, n)).filter((e) => e !== null);
|
|
9707
9714
|
a.length >= 2 && (r[e] = a);
|
|
9708
9715
|
}), r;
|
|
9709
9716
|
}
|
|
9710
|
-
function
|
|
9717
|
+
function fd(e, t) {
|
|
9711
9718
|
return {
|
|
9712
9719
|
loc: {
|
|
9713
9720
|
x: 0,
|
|
@@ -9715,27 +9722,27 @@ function ud(e, t) {
|
|
|
9715
9722
|
z: 0
|
|
9716
9723
|
},
|
|
9717
9724
|
points: {
|
|
9718
|
-
u:
|
|
9719
|
-
v:
|
|
9725
|
+
u: dd(e.points.u, e.loc, t),
|
|
9726
|
+
v: dd(e.points.v, e.loc, t)
|
|
9720
9727
|
}
|
|
9721
9728
|
};
|
|
9722
9729
|
}
|
|
9723
|
-
function
|
|
9730
|
+
function pd(e, t) {
|
|
9724
9731
|
if (!e || !t) return e;
|
|
9725
|
-
let n =
|
|
9732
|
+
let n = id.get(e);
|
|
9726
9733
|
if (n && n.sourceMatrixKey === t) return n.grids;
|
|
9727
|
-
let r =
|
|
9734
|
+
let r = ad(t);
|
|
9728
9735
|
if (!r) return e;
|
|
9729
9736
|
let i = r.clone().invert(), a = {};
|
|
9730
9737
|
return Object.entries(e).forEach(([e, t]) => {
|
|
9731
|
-
a[e] =
|
|
9732
|
-
}),
|
|
9738
|
+
a[e] = fd(t, i);
|
|
9739
|
+
}), id.set(e, {
|
|
9733
9740
|
grids: a,
|
|
9734
9741
|
sourceMatrixKey: t
|
|
9735
9742
|
}), a;
|
|
9736
9743
|
}
|
|
9737
|
-
function
|
|
9738
|
-
let
|
|
9744
|
+
function md({ colorPaletteTexture: e, coordinationMatrix: t, modelID: n, data: r, loadGeneration: i, materialMode: a, onUploadComplete: o, onUploadProgress: s, trueNorthEnabled: c = !0, useWebGPU: l = !1 }) {
|
|
9745
|
+
let u = K((e) => e.gridAxesVisibility), d = b(() => {
|
|
9739
9746
|
if (!r) return {
|
|
9740
9747
|
data: [],
|
|
9741
9748
|
coordinationMatrix: null,
|
|
@@ -9747,11 +9754,11 @@ function fd({ colorPaletteTexture: e, coordinationMatrix: t, modelID: n, data: r
|
|
|
9747
9754
|
e = !0;
|
|
9748
9755
|
break;
|
|
9749
9756
|
}
|
|
9750
|
-
let i = r.coordinationMatrix ??
|
|
9757
|
+
let i = r.coordinationMatrix ?? sd(r), a = od(r), o = e || a ? t?.clone() ?? a : null, s = Infinity, c = [];
|
|
9751
9758
|
for (let e in r.data) {
|
|
9752
9759
|
let t = r.data[Number(e)];
|
|
9753
9760
|
if (!t) continue;
|
|
9754
|
-
let a =
|
|
9761
|
+
let a = cd(t, i), o = t.mat;
|
|
9755
9762
|
s = Math.min(s, a.floorY), c.push({
|
|
9756
9763
|
data: t,
|
|
9757
9764
|
isIfcSpace: !!t.isIfcSpace,
|
|
@@ -9765,68 +9772,69 @@ function fd({ colorPaletteTexture: e, coordinationMatrix: t, modelID: n, data: r
|
|
|
9765
9772
|
data: c,
|
|
9766
9773
|
coordinationMatrix: o,
|
|
9767
9774
|
floorY: Number.isFinite(s) ? s : 0,
|
|
9768
|
-
grids:
|
|
9775
|
+
grids: pd(r.grids, i)
|
|
9769
9776
|
};
|
|
9770
9777
|
}, [
|
|
9771
9778
|
t,
|
|
9772
9779
|
r,
|
|
9773
9780
|
n
|
|
9774
|
-
]),
|
|
9781
|
+
]), f = x({
|
|
9775
9782
|
loadGeneration: i,
|
|
9776
9783
|
readyMeshKeys: /* @__PURE__ */ new Set()
|
|
9777
|
-
}),
|
|
9778
|
-
|
|
9784
|
+
}), p = x(o), m = x(s), g = x(i), _ = x(d.data.length);
|
|
9785
|
+
p.current = o, m.current = s, g.current = i, _.current = d.data.length, f.current.loadGeneration !== i && (f.current = {
|
|
9779
9786
|
loadGeneration: i,
|
|
9780
9787
|
readyMeshKeys: /* @__PURE__ */ new Set()
|
|
9781
9788
|
});
|
|
9782
|
-
let
|
|
9783
|
-
let t =
|
|
9789
|
+
let v = h((e) => {
|
|
9790
|
+
let t = f.current, n = g.current;
|
|
9784
9791
|
if (t.loadGeneration !== n || !e.startsWith(`${n}:`) || t.readyMeshKeys.has(e)) return;
|
|
9785
9792
|
t.readyMeshKeys.add(e);
|
|
9786
|
-
let r = t.readyMeshKeys.size, i =
|
|
9787
|
-
|
|
9793
|
+
let r = t.readyMeshKeys.size, i = _.current;
|
|
9794
|
+
m.current?.(r, i), r >= i && p.current?.(r);
|
|
9788
9795
|
}, []);
|
|
9789
9796
|
if (!r) return /* @__PURE__ */ G(tt, {});
|
|
9790
|
-
let
|
|
9797
|
+
let y = a ?? r.renderSettings?.materialMode ?? "quality", S = r.renderSettings?.useDoubleSideMaterial === !0, C = l ? $u : Yu, w = d.coordinationMatrix ?? nd, T = typeof r.trueNorthAngle == "number" && Number.isFinite(r.trueNorthAngle) ? r.trueNorthAngle : 0;
|
|
9791
9798
|
return /* @__PURE__ */ nt("group", {
|
|
9792
|
-
matrix:
|
|
9799
|
+
matrix: td(w, T, c),
|
|
9793
9800
|
matrixAutoUpdate: !1,
|
|
9794
9801
|
userData: b(() => ({
|
|
9795
9802
|
geometryTransformVersion: 0,
|
|
9796
9803
|
modelID: n,
|
|
9797
|
-
trueNorthAngle:
|
|
9798
|
-
trueNorthBaseMatrix:
|
|
9799
|
-
trueNorthEnabled:
|
|
9804
|
+
trueNorthAngle: T,
|
|
9805
|
+
trueNorthBaseMatrix: w.clone(),
|
|
9806
|
+
trueNorthEnabled: c
|
|
9800
9807
|
}), [
|
|
9808
|
+
w,
|
|
9801
9809
|
n,
|
|
9802
|
-
|
|
9803
|
-
|
|
9810
|
+
T,
|
|
9811
|
+
c
|
|
9804
9812
|
]),
|
|
9805
|
-
children: [
|
|
9813
|
+
children: [d.data.map((t) => /* @__PURE__ */ G(C, {
|
|
9806
9814
|
colorPaletteTexture: e,
|
|
9807
9815
|
data: t.data,
|
|
9808
9816
|
isIfcSpace: t.isIfcSpace,
|
|
9809
9817
|
material: t.material,
|
|
9810
|
-
materialMode:
|
|
9818
|
+
materialMode: y,
|
|
9811
9819
|
meshMatrix: t.meshMatrix,
|
|
9812
|
-
onReady:
|
|
9820
|
+
onReady: v,
|
|
9813
9821
|
readyKey: `${i}:${t.key}`,
|
|
9814
|
-
useDoubleSideMaterial:
|
|
9822
|
+
useDoubleSideMaterial: S
|
|
9815
9823
|
}, t.key)), /* @__PURE__ */ G(Su, {
|
|
9816
|
-
floorY:
|
|
9817
|
-
grids:
|
|
9818
|
-
showBottom:
|
|
9819
|
-
showLeft:
|
|
9820
|
-
showRight:
|
|
9821
|
-
showTop:
|
|
9822
|
-
visible:
|
|
9824
|
+
floorY: d.floorY,
|
|
9825
|
+
grids: d.grids,
|
|
9826
|
+
showBottom: u.bottom,
|
|
9827
|
+
showLeft: u.left,
|
|
9828
|
+
showRight: u.right,
|
|
9829
|
+
showTop: u.top,
|
|
9830
|
+
visible: u.visible
|
|
9823
9831
|
})]
|
|
9824
9832
|
});
|
|
9825
9833
|
}
|
|
9826
|
-
var
|
|
9834
|
+
var hd = m(md);
|
|
9827
9835
|
//#endregion
|
|
9828
9836
|
//#region src/viewer/utils/GeometryUtils/useGeometryIndex.ts
|
|
9829
|
-
function
|
|
9837
|
+
function gd() {
|
|
9830
9838
|
return {
|
|
9831
9839
|
elementBounds: /* @__PURE__ */ new Map(),
|
|
9832
9840
|
elementIndex: /* @__PURE__ */ new Map(),
|
|
@@ -9838,16 +9846,16 @@ function md() {
|
|
|
9838
9846
|
version: ""
|
|
9839
9847
|
};
|
|
9840
9848
|
}
|
|
9841
|
-
function
|
|
9849
|
+
function _d(e, t, n, r) {
|
|
9842
9850
|
let i = e.get(t);
|
|
9843
9851
|
i || (i = /* @__PURE__ */ new Map(), e.set(t, i));
|
|
9844
9852
|
let a = i.get(n);
|
|
9845
|
-
a || (a = new
|
|
9853
|
+
a || (a = new j(), i.set(n, a)), a.expandByPoint(r);
|
|
9846
9854
|
}
|
|
9847
|
-
function
|
|
9855
|
+
function vd(e) {
|
|
9848
9856
|
return e instanceof Uint16Array || e instanceof Uint32Array ? e : e.length > 65535 ? new Uint32Array(e) : new Uint16Array(e);
|
|
9849
9857
|
}
|
|
9850
|
-
function
|
|
9858
|
+
function yd(e, t, n, r) {
|
|
9851
9859
|
let i = n.get(e);
|
|
9852
9860
|
if (i) return i;
|
|
9853
9861
|
i = {
|
|
@@ -9857,20 +9865,20 @@ function _d(e, t, n, r) {
|
|
|
9857
9865
|
let a = r.get(e);
|
|
9858
9866
|
return a || (a = [], r.set(e, a)), a.push(i), i;
|
|
9859
9867
|
}
|
|
9860
|
-
function
|
|
9861
|
-
n &&
|
|
9868
|
+
function bd(e, t, n, r, i, a) {
|
|
9869
|
+
n && yd(e, r, i, a).vertexRanges.push({
|
|
9862
9870
|
count: n,
|
|
9863
9871
|
start: t
|
|
9864
9872
|
});
|
|
9865
9873
|
}
|
|
9866
|
-
function
|
|
9867
|
-
n && (
|
|
9874
|
+
function xd(e, t, n, r, i, a) {
|
|
9875
|
+
n && (yd(e, r, i, a), r.triangleRanges.push({
|
|
9868
9876
|
count: n,
|
|
9869
9877
|
id: e,
|
|
9870
9878
|
start: t
|
|
9871
9879
|
}));
|
|
9872
9880
|
}
|
|
9873
|
-
function
|
|
9881
|
+
function Sd(e) {
|
|
9874
9882
|
let t = e;
|
|
9875
9883
|
for (; t;) {
|
|
9876
9884
|
let e = t.userData.modelID;
|
|
@@ -9879,16 +9887,16 @@ function bd(e) {
|
|
|
9879
9887
|
}
|
|
9880
9888
|
return 0;
|
|
9881
9889
|
}
|
|
9882
|
-
function
|
|
9890
|
+
function Cd(e) {
|
|
9883
9891
|
return e.name === "space" || e.userData.isIfcSpace === !0;
|
|
9884
9892
|
}
|
|
9885
|
-
function
|
|
9893
|
+
function wd(e) {
|
|
9886
9894
|
let t = e.userData.removedElementIds;
|
|
9887
9895
|
if (t instanceof Set) return t;
|
|
9888
9896
|
let n = /* @__PURE__ */ new Set();
|
|
9889
9897
|
return e.userData.removedElementIds = n, n;
|
|
9890
9898
|
}
|
|
9891
|
-
function
|
|
9899
|
+
function Td(e) {
|
|
9892
9900
|
if (!e) return "";
|
|
9893
9901
|
let t = [];
|
|
9894
9902
|
return e.traverse((e) => {
|
|
@@ -9896,22 +9904,22 @@ function Cd(e) {
|
|
|
9896
9904
|
typeof n == "number" && typeof r == "number" && t.push("model-transform", String(n), String(r));
|
|
9897
9905
|
}), e.traverse((e) => {
|
|
9898
9906
|
if (!(e instanceof B)) return;
|
|
9899
|
-
let n = e.geometry, r =
|
|
9907
|
+
let n = e.geometry, r = wd(e);
|
|
9900
9908
|
t.push(e.uuid, n.uuid, String(n.attributes.ids?.count ?? 0), String(n.attributes.position?.count ?? 0)), r.size && t.push("removed", Array.from(r).sort((e, t) => e - t).join(","));
|
|
9901
9909
|
}), t.join(":");
|
|
9902
9910
|
}
|
|
9903
|
-
function
|
|
9904
|
-
let t = x(
|
|
9911
|
+
function Ed(e) {
|
|
9912
|
+
let t = x(gd()), n = h(() => {
|
|
9905
9913
|
let n = e.current, r = t.current;
|
|
9906
9914
|
if (!n) return r;
|
|
9907
|
-
let i =
|
|
9915
|
+
let i = Td(n);
|
|
9908
9916
|
if (r.indexedModel === n && r.records.size && r.version === i) return r;
|
|
9909
9917
|
let a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), c = new W();
|
|
9910
9918
|
return n.updateMatrixWorld(!0), n.traverse((e) => {
|
|
9911
9919
|
if (!(e instanceof B)) return;
|
|
9912
9920
|
let t = e, n = t.geometry, i = n.index, l = n.attributes.ids;
|
|
9913
9921
|
if (!i || !l) return;
|
|
9914
|
-
let u = n.attributes.position, d =
|
|
9922
|
+
let u = n.attributes.position, d = Sd(t), f = Cd(t), p = wd(t), m = vd(i.array), h = {
|
|
9915
9923
|
hiddenIds: /* @__PURE__ */ new Set(),
|
|
9916
9924
|
initialVisible: t.visible,
|
|
9917
9925
|
isIfcSpace: f,
|
|
@@ -9926,23 +9934,23 @@ function wd(e) {
|
|
|
9926
9934
|
for (let e = 0; e < y; e++) {
|
|
9927
9935
|
let t = l.getX(m[e * 3]);
|
|
9928
9936
|
if (p.has(t)) {
|
|
9929
|
-
_ !== null &&
|
|
9937
|
+
_ !== null && xd(_, v, e - v, h, g, a), _ = null, v = e + 1;
|
|
9930
9938
|
continue;
|
|
9931
9939
|
}
|
|
9932
|
-
_ === null ? (_ = t, v = e) : t !== _ && (
|
|
9940
|
+
_ === null ? (_ = t, v = e) : t !== _ && (xd(_, v, e - v, h, g, a), _ = t, v = e);
|
|
9933
9941
|
}
|
|
9934
|
-
_ !== null &&
|
|
9942
|
+
_ !== null && xd(_, v, y - v, h, g, a);
|
|
9935
9943
|
let b = null, x = 0, S = u ? Math.min(l.count, u.count) : l.count;
|
|
9936
9944
|
u && t.updateWorldMatrix(!0, !1);
|
|
9937
9945
|
for (let e = 0; e < l.count; e++) {
|
|
9938
9946
|
let n = l.getX(e);
|
|
9939
9947
|
if (p.has(n)) {
|
|
9940
|
-
b !== null &&
|
|
9948
|
+
b !== null && bd(b, x, e - x, h, g, a), b = null, x = e + 1;
|
|
9941
9949
|
continue;
|
|
9942
9950
|
}
|
|
9943
|
-
u && e < S && (c.fromBufferAttribute(u, e).applyMatrix4(t.matrixWorld), Number.isFinite(c.x + c.y + c.z) &&
|
|
9951
|
+
u && e < S && (c.fromBufferAttribute(u, e).applyMatrix4(t.matrixWorld), Number.isFinite(c.x + c.y + c.z) && _d(o, d, n, c)), b === null ? (b = n, x = e) : n !== b && (bd(b, x, e - x, h, g, a), b = n, x = e);
|
|
9944
9952
|
}
|
|
9945
|
-
b !== null &&
|
|
9953
|
+
b !== null && bd(b, x, l.count - x, h, g, a), s.add(h), f && !r.ifcSpacesVisible && (t.visible = !1);
|
|
9946
9954
|
}), t.current = {
|
|
9947
9955
|
elementBounds: o,
|
|
9948
9956
|
elementIndex: a,
|
|
@@ -9954,7 +9962,7 @@ function wd(e) {
|
|
|
9954
9962
|
version: i
|
|
9955
9963
|
}, t.current;
|
|
9956
9964
|
}, [e]), r = h(() => {
|
|
9957
|
-
t.current =
|
|
9965
|
+
t.current = gd();
|
|
9958
9966
|
}, []);
|
|
9959
9967
|
return b(() => ({
|
|
9960
9968
|
buildIndex: n,
|
|
@@ -9963,80 +9971,79 @@ function wd(e) {
|
|
|
9963
9971
|
}
|
|
9964
9972
|
//#endregion
|
|
9965
9973
|
//#region src/viewer/utils/GeometryUtils/useGeometryUtils.ts
|
|
9966
|
-
|
|
9967
|
-
function Ed(e, t) {
|
|
9974
|
+
function Dd(e, t) {
|
|
9968
9975
|
return e instanceof Uint32Array ? new Uint32Array(t) : new Uint16Array(t);
|
|
9969
9976
|
}
|
|
9970
|
-
function
|
|
9977
|
+
function Od(e) {
|
|
9971
9978
|
let t = e.geometry;
|
|
9972
9979
|
Object.assign(t, { boundsTree: void 0 }), e.geometry.index?.count && Object.assign(t, { boundsTree: new dt(e.geometry, { indirect: !0 }) });
|
|
9973
9980
|
}
|
|
9974
|
-
function
|
|
9975
|
-
e.mesh.geometry.setIndex(new
|
|
9981
|
+
function kd(e, t, n = !0) {
|
|
9982
|
+
e.mesh.geometry.setIndex(new M(t, 1)), n && Od(e.mesh);
|
|
9976
9983
|
}
|
|
9977
|
-
function
|
|
9984
|
+
function Ad(e, t) {
|
|
9978
9985
|
return e.initialVisible && (!e.isIfcSpace || t);
|
|
9979
9986
|
}
|
|
9980
|
-
function
|
|
9987
|
+
function jd(e, t) {
|
|
9981
9988
|
let n = e.mesh.geometry, r = n.index?.array;
|
|
9982
|
-
e.mesh.visible =
|
|
9989
|
+
e.mesh.visible = Ad(e, t), r !== e.originalIndex && kd(e, e.originalIndex, !1), e.originalBoundsTree ? Object.assign(n, { boundsTree: e.originalBoundsTree }) : (Od(e.mesh), e.originalBoundsTree = e.mesh.geometry.boundsTree ?? null);
|
|
9983
9990
|
}
|
|
9984
|
-
function
|
|
9991
|
+
function Md(e) {
|
|
9985
9992
|
return e === null ? "*" : e.size ? Array.from(e).sort((e, t) => e - t).join(",") : "";
|
|
9986
9993
|
}
|
|
9987
|
-
function
|
|
9988
|
-
return `h:${
|
|
9994
|
+
function Nd(e, t, n, r) {
|
|
9995
|
+
return `h:${Md(e)}|i:${Md(n)}|s:${r ? Number(t) : ""}`;
|
|
9989
9996
|
}
|
|
9990
|
-
function
|
|
9997
|
+
function Pd(e, t, n) {
|
|
9991
9998
|
return !t.has(e) && (!n || n.has(e));
|
|
9992
9999
|
}
|
|
9993
|
-
function
|
|
10000
|
+
function Fd(e, t) {
|
|
9994
10001
|
Object.entries(e).forEach(([e, n]) => {
|
|
9995
10002
|
n.forEach((n) => t(Number(e), n));
|
|
9996
10003
|
});
|
|
9997
10004
|
}
|
|
9998
|
-
function
|
|
10005
|
+
function Id(e, t, n) {
|
|
9999
10006
|
e.hiddenIds.has(t) || (e.hiddenIds.add(t), n.add(e));
|
|
10000
10007
|
}
|
|
10001
|
-
function
|
|
10008
|
+
function Ld(e, t, n) {
|
|
10002
10009
|
e && console.log(`${t}:`, Date.now() - n, "ms");
|
|
10003
10010
|
}
|
|
10004
|
-
function
|
|
10005
|
-
let { hiddenIds: i, originalIndex: a, triangleRanges: o } = e, s =
|
|
10011
|
+
function Rd(e, t, n, r) {
|
|
10012
|
+
let { hiddenIds: i, originalIndex: a, triangleRanges: o } = e, s = Nd(i, t, n, e.isIfcSpace);
|
|
10006
10013
|
if (e.visibleStateKey === s) return;
|
|
10007
10014
|
if (!i.size && !n) {
|
|
10008
|
-
|
|
10015
|
+
jd(e, t), e.visibleStateKey = s;
|
|
10009
10016
|
return;
|
|
10010
10017
|
}
|
|
10011
10018
|
let c = 0, l = 0;
|
|
10012
10019
|
if (o.forEach(({ count: e, id: t }) => {
|
|
10013
|
-
|
|
10020
|
+
Pd(t, i, n) ? c += e * 3 : l += e * 3;
|
|
10014
10021
|
}), !c) {
|
|
10015
|
-
|
|
10022
|
+
jd(e, t), e.mesh.visible = !1, e.visibleStateKey = s;
|
|
10016
10023
|
return;
|
|
10017
10024
|
}
|
|
10018
10025
|
if (!l) {
|
|
10019
|
-
|
|
10026
|
+
jd(e, t), e.visibleStateKey = s;
|
|
10020
10027
|
return;
|
|
10021
10028
|
}
|
|
10022
|
-
e.mesh.visible =
|
|
10023
|
-
let u =
|
|
10029
|
+
e.mesh.visible = Ad(e, t);
|
|
10030
|
+
let u = Dd(a, c), d = 0;
|
|
10024
10031
|
for (let e = 0; e < o.length; e++) {
|
|
10025
10032
|
let { count: t, id: r, start: s } = o[e];
|
|
10026
|
-
if (!
|
|
10033
|
+
if (!Pd(r, i, n)) continue;
|
|
10027
10034
|
let c = s * 3, l = c + t * 3;
|
|
10028
10035
|
u.set(a.subarray(c, l), d), d += t * 3;
|
|
10029
10036
|
}
|
|
10030
|
-
r || (e.originalBoundsTree = null),
|
|
10037
|
+
r || (e.originalBoundsTree = null), kd(e, u), e.visibleStateKey = s;
|
|
10031
10038
|
}
|
|
10032
|
-
function
|
|
10039
|
+
function zd(e, t, n) {
|
|
10033
10040
|
let r = e.elementIndex.get(n);
|
|
10034
10041
|
if (!r) return;
|
|
10035
10042
|
let i = r.filter(({ record: e }) => e.modelID !== t);
|
|
10036
10043
|
i.length ? e.elementIndex.set(n, i) : e.elementIndex.delete(n);
|
|
10037
10044
|
}
|
|
10038
|
-
function
|
|
10039
|
-
let n =
|
|
10045
|
+
function Bd(e, t) {
|
|
10046
|
+
let n = wd(e.mesh), r = !1;
|
|
10040
10047
|
if (t.forEach((t) => {
|
|
10041
10048
|
e.hiddenIds.delete(t), !n.has(t) && (n.add(t), r = !0);
|
|
10042
10049
|
}), !r) return !1;
|
|
@@ -10049,53 +10056,53 @@ function zd(e, t) {
|
|
|
10049
10056
|
start: a
|
|
10050
10057
|
}), a += e, o += e * 3);
|
|
10051
10058
|
});
|
|
10052
|
-
let s =
|
|
10059
|
+
let s = Dd(e.originalIndex, o), c = 0;
|
|
10053
10060
|
return e.triangleRanges.forEach(({ count: t, id: r, start: i }) => {
|
|
10054
10061
|
if (n.has(r)) return;
|
|
10055
10062
|
let a = i * 3, o = a + t * 3;
|
|
10056
10063
|
s.set(e.originalIndex.subarray(a, o), c), c += t * 3;
|
|
10057
10064
|
}), e.originalBoundsTree = null, e.originalIndex = s, e.triangleRanges = i, e.visibleStateKey = "", !0;
|
|
10058
10065
|
}
|
|
10059
|
-
function
|
|
10066
|
+
function Vd(e, t) {
|
|
10060
10067
|
return e.isolatedIdsByModel ? e.isolatedIdsByModel.get(t.modelID) ?? /* @__PURE__ */ new Set() : e.isolatedIds;
|
|
10061
10068
|
}
|
|
10062
|
-
function
|
|
10069
|
+
function Hd(e) {
|
|
10063
10070
|
let t = [];
|
|
10064
10071
|
return e?.children.forEach((e) => {
|
|
10065
10072
|
e instanceof L && typeof e.userData.modelID == "number" && t.push(e);
|
|
10066
10073
|
}), t;
|
|
10067
10074
|
}
|
|
10068
|
-
function
|
|
10075
|
+
function Ud(e) {
|
|
10069
10076
|
let t = e.userData.trueNorthBaseMatrix;
|
|
10070
10077
|
if (t instanceof z) return t;
|
|
10071
10078
|
let n = e.matrix.clone();
|
|
10072
10079
|
return e.userData.trueNorthBaseMatrix = n, n;
|
|
10073
10080
|
}
|
|
10074
|
-
function
|
|
10075
|
-
let n = Number(e.userData.trueNorthAngle ?? 0), r =
|
|
10076
|
-
|
|
10081
|
+
function Wd(e, t) {
|
|
10082
|
+
let n = Number(e.userData.trueNorthAngle ?? 0), r = td(Ud(e), n, t);
|
|
10083
|
+
e.matrix.copy(r), e.matrixAutoUpdate = !1, e.updateMatrixWorld(!0), e.userData.trueNorthEnabled = t, e.userData.geometryTransformVersion = (Number(e.userData.geometryTransformVersion) || 0) + 1;
|
|
10077
10084
|
}
|
|
10078
|
-
function
|
|
10085
|
+
function Gd(e) {
|
|
10079
10086
|
let t = K((e) => e.selected), n = K((e) => e.resetSelected), r = K((e) => e.showStats), i = K((e) => e.userDevice) === "pc", a = e.buildIndex, o = h(() => Array.from(a().elementIndex.keys()), [a]), s = h(() => a().ifcSpacesVisible, [a]), c = h((e, t) => {
|
|
10080
10087
|
let n = Date.now(), o = a(), s = /* @__PURE__ */ new Set();
|
|
10081
10088
|
t.forEach((t) => {
|
|
10082
10089
|
let n = o.elementIndex.get(t);
|
|
10083
10090
|
n && n.forEach(({ record: n }) => {
|
|
10084
|
-
n.modelID === e &&
|
|
10091
|
+
n.modelID === e && Id(n, t, s);
|
|
10085
10092
|
});
|
|
10086
|
-
}), s.forEach((e) =>
|
|
10093
|
+
}), s.forEach((e) => Rd(e, o.ifcSpacesVisible, Vd(o, e), i)), Ld(r, "hideByIds", n);
|
|
10087
10094
|
}, [
|
|
10088
10095
|
a,
|
|
10089
10096
|
i,
|
|
10090
10097
|
r
|
|
10091
10098
|
]), l = h(() => {
|
|
10092
10099
|
let e = Date.now(), o = a(), s = /* @__PURE__ */ new Set();
|
|
10093
|
-
|
|
10100
|
+
Fd(t, (e, t) => {
|
|
10094
10101
|
let n = o.elementIndex.get(t);
|
|
10095
10102
|
n && n.forEach(({ record: n }) => {
|
|
10096
|
-
n.modelID === e &&
|
|
10103
|
+
n.modelID === e && Id(n, t, s);
|
|
10097
10104
|
});
|
|
10098
|
-
}), s.forEach((e) =>
|
|
10105
|
+
}), s.forEach((e) => Rd(e, o.ifcSpacesVisible, Vd(o, e), i)), n(), Ld(r, "hideSelected", e);
|
|
10099
10106
|
}, [
|
|
10100
10107
|
a,
|
|
10101
10108
|
i,
|
|
@@ -10109,14 +10116,14 @@ function Wd(e) {
|
|
|
10109
10116
|
n && n.forEach(({ record: n }) => {
|
|
10110
10117
|
n.modelID === e && n.hiddenIds.delete(t) && s.add(n);
|
|
10111
10118
|
});
|
|
10112
|
-
}), s.forEach((e) =>
|
|
10119
|
+
}), s.forEach((e) => Rd(e, o.ifcSpacesVisible, Vd(o, e), i)), Ld(r, "showByIds", n);
|
|
10113
10120
|
}, [
|
|
10114
10121
|
a,
|
|
10115
10122
|
i,
|
|
10116
10123
|
r
|
|
10117
10124
|
]), d = h((e, t) => {
|
|
10118
10125
|
let n = Date.now(), o = a();
|
|
10119
|
-
o.isolatedIdsByModel = new Map([[e, new Set(t)]]), o.isolatedIds = null, o.records.forEach((e) =>
|
|
10126
|
+
o.isolatedIdsByModel = new Map([[e, new Set(t)]]), o.isolatedIds = null, o.records.forEach((e) => Rd(e, o.ifcSpacesVisible, Vd(o, e), i)), Ld(r, "isolateByIds", n);
|
|
10120
10127
|
}, [
|
|
10121
10128
|
a,
|
|
10122
10129
|
i,
|
|
@@ -10131,24 +10138,24 @@ function Wd(e) {
|
|
|
10131
10138
|
t.modelID === e && c.add(t);
|
|
10132
10139
|
});
|
|
10133
10140
|
}), !c.size) {
|
|
10134
|
-
|
|
10141
|
+
Ld(r, "removeByIds", n);
|
|
10135
10142
|
return;
|
|
10136
10143
|
}
|
|
10137
10144
|
c.forEach((e) => {
|
|
10138
|
-
|
|
10145
|
+
Bd(e, s);
|
|
10139
10146
|
}), s.forEach((t) => {
|
|
10140
|
-
|
|
10141
|
-
}), c.forEach((e) =>
|
|
10147
|
+
zd(o, e, t), o.elementBounds.get(e)?.delete(t), o.isolatedIds?.delete(t), o.isolatedIdsByModel?.get(e)?.delete(t);
|
|
10148
|
+
}), c.forEach((e) => Rd(e, o.ifcSpacesVisible, Vd(o, e), i)), Ld(r, "removeByIds", n);
|
|
10142
10149
|
}, [
|
|
10143
10150
|
a,
|
|
10144
10151
|
i,
|
|
10145
10152
|
r
|
|
10146
10153
|
]), p = h(() => {
|
|
10147
10154
|
let e = Date.now(), n = a(), o = /* @__PURE__ */ new Map();
|
|
10148
|
-
|
|
10155
|
+
Fd(t, (e, t) => {
|
|
10149
10156
|
let n = o.get(e);
|
|
10150
10157
|
n || (n = /* @__PURE__ */ new Set(), o.set(e, n)), n.add(t);
|
|
10151
|
-
}), n.isolatedIdsByModel = o, n.isolatedIds = null, n.records.forEach((e) =>
|
|
10158
|
+
}), n.isolatedIdsByModel = o, n.isolatedIds = null, n.records.forEach((e) => Rd(e, n.ifcSpacesVisible, Vd(n, e), i)), Ld(r, "isolateSelected", e);
|
|
10152
10159
|
}, [
|
|
10153
10160
|
a,
|
|
10154
10161
|
i,
|
|
@@ -10156,7 +10163,7 @@ function Wd(e) {
|
|
|
10156
10163
|
r
|
|
10157
10164
|
]), m = h(() => {
|
|
10158
10165
|
let e = Date.now(), t = a();
|
|
10159
|
-
t.isolatedIdsByModel = null, t.isolatedIds = null, t.records.forEach((e) =>
|
|
10166
|
+
t.isolatedIdsByModel = null, t.isolatedIds = null, t.records.forEach((e) => Rd(e, t.ifcSpacesVisible, Vd(t, e), i)), Ld(r, "resetIsolation", e);
|
|
10160
10167
|
}, [
|
|
10161
10168
|
a,
|
|
10162
10169
|
i,
|
|
@@ -10164,7 +10171,7 @@ function Wd(e) {
|
|
|
10164
10171
|
]), g = h((e) => {
|
|
10165
10172
|
let t = a();
|
|
10166
10173
|
t.ifcSpacesVisible !== e && (t.ifcSpacesVisible = e, t.records.forEach((e) => {
|
|
10167
|
-
e.isIfcSpace &&
|
|
10174
|
+
e.isIfcSpace && Rd(e, t.ifcSpacesVisible, Vd(t, e), i);
|
|
10168
10175
|
}));
|
|
10169
10176
|
}, [a, i]), _ = h(() => {
|
|
10170
10177
|
g(!s());
|
|
@@ -10186,8 +10193,8 @@ function Wd(e) {
|
|
|
10186
10193
|
showAll: h(() => {
|
|
10187
10194
|
let e = Date.now(), t = a();
|
|
10188
10195
|
t.isolatedIdsByModel = null, t.isolatedIds = null, t.records.forEach((e) => {
|
|
10189
|
-
e.hiddenIds.clear(),
|
|
10190
|
-
}),
|
|
10196
|
+
e.hiddenIds.clear(), Rd(e, t.ifcSpacesVisible, Vd(t, e), i);
|
|
10197
|
+
}), Ld(r, "showAll", e);
|
|
10191
10198
|
}, [
|
|
10192
10199
|
a,
|
|
10193
10200
|
i,
|
|
@@ -10196,23 +10203,23 @@ function Wd(e) {
|
|
|
10196
10203
|
showByIds: u,
|
|
10197
10204
|
toggleIIfcSpacesVisibility: _,
|
|
10198
10205
|
useTrueNorth: h((t = !0) => {
|
|
10199
|
-
let n =
|
|
10200
|
-
n.length && (n.forEach((e) =>
|
|
10206
|
+
let n = Hd(a().indexedModel);
|
|
10207
|
+
n.length && (n.forEach((e) => Wd(e, t)), e.resetIndex());
|
|
10201
10208
|
}, [a, e])
|
|
10202
10209
|
};
|
|
10203
10210
|
}
|
|
10204
10211
|
//#endregion
|
|
10205
10212
|
//#region src/viewer/utils/ClippingUtils/PlaneHelper.ts
|
|
10206
|
-
var
|
|
10207
|
-
function
|
|
10213
|
+
var Kd = "#0b2f5f", qd = "#0b2f5f", Jd = 0, Yd = "#165eb0", Xd = .3, Zd = .01, Qd = .025, $d = .015, ef = .02, tf = 1e-7, nf = .25, rf = .15, af = .25, of = 1e-5, sf = .2, cf = 1, lf = 1;
|
|
10214
|
+
function uf(e, t) {
|
|
10208
10215
|
let n = t.getBoundingClientRect();
|
|
10209
10216
|
return new U((e.clientX - n.left) / n.width * 2 - 1, -((e.clientY - n.top) / n.height) * 2 + 1);
|
|
10210
10217
|
}
|
|
10211
|
-
function
|
|
10218
|
+
function df(e) {
|
|
10212
10219
|
let t = e.getSize(new W());
|
|
10213
|
-
return Math.max(
|
|
10220
|
+
return Math.max(af, t.length() * Zd);
|
|
10214
10221
|
}
|
|
10215
|
-
var
|
|
10222
|
+
var ff = class extends Oe {
|
|
10216
10223
|
helper = new L();
|
|
10217
10224
|
borderMaterial;
|
|
10218
10225
|
material;
|
|
@@ -10232,15 +10239,15 @@ var df = class extends Oe {
|
|
|
10232
10239
|
listenersActive = !1;
|
|
10233
10240
|
constructor(e, t, n, r) {
|
|
10234
10241
|
super(), this.context = e, this.plane = t, this.location = n.clone(), this.normal = r.clone().normalize(), this.material = new Se({
|
|
10235
|
-
color:
|
|
10242
|
+
color: qd,
|
|
10236
10243
|
depthWrite: !1,
|
|
10237
|
-
opacity:
|
|
10244
|
+
opacity: Jd,
|
|
10238
10245
|
side: le,
|
|
10239
10246
|
transparent: !0
|
|
10240
10247
|
}), this.helper.position.copy(this.location), this.applyPlaneOrientation(), this.layout = this.getHelperLayout();
|
|
10241
|
-
let i = Math.max(
|
|
10248
|
+
let i = Math.max(nf, Math.min(this.layout.width, this.layout.height) * Qd), a = Math.max(rf, Math.min(this.layout.width, this.layout.height) * $d);
|
|
10242
10249
|
this.borderMaterial = new _e({
|
|
10243
|
-
color:
|
|
10250
|
+
color: Kd,
|
|
10244
10251
|
dashSize: i,
|
|
10245
10252
|
depthWrite: !1,
|
|
10246
10253
|
gapSize: a
|
|
@@ -10271,7 +10278,7 @@ var df = class extends Oe {
|
|
|
10271
10278
|
}
|
|
10272
10279
|
updateBorderDash() {
|
|
10273
10280
|
let e = Math.min(this.layout.width, this.layout.height);
|
|
10274
|
-
this.borderMaterial.dashSize = Math.max(
|
|
10281
|
+
this.borderMaterial.dashSize = Math.max(nf, e * Qd), this.borderMaterial.gapSize = Math.max(rf, e * $d), this.borderMaterial.needsUpdate = !0;
|
|
10275
10282
|
}
|
|
10276
10283
|
addEventListeners() {
|
|
10277
10284
|
if (this.listenersActive) return;
|
|
@@ -10333,10 +10340,10 @@ var df = class extends Oe {
|
|
|
10333
10340
|
return !1;
|
|
10334
10341
|
}
|
|
10335
10342
|
getEdgeInteractionWidth() {
|
|
10336
|
-
return Math.min(
|
|
10343
|
+
return Math.min(cf, Math.max(sf, Math.min(this.layout.width, this.layout.height) * ef));
|
|
10337
10344
|
}
|
|
10338
10345
|
getDragDistanceEpsilon() {
|
|
10339
|
-
return Math.max(
|
|
10346
|
+
return Math.max(of, Math.min(this.layout.width, this.layout.height) * tf);
|
|
10340
10347
|
}
|
|
10341
10348
|
getPointToSegmentDistanceSquared(e, t, n) {
|
|
10342
10349
|
let r = n.x - t.x, i = n.y - t.y, a = r * r + i * i;
|
|
@@ -10349,7 +10356,7 @@ var df = class extends Oe {
|
|
|
10349
10356
|
}
|
|
10350
10357
|
getPointerPointOnPlane(e, t) {
|
|
10351
10358
|
let n = this.context.getDomElement();
|
|
10352
|
-
this.pointer.copy(
|
|
10359
|
+
this.pointer.copy(uf(e, n));
|
|
10353
10360
|
let r = this.context.getRaycaster(), i = new W();
|
|
10354
10361
|
return r.setFromCamera(this.pointer, this.context.getCamera()), r.ray.intersectPlane(t, i);
|
|
10355
10362
|
}
|
|
@@ -10402,21 +10409,21 @@ var df = class extends Oe {
|
|
|
10402
10409
|
t && (this.context.clearHelpersHover(this), this.hasHelperPriority(e) && this.stopHelperPriorityEvent(e)), this.hovered !== t && this.setHovered(t);
|
|
10403
10410
|
}
|
|
10404
10411
|
setHovered(e) {
|
|
10405
|
-
this.hovered = e, this.material.color.set(e ?
|
|
10412
|
+
this.hovered = e, this.material.color.set(e ? Yd : qd), this.material.opacity = e ? Xd : Jd, this.material.needsUpdate = !0;
|
|
10406
10413
|
}
|
|
10407
10414
|
createPlaneMesh() {
|
|
10408
|
-
let e = new B(new
|
|
10415
|
+
let e = new B(new ne(), this.material);
|
|
10409
10416
|
return e.renderOrder = 2, e;
|
|
10410
10417
|
}
|
|
10411
10418
|
createBorder() {
|
|
10412
|
-
let e = new ve(new
|
|
10419
|
+
let e = new ve(new ne(), this.borderMaterial);
|
|
10413
10420
|
return e.renderOrder = 3, e;
|
|
10414
10421
|
}
|
|
10415
10422
|
replaceGeometry(e, t) {
|
|
10416
10423
|
e.geometry.dispose(), e.geometry = t;
|
|
10417
10424
|
}
|
|
10418
10425
|
createFillGeometry(e) {
|
|
10419
|
-
let t = new
|
|
10426
|
+
let t = new ne(), n = [];
|
|
10420
10427
|
if (e.length >= 3) {
|
|
10421
10428
|
let t = e[0];
|
|
10422
10429
|
for (let r = 1; r < e.length - 1; r++) {
|
|
@@ -10427,7 +10434,7 @@ var df = class extends Oe {
|
|
|
10427
10434
|
return t.setAttribute("position", new F(n, 3)), n.length && t.computeBoundingSphere(), t;
|
|
10428
10435
|
}
|
|
10429
10436
|
createBorderGeometry(e) {
|
|
10430
|
-
let t = new
|
|
10437
|
+
let t = new ne(), n = [];
|
|
10431
10438
|
if (e.length >= 2) for (let t = 0; t < e.length; t++) {
|
|
10432
10439
|
let r = e[t], i = e[(t + 1) % e.length];
|
|
10433
10440
|
n.push(r.x, r.y, 0, i.x, i.y, 0);
|
|
@@ -10478,12 +10485,12 @@ var df = class extends Oe {
|
|
|
10478
10485
|
getHelperLayout() {
|
|
10479
10486
|
let e = this.getModelWorldBox();
|
|
10480
10487
|
if (!e || e.isEmpty()) return {
|
|
10481
|
-
height:
|
|
10482
|
-
maxU:
|
|
10483
|
-
maxV:
|
|
10484
|
-
minU: -
|
|
10485
|
-
minV: -
|
|
10486
|
-
width:
|
|
10488
|
+
height: lf,
|
|
10489
|
+
maxU: lf / 2,
|
|
10490
|
+
maxV: lf / 2,
|
|
10491
|
+
minU: -lf / 2,
|
|
10492
|
+
minV: -lf / 2,
|
|
10493
|
+
width: lf
|
|
10487
10494
|
};
|
|
10488
10495
|
let t = this.getPlaneBasis(), n = this.helper.position, r = this.getBoxCorners(e), i = new W(), a = new W(), o = Infinity, s = -Infinity, c = Infinity, l = -Infinity;
|
|
10489
10496
|
if (r.forEach((e) => {
|
|
@@ -10491,14 +10498,14 @@ var df = class extends Oe {
|
|
|
10491
10498
|
let r = a.dot(t.u), u = a.dot(t.v);
|
|
10492
10499
|
o = Math.min(o, r), s = Math.max(s, r), c = Math.min(c, u), l = Math.max(l, u);
|
|
10493
10500
|
}), !Number.isFinite(o) || !Number.isFinite(s) || !Number.isFinite(c) || !Number.isFinite(l)) return {
|
|
10494
|
-
height:
|
|
10495
|
-
maxU:
|
|
10496
|
-
maxV:
|
|
10497
|
-
minU: -
|
|
10498
|
-
minV: -
|
|
10499
|
-
width:
|
|
10501
|
+
height: lf,
|
|
10502
|
+
maxU: lf / 2,
|
|
10503
|
+
maxV: lf / 2,
|
|
10504
|
+
minU: -lf / 2,
|
|
10505
|
+
minV: -lf / 2,
|
|
10506
|
+
width: lf
|
|
10500
10507
|
};
|
|
10501
|
-
let u =
|
|
10508
|
+
let u = df(e), d = o - u, f = s + u, p = c - u, m = l + u, h = Math.max(lf, f - d), g = Math.max(lf, m - p), _ = (d + f) / 2, v = (p + m) / 2;
|
|
10502
10509
|
return {
|
|
10503
10510
|
height: g,
|
|
10504
10511
|
maxU: _ + h / 2,
|
|
@@ -10520,7 +10527,7 @@ var df = class extends Oe {
|
|
|
10520
10527
|
this.helper.quaternion.setFromRotationMatrix(t);
|
|
10521
10528
|
}
|
|
10522
10529
|
getModelWorldBox() {
|
|
10523
|
-
let e = new
|
|
10530
|
+
let e = new j(), t = new j();
|
|
10524
10531
|
return this.context.getMeshes().forEach((n) => {
|
|
10525
10532
|
n.updateWorldMatrix(!0, !1), n.geometry.boundingBox || n.geometry.computeBoundingBox(), n.geometry.boundingBox && (t.copy(n.geometry.boundingBox).applyMatrix4(n.matrixWorld), e.union(t));
|
|
10526
10533
|
}), this.context.helpers.forEach((t) => {
|
|
@@ -10539,8 +10546,8 @@ var df = class extends Oe {
|
|
|
10539
10546
|
new W(e.max.x, e.max.y, e.max.z)
|
|
10540
10547
|
];
|
|
10541
10548
|
}
|
|
10542
|
-
},
|
|
10543
|
-
function
|
|
10549
|
+
}, pf = 250, mf = "#a9a9a9", hf = new W(0, 0, -1), gf = "__bimatterCameraMotionHidden";
|
|
10550
|
+
function _f(e, t) {
|
|
10544
10551
|
if (Array.isArray(e)) {
|
|
10545
10552
|
e.forEach((e) => {
|
|
10546
10553
|
e.clippingPlanes = t, e.needsUpdate = !0;
|
|
@@ -10549,13 +10556,13 @@ function gf(e, t) {
|
|
|
10549
10556
|
}
|
|
10550
10557
|
e.clippingPlanes = t, e.needsUpdate = !0;
|
|
10551
10558
|
}
|
|
10552
|
-
function
|
|
10559
|
+
function vf(e) {
|
|
10553
10560
|
let t = [];
|
|
10554
10561
|
return e?.traverse((e) => {
|
|
10555
10562
|
e instanceof B && (!e.geometry.index || !e.geometry.attributes.ids || t.push(e));
|
|
10556
10563
|
}), t;
|
|
10557
10564
|
}
|
|
10558
|
-
function
|
|
10565
|
+
function yf(e) {
|
|
10559
10566
|
let t = e;
|
|
10560
10567
|
for (; t;) {
|
|
10561
10568
|
let e = t.userData.modelID;
|
|
@@ -10564,14 +10571,14 @@ function vf(e) {
|
|
|
10564
10571
|
}
|
|
10565
10572
|
return 0;
|
|
10566
10573
|
}
|
|
10567
|
-
function
|
|
10574
|
+
function bf(e, t, n) {
|
|
10568
10575
|
let r = e;
|
|
10569
10576
|
r && (r.isClippingGroup = n, r.enabled = n && t.length > 0, r.clipIntersection = !1, r.clipShadows = !1, r.clippingPlanes = n ? t : []);
|
|
10570
10577
|
}
|
|
10571
|
-
function
|
|
10578
|
+
function xf(e, t) {
|
|
10572
10579
|
return t.clone().transformDirection(e.matrixWorld).normalize();
|
|
10573
10580
|
}
|
|
10574
|
-
function
|
|
10581
|
+
function Sf(e) {
|
|
10575
10582
|
if (!e) return null;
|
|
10576
10583
|
if ("x" in e) {
|
|
10577
10584
|
let t = new W(e.x, e.y, e.z);
|
|
@@ -10580,7 +10587,7 @@ function xf(e) {
|
|
|
10580
10587
|
let t = new W(e[0], e[1], e[2]);
|
|
10581
10588
|
return Number.isFinite(t.x + t.y + t.z) ? t : null;
|
|
10582
10589
|
}
|
|
10583
|
-
var
|
|
10590
|
+
var Cf = class {
|
|
10584
10591
|
planes = [];
|
|
10585
10592
|
caps = [];
|
|
10586
10593
|
edges = [];
|
|
@@ -10588,7 +10595,7 @@ var Sf = class {
|
|
|
10588
10595
|
active = !1;
|
|
10589
10596
|
capsActive = !0;
|
|
10590
10597
|
capsCameraMotionActive = !1;
|
|
10591
|
-
capsColor =
|
|
10598
|
+
capsColor = mf;
|
|
10592
10599
|
context;
|
|
10593
10600
|
edgesActive = !0;
|
|
10594
10601
|
edgesCameraMotionActive = !1;
|
|
@@ -10645,13 +10652,13 @@ var Sf = class {
|
|
|
10645
10652
|
return this.context.controlRef;
|
|
10646
10653
|
}
|
|
10647
10654
|
getMeshes() {
|
|
10648
|
-
return
|
|
10655
|
+
return vf(this.context.modelRef.current);
|
|
10649
10656
|
}
|
|
10650
10657
|
getPlanVisualObjects() {
|
|
10651
|
-
return [...this.caps.map((e) => e.getObject()).filter((e) => e.visible || e.userData[
|
|
10658
|
+
return [...this.caps.map((e) => e.getObject()).filter((e) => e.visible || e.userData[gf]), ...this.edges.flatMap((e) => e.getObjects(!0))];
|
|
10652
10659
|
}
|
|
10653
10660
|
getObjectModelID(e) {
|
|
10654
|
-
return
|
|
10661
|
+
return yf(e);
|
|
10655
10662
|
}
|
|
10656
10663
|
getEdgeSegmentsForPlane(e) {
|
|
10657
10664
|
return this.edgesActive ? this.edges.find((t) => t.plane === e && t.active)?.getIntersectionSegments() ?? null : null;
|
|
@@ -10690,12 +10697,12 @@ var Sf = class {
|
|
|
10690
10697
|
if (this.capsCameraMotionActive !== e) {
|
|
10691
10698
|
if (this.capsCameraMotionActive = e, e) {
|
|
10692
10699
|
this.clearCapsDragIdleTimeout(), this.caps.forEach((e) => {
|
|
10693
|
-
e.getObject().userData[
|
|
10700
|
+
e.getObject().userData[gf] = !0, e.setVisible(!1);
|
|
10694
10701
|
}), this.context.onVisualChange?.();
|
|
10695
10702
|
return;
|
|
10696
10703
|
}
|
|
10697
10704
|
this.caps.forEach((e) => {
|
|
10698
|
-
delete e.getObject().userData[
|
|
10705
|
+
delete e.getObject().userData[gf], e.setVisible(this.active && this.capsActive && !this.capsDragActive);
|
|
10699
10706
|
}), this.context.onVisualChange?.();
|
|
10700
10707
|
}
|
|
10701
10708
|
}
|
|
@@ -10710,7 +10717,7 @@ var Sf = class {
|
|
|
10710
10717
|
this.capsDragIdleTimeout = null, !(!this.active || !this.capsDragActive || this.capsCameraMotionActive) && (this.flushEdgesUpdate(), this.caps.forEach((e) => {
|
|
10711
10718
|
e.setVisible(!0), e.update();
|
|
10712
10719
|
}), this.updateCapsVisualState());
|
|
10713
|
-
},
|
|
10720
|
+
}, pf));
|
|
10714
10721
|
}
|
|
10715
10722
|
clearCapsDragIdleTimeout() {
|
|
10716
10723
|
this.capsDragIdleTimeout !== null && (window.clearTimeout(this.capsDragIdleTimeout), this.capsDragIdleTimeout = null);
|
|
@@ -10732,15 +10739,15 @@ var Sf = class {
|
|
|
10732
10739
|
typeof this.helperHoverMoveState == "number" ? this.helperHoverMoveState += 1 : this.helperHoverMoveState === "start" && (this.helperHoverMoveState = 1);
|
|
10733
10740
|
};
|
|
10734
10741
|
getModelWorldBox() {
|
|
10735
|
-
let e = new
|
|
10742
|
+
let e = new j(), t = new j();
|
|
10736
10743
|
return this.getMeshes().forEach((n) => {
|
|
10737
10744
|
n.updateWorldMatrix(!0, !1), n.geometry.boundingBox || n.geometry.computeBoundingBox(), n.geometry.boundingBox && (t.copy(n.geometry.boundingBox).applyMatrix4(n.matrixWorld), e.union(t));
|
|
10738
10745
|
}), e.isEmpty() ? null : e;
|
|
10739
10746
|
}
|
|
10740
10747
|
getSelectedWorldBox() {
|
|
10741
|
-
let e = this.context.viewerStore.getState().selected, t = new
|
|
10748
|
+
let e = this.context.viewerStore.getState().selected, t = new j(), n = new W();
|
|
10742
10749
|
return this.getMeshes().forEach((r) => {
|
|
10743
|
-
let i = e[
|
|
10750
|
+
let i = e[yf(r)];
|
|
10744
10751
|
if (!i?.size) return;
|
|
10745
10752
|
let a = r.geometry.attributes.ids, o = r.geometry.attributes.position;
|
|
10746
10753
|
if (!a || !o) return;
|
|
@@ -10758,8 +10765,8 @@ var Sf = class {
|
|
|
10758
10765
|
}
|
|
10759
10766
|
updateMaterials() {
|
|
10760
10767
|
let e = this.active ? this.planes : [];
|
|
10761
|
-
|
|
10762
|
-
|
|
10768
|
+
bf(this.context.modelRef.current, e, this.context.useWebGPU), this.getMeshes().forEach((t) => {
|
|
10769
|
+
_f(t.material, e);
|
|
10763
10770
|
}), this.context.camera.updateMatrixWorld();
|
|
10764
10771
|
}
|
|
10765
10772
|
setActive(e) {
|
|
@@ -10778,13 +10785,13 @@ var Sf = class {
|
|
|
10778
10785
|
recursive: !1
|
|
10779
10786
|
});
|
|
10780
10787
|
if (!n?.face) return null;
|
|
10781
|
-
let r = n.point.clone(), i =
|
|
10788
|
+
let r = n.point.clone(), i = xf(n.object, n.face.normal);
|
|
10782
10789
|
r.add(i.clone().multiplyScalar(.001));
|
|
10783
10790
|
let a = new je().setFromNormalAndCoplanarPoint(i.clone().negate(), r);
|
|
10784
10791
|
return this.addPlane(a, r, i), a.clone();
|
|
10785
10792
|
}
|
|
10786
10793
|
createPlaneFromPointAndNormal(e, t) {
|
|
10787
|
-
let n = typeof e == "number" ? this.getPointFromZ(e) :
|
|
10794
|
+
let n = typeof e == "number" ? this.getPointFromZ(e) : Sf(e), r = Sf(t ?? (typeof e == "number" ? hf : void 0));
|
|
10788
10795
|
if (!n || !r || r.lengthSq() === 0) return null;
|
|
10789
10796
|
r.normalize();
|
|
10790
10797
|
let i = new je().setFromNormalAndCoplanarPoint(r, n);
|
|
@@ -10793,7 +10800,7 @@ var Sf = class {
|
|
|
10793
10800
|
createClippingRectangle(e = !1) {
|
|
10794
10801
|
let t = e ? this.getSelectedWorldBox() : this.getModelWorldBox();
|
|
10795
10802
|
if (!t) return [];
|
|
10796
|
-
let n =
|
|
10803
|
+
let n = df(t), r = t.min.clone().addScalar(-n), i = t.max.clone().addScalar(n), a = t.getCenter(new W()), o = [
|
|
10797
10804
|
{
|
|
10798
10805
|
normal: new W(1, 0, 0),
|
|
10799
10806
|
point: new W(r.x, a.y, a.z)
|
|
@@ -10833,7 +10840,7 @@ var Sf = class {
|
|
|
10833
10840
|
return new W(t?.x ?? 0, t?.y ?? 0, e);
|
|
10834
10841
|
}
|
|
10835
10842
|
addPlane(e, t, n) {
|
|
10836
|
-
if (this.active || this.setActive(!0), this.planes.push(e), new
|
|
10843
|
+
if (this.active || this.setActive(!0), this.planes.push(e), new ff(this, e, t, n), this.edgesActive) {
|
|
10837
10844
|
let t = new ul(this, e);
|
|
10838
10845
|
t.create(), t.update();
|
|
10839
10846
|
}
|
|
@@ -10892,9 +10899,9 @@ var Sf = class {
|
|
|
10892
10899
|
this.clearCapsDragIdleTimeout(), this.deleteAllPlanes();
|
|
10893
10900
|
}
|
|
10894
10901
|
};
|
|
10895
|
-
function
|
|
10896
|
-
let a =
|
|
10897
|
-
u.current ||= new
|
|
10902
|
+
function wf(e, t, n, r = !1, i) {
|
|
10903
|
+
let a = O((e) => e.camera), o = O((e) => e.gl), s = O((e) => e.raycaster), c = O((e) => e.scene), l = Tt(), u = x(null);
|
|
10904
|
+
u.current ||= new Cf({
|
|
10898
10905
|
camera: a,
|
|
10899
10906
|
cameraUtils: n,
|
|
10900
10907
|
controlRef: t,
|
|
@@ -10975,15 +10982,15 @@ function Cf(e, t, n, r = !1, i) {
|
|
|
10975
10982
|
}
|
|
10976
10983
|
//#endregion
|
|
10977
10984
|
//#region src/viewer/utils/Hotkeys/useHotkeysUtils.tsx
|
|
10978
|
-
function
|
|
10985
|
+
function Tf(e) {
|
|
10979
10986
|
return e instanceof HTMLElement ? e.isContentEditable || e instanceof HTMLInputElement || e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement : !1;
|
|
10980
10987
|
}
|
|
10981
|
-
function
|
|
10988
|
+
function Ef(e = !0) {
|
|
10982
10989
|
let t = K((e) => e.api), n = K((e) => e.defaultHotkeysEnabled);
|
|
10983
10990
|
_(() => {
|
|
10984
10991
|
if (!e || !n) return;
|
|
10985
10992
|
let r = (e) => {
|
|
10986
|
-
|
|
10993
|
+
Tf(e.target) || (e.code === "KeyI" && t?.geometryUtils.isolateSelected(), e.code === "KeyH" && t?.geometryUtils.hideSelected(), e.code === "KeyC" && t?.geometryUtils.showAll(), e.code === "KeyP" && t?.clipping.createPlane(), e.code === "KeyM" && t?.dimensions.toggle(), e.code === "KeyN" && t?.notes.toggleNodeMode(), t?.notes.getNodeModeActive() && (e.code === "Digit1" && (e.preventDefault(), t.notes.createMarkupCloud()), e.code === "Digit2" && (e.preventDefault(), t.notes.createComment())));
|
|
10987
10994
|
};
|
|
10988
10995
|
return window.addEventListener("keydown", r), () => {
|
|
10989
10996
|
window.removeEventListener("keydown", r);
|
|
@@ -10996,8 +11003,8 @@ function Tf(e = !0) {
|
|
|
10996
11003
|
}
|
|
10997
11004
|
//#endregion
|
|
10998
11005
|
//#region src/viewer/Selector/SelectionBox.ts
|
|
10999
|
-
var
|
|
11000
|
-
function
|
|
11006
|
+
var Df = new W(), Of = new W(), kf = new U(), Af = new W(), jf = new W(), Mf = new W(), Nf = new W(), Pf = new W(), Ff = new W(), If = new W();
|
|
11007
|
+
function Lf(e) {
|
|
11001
11008
|
let t = e;
|
|
11002
11009
|
for (; t;) {
|
|
11003
11010
|
let e = t.modelID ?? t.userData.modelID;
|
|
@@ -11006,7 +11013,7 @@ function If(e) {
|
|
|
11006
11013
|
}
|
|
11007
11014
|
return 0;
|
|
11008
11015
|
}
|
|
11009
|
-
function
|
|
11016
|
+
function Rf(e) {
|
|
11010
11017
|
let t = e;
|
|
11011
11018
|
for (; t;) {
|
|
11012
11019
|
if (!t.visible) return !1;
|
|
@@ -11014,16 +11021,16 @@ function Lf(e) {
|
|
|
11014
11021
|
}
|
|
11015
11022
|
return !0;
|
|
11016
11023
|
}
|
|
11017
|
-
function
|
|
11018
|
-
return n.length ? (
|
|
11024
|
+
function zf(e, t, n) {
|
|
11025
|
+
return n.length ? (Af.copy(t).applyMatrix4(e.matrixWorld), Rs(Af, n)) : !0;
|
|
11019
11026
|
}
|
|
11020
|
-
function
|
|
11021
|
-
return i.length ? (
|
|
11022
|
-
let t = e.distanceToPoint(
|
|
11027
|
+
function Bf(e, t, n, r, i) {
|
|
11028
|
+
return i.length ? (jf.copy(t).applyMatrix4(e.matrixWorld), Mf.copy(n).applyMatrix4(e.matrixWorld), Nf.copy(r).applyMatrix4(e.matrixWorld), i.every((e) => {
|
|
11029
|
+
let t = e.distanceToPoint(jf), n = e.distanceToPoint(Mf), r = e.distanceToPoint(Nf);
|
|
11023
11030
|
return !(t < -1e-6 && n < -1e-6 && r < -1e-6);
|
|
11024
11031
|
})) : !0;
|
|
11025
11032
|
}
|
|
11026
|
-
function
|
|
11033
|
+
function Vf(e) {
|
|
11027
11034
|
let t = e.getBoundingClientRect();
|
|
11028
11035
|
return {
|
|
11029
11036
|
height: t.height,
|
|
@@ -11032,7 +11039,7 @@ function Bf(e) {
|
|
|
11032
11039
|
width: t.width
|
|
11033
11040
|
};
|
|
11034
11041
|
}
|
|
11035
|
-
function
|
|
11042
|
+
function Hf(e) {
|
|
11036
11043
|
return {
|
|
11037
11044
|
boundsCheckMs: 0,
|
|
11038
11045
|
candidateIds: 0,
|
|
@@ -11058,7 +11065,7 @@ function Vf(e) {
|
|
|
11058
11065
|
triangleProjectionMs: 0
|
|
11059
11066
|
};
|
|
11060
11067
|
}
|
|
11061
|
-
function
|
|
11068
|
+
function Uf(e, t) {
|
|
11062
11069
|
return {
|
|
11063
11070
|
minX: Math.min(e.x, t.x),
|
|
11064
11071
|
minY: Math.min(e.y, t.y),
|
|
@@ -11066,43 +11073,43 @@ function Hf(e, t) {
|
|
|
11066
11073
|
maxY: Math.max(e.y, t.y)
|
|
11067
11074
|
};
|
|
11068
11075
|
}
|
|
11069
|
-
function
|
|
11076
|
+
function Wf(e, t) {
|
|
11070
11077
|
return t.x >= e.x ? "contains" : "intersects";
|
|
11071
11078
|
}
|
|
11072
|
-
function
|
|
11073
|
-
return
|
|
11079
|
+
function Gf(e, t) {
|
|
11080
|
+
return Kf(e.x, e.y, t);
|
|
11074
11081
|
}
|
|
11075
|
-
function
|
|
11082
|
+
function Kf(e, t, n) {
|
|
11076
11083
|
return e >= n.minX && e <= n.maxX && t >= n.minY && t <= n.maxY;
|
|
11077
11084
|
}
|
|
11078
|
-
function
|
|
11085
|
+
function qf(e, t, n, r, i, a) {
|
|
11079
11086
|
return (a - t) * (n - e) > (r - t) * (i - e);
|
|
11080
11087
|
}
|
|
11081
|
-
function
|
|
11082
|
-
return
|
|
11088
|
+
function Jf(e, t, n, r, i, a, o, s) {
|
|
11089
|
+
return qf(e, t, i, a, o, s) !== qf(n, r, i, a, o, s) && qf(e, t, n, r, i, a) !== qf(e, t, n, r, o, s);
|
|
11083
11090
|
}
|
|
11084
|
-
function
|
|
11091
|
+
function Yf(e, t, n, r, i) {
|
|
11085
11092
|
let a = .5 * (-r.y * i.x + n.y * (-r.x + i.x) + n.x * (r.y - i.y) + r.x * i.y), o = a < 0 ? -1 : 1, s = (n.y * i.x - n.x * i.y + (i.y - n.y) * e + (n.x - i.x) * t) * o, c = (n.x * r.y - n.y * r.x + (n.y - r.y) * e + (r.x - n.x) * t) * o;
|
|
11086
11093
|
return s >= 0 && c >= 0 && s + c <= 2 * a * o;
|
|
11087
11094
|
}
|
|
11088
|
-
function
|
|
11089
|
-
return
|
|
11095
|
+
function Xf(e, t, n, r) {
|
|
11096
|
+
return Gf(e, r) || Gf(t, r) || Gf(n, r) || Yf(r.minX, r.minY, e, t, n) || Yf(r.maxX, r.minY, e, t, n) || Yf(r.maxX, r.maxY, e, t, n) || Yf(r.minX, r.maxY, e, t, n) ? !0 : Zf(e, t, r) || Zf(t, n, r) || Zf(n, e, r);
|
|
11090
11097
|
}
|
|
11091
|
-
function
|
|
11092
|
-
return
|
|
11098
|
+
function Zf(e, t, n) {
|
|
11099
|
+
return Jf(e.x, e.y, t.x, t.y, n.minX, n.minY, n.maxX, n.minY) || Jf(e.x, e.y, t.x, t.y, n.maxX, n.minY, n.maxX, n.maxY) || Jf(e.x, e.y, t.x, t.y, n.maxX, n.maxY, n.minX, n.maxY) || Jf(e.x, e.y, t.x, t.y, n.minX, n.maxY, n.minX, n.minY);
|
|
11093
11100
|
}
|
|
11094
|
-
function
|
|
11095
|
-
let a =
|
|
11101
|
+
function Qf(e, t, n, r, i = new U()) {
|
|
11102
|
+
let a = Df.copy(t).applyMatrix4(e.matrixWorld).project(n);
|
|
11096
11103
|
return i.set((a.x + 1) / 2 * r.width + r.left, (-a.y + 1) / 2 * r.height + r.top);
|
|
11097
11104
|
}
|
|
11098
|
-
function
|
|
11105
|
+
function $f(e, t, n, r, i) {
|
|
11099
11106
|
let a = Infinity, o = -Infinity, s = Infinity, c = -Infinity, l = 0;
|
|
11100
|
-
for (let u = 0; u < 2; u++) for (let d = 0; d < 2; d++) for (let f = 0; f < 2; f++)
|
|
11107
|
+
for (let u = 0; u < 2; u++) for (let d = 0; d < 2; d++) for (let f = 0; f < 2; f++) Of.set(u ? t.max.x : t.min.x, d ? t.max.y : t.min.y, f ? t.max.z : t.min.z), Qf(e, Of, r, i, kf), a = Math.min(a, kf.x), o = Math.max(o, kf.x), s = Math.min(s, kf.y), c = Math.max(c, kf.y), Gf(kf, n) && (l += 1);
|
|
11101
11108
|
return o < n.minX || a > n.maxX || c < n.minY || s > n.maxY ? ft : l === 8 ? lt : ut;
|
|
11102
11109
|
}
|
|
11103
|
-
function
|
|
11110
|
+
function ep(e, t, n, r) {
|
|
11104
11111
|
let i = Infinity, a = -Infinity, o = Infinity, s = -Infinity;
|
|
11105
|
-
for (let c = 0; c < 2; c++) for (let l = 0; l < 2; l++) for (let u = 0; u < 2; u++)
|
|
11112
|
+
for (let c = 0; c < 2; c++) for (let l = 0; l < 2; l++) for (let u = 0; u < 2; u++) Of.set(c ? t.max.x : t.min.x, l ? t.max.y : t.min.y, u ? t.max.z : t.min.z), Qf(e, Of, n, r, kf), i = Math.min(i, kf.x), a = Math.max(a, kf.x), o = Math.min(o, kf.y), s = Math.max(s, kf.y);
|
|
11106
11113
|
return {
|
|
11107
11114
|
minX: i,
|
|
11108
11115
|
minY: o,
|
|
@@ -11110,41 +11117,41 @@ function $f(e, t, n, r) {
|
|
|
11110
11117
|
maxY: s
|
|
11111
11118
|
};
|
|
11112
11119
|
}
|
|
11113
|
-
function
|
|
11120
|
+
function tp(e, t) {
|
|
11114
11121
|
return !(e.maxX < t.minX || e.minX > t.maxX || e.maxY < t.minY || e.minY > t.maxY);
|
|
11115
11122
|
}
|
|
11116
|
-
function
|
|
11123
|
+
function np(e, t, n, r) {
|
|
11117
11124
|
e.geometry.boundingBox || e.geometry.computeBoundingBox();
|
|
11118
11125
|
let i = e.geometry.boundingBox;
|
|
11119
|
-
return i ? ep(
|
|
11126
|
+
return i ? tp(ep(e, i, n, r), t) : !0;
|
|
11120
11127
|
}
|
|
11121
|
-
function
|
|
11128
|
+
function rp(e, t, n) {
|
|
11122
11129
|
let r = e.get(t);
|
|
11123
11130
|
r || (r = /* @__PURE__ */ new Set(), e.set(t, r)), r.add(n);
|
|
11124
11131
|
}
|
|
11125
|
-
function
|
|
11132
|
+
function ip(e) {
|
|
11126
11133
|
let t = 0;
|
|
11127
11134
|
return e.forEach((e) => {
|
|
11128
11135
|
t += e.size;
|
|
11129
11136
|
}), t;
|
|
11130
11137
|
}
|
|
11131
|
-
function
|
|
11138
|
+
function ap(e, t, n, r = []) {
|
|
11132
11139
|
let i = e.geometry, a = i.index, o = i.attributes.ids, s = i.attributes.position;
|
|
11133
11140
|
if (!a || !o || !s) return;
|
|
11134
11141
|
let c = t * 3;
|
|
11135
|
-
r.length && (
|
|
11142
|
+
r.length && (Pf.fromBufferAttribute(s, a.getX(c)), Ff.fromBufferAttribute(s, a.getX(c + 1)), If.fromBufferAttribute(s, a.getX(c + 2)), !Bf(e, Pf, Ff, If, r)) || rp(n, Lf(e), o.getX(a.getX(c)));
|
|
11136
11143
|
}
|
|
11137
|
-
function
|
|
11144
|
+
function op({ model: e, camera: t, viewport: n, rect: r, candidateIdsByModel: i, clippingPlanes: a, profile: o }) {
|
|
11138
11145
|
let s = performance.now(), c = /* @__PURE__ */ new Map(), l = new W();
|
|
11139
11146
|
e.traverse((e) => {
|
|
11140
11147
|
let s = e;
|
|
11141
|
-
if (!s.isMesh || !
|
|
11148
|
+
if (!s.isMesh || !Rf(s)) return;
|
|
11142
11149
|
let u = s.geometry.attributes.ids, d = s.geometry.attributes.position;
|
|
11143
11150
|
if (!(!u || !d)) {
|
|
11144
11151
|
o && (o.containedVerticesVisited += u.count);
|
|
11145
11152
|
for (let e = 0; e < u.count; e++) {
|
|
11146
|
-
let f =
|
|
11147
|
-
if (!i.get(f)?.has(p) || (l.fromBufferAttribute(d, e), !
|
|
11153
|
+
let f = Lf(s), p = u.getX(e);
|
|
11154
|
+
if (!i.get(f)?.has(p) || (l.fromBufferAttribute(d, e), !zf(s, l, a))) continue;
|
|
11148
11155
|
o && (o.containedCandidateVertices += 1);
|
|
11149
11156
|
let m = `${f}:${p}`, h = c.get(m);
|
|
11150
11157
|
h || (h = {
|
|
@@ -11152,23 +11159,23 @@ function ap({ model: e, camera: t, viewport: n, rect: r, candidateIdsByModel: i,
|
|
|
11152
11159
|
inside: 0,
|
|
11153
11160
|
modelID: f,
|
|
11154
11161
|
total: 0
|
|
11155
|
-
}, c.set(m, h)), h.total += 1,
|
|
11162
|
+
}, c.set(m, h)), h.total += 1, Gf(Qf(s, l, t, n), r) && (h.inside += 1);
|
|
11156
11163
|
}
|
|
11157
11164
|
}
|
|
11158
11165
|
});
|
|
11159
11166
|
let u = /* @__PURE__ */ new Map();
|
|
11160
11167
|
return c.forEach((e) => {
|
|
11161
|
-
e.total > 0 && e.total === e.inside &&
|
|
11168
|
+
e.total > 0 && e.total === e.inside && rp(u, e.modelID, e.id);
|
|
11162
11169
|
}), o && (o.containedIdsMs += performance.now() - s), u;
|
|
11163
11170
|
}
|
|
11164
|
-
function
|
|
11171
|
+
function sp({ model: e, camera: t, clippingPlanes: n = [], domElement: r, rect: i, mode: a, profile: o }) {
|
|
11165
11172
|
let s = performance.now(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
11166
11173
|
if (!e) return c;
|
|
11167
|
-
let u =
|
|
11174
|
+
let u = Vf(r), d = performance.now();
|
|
11168
11175
|
e.updateMatrixWorld(!0), t.updateMatrixWorld(), o && (o.matrixUpdateMs += performance.now() - d), e.traverse((e) => {
|
|
11169
11176
|
let r = e;
|
|
11170
11177
|
if (!r.isMesh) return;
|
|
11171
|
-
if (o && (o.meshCount += 1), !
|
|
11178
|
+
if (o && (o.meshCount += 1), !Rf(r)) {
|
|
11172
11179
|
o && (o.skippedMeshCount += 1);
|
|
11173
11180
|
return;
|
|
11174
11181
|
}
|
|
@@ -11177,7 +11184,7 @@ function op({ model: e, camera: t, clippingPlanes: n = [], domElement: r, rect:
|
|
|
11177
11184
|
o && (o.skippedMeshCount += 1);
|
|
11178
11185
|
return;
|
|
11179
11186
|
}
|
|
11180
|
-
let d = performance.now(), f =
|
|
11187
|
+
let d = performance.now(), f = np(r, i, t, u);
|
|
11181
11188
|
if (o && (o.boundsCheckMs += performance.now() - d), !f) {
|
|
11182
11189
|
o && (o.skippedMeshCount += 1);
|
|
11183
11190
|
return;
|
|
@@ -11185,26 +11192,26 @@ function op({ model: e, camera: t, clippingPlanes: n = [], domElement: r, rect:
|
|
|
11185
11192
|
let p = performance.now();
|
|
11186
11193
|
s.shapecast({
|
|
11187
11194
|
intersectsBounds: (e) => {
|
|
11188
|
-
let n = performance.now(), a =
|
|
11195
|
+
let n = performance.now(), a = $f(r, e, i, t, u);
|
|
11189
11196
|
return o && (o.intersectsBoundsCalls += 1, o.intersectsBoundsMs += performance.now() - n), a;
|
|
11190
11197
|
},
|
|
11191
11198
|
intersectsRange: (e, t, i) => {
|
|
11192
11199
|
let u = performance.now();
|
|
11193
11200
|
if (o && (o.intersectsRangeCalls += 1), !i) return o && (o.intersectsRangeMs += performance.now() - u), !1;
|
|
11194
|
-
for (let i = e; i < e + t; i++)
|
|
11201
|
+
for (let i = e; i < e + t; i++) ap(r, s.resolveTriangleIndex(i), a === "contains" ? l : c, n);
|
|
11195
11202
|
return o && (o.intersectsRangeMs += performance.now() - u), !1;
|
|
11196
11203
|
},
|
|
11197
11204
|
intersectsTriangle: (e, s, d) => {
|
|
11198
11205
|
let f = performance.now();
|
|
11199
11206
|
if (o && (o.intersectsTriangleCalls += 1), !d) {
|
|
11200
|
-
let n = performance.now(), a =
|
|
11201
|
-
if (o && (o.triangleProjectionMs += performance.now() - n), !
|
|
11207
|
+
let n = performance.now(), a = Qf(r, e.a, t, u), s = Qf(r, e.b, t, u), c = Qf(r, e.c, t, u);
|
|
11208
|
+
if (o && (o.triangleProjectionMs += performance.now() - n), !Xf(a, s, c, i)) return o && (o.intersectsTriangleMs += performance.now() - f), !1;
|
|
11202
11209
|
}
|
|
11203
|
-
return a === "contains" ?
|
|
11210
|
+
return a === "contains" ? ap(r, s, l, n) : ap(r, s, c, n), o && (o.intersectsTriangleMs += performance.now() - f), !1;
|
|
11204
11211
|
}
|
|
11205
11212
|
}), o && (o.shapecastMs += performance.now() - p);
|
|
11206
11213
|
});
|
|
11207
|
-
let f = a === "contains" ?
|
|
11214
|
+
let f = a === "contains" ? op({
|
|
11208
11215
|
model: e,
|
|
11209
11216
|
camera: t,
|
|
11210
11217
|
clippingPlanes: n,
|
|
@@ -11213,19 +11220,19 @@ function op({ model: e, camera: t, clippingPlanes: n = [], domElement: r, rect:
|
|
|
11213
11220
|
candidateIdsByModel: l,
|
|
11214
11221
|
profile: o
|
|
11215
11222
|
}) : c;
|
|
11216
|
-
return o && (o.candidateIds =
|
|
11223
|
+
return o && (o.candidateIds = ip(l), o.selectedIds = ip(f), o.totalMs = performance.now() - s), f;
|
|
11217
11224
|
}
|
|
11218
|
-
function
|
|
11219
|
-
let t =
|
|
11225
|
+
function cp(e) {
|
|
11226
|
+
let t = Hf(e.mode);
|
|
11220
11227
|
return {
|
|
11221
|
-
ids:
|
|
11228
|
+
ids: sp({
|
|
11222
11229
|
...e,
|
|
11223
11230
|
profile: t
|
|
11224
11231
|
}),
|
|
11225
11232
|
profile: t
|
|
11226
11233
|
};
|
|
11227
11234
|
}
|
|
11228
|
-
function
|
|
11235
|
+
function lp(e) {
|
|
11229
11236
|
return e === "contains" ? {
|
|
11230
11237
|
border: "rgb(37, 99, 235)",
|
|
11231
11238
|
background: "rgba(37, 99, 235, 0.16)"
|
|
@@ -11234,40 +11241,40 @@ function cp(e) {
|
|
|
11234
11241
|
background: "rgba(22, 163, 74, 0.16)"
|
|
11235
11242
|
};
|
|
11236
11243
|
}
|
|
11237
|
-
function
|
|
11238
|
-
let r =
|
|
11244
|
+
function up(e, t, n) {
|
|
11245
|
+
let r = lp(Wf(t, n));
|
|
11239
11246
|
if (!e.current) {
|
|
11240
11247
|
let t = document.createElement("div");
|
|
11241
11248
|
t.style.position = "fixed", t.style.pointerEvents = "none", t.style.zIndex = "10", e.current = t, document.body.appendChild(t);
|
|
11242
11249
|
}
|
|
11243
|
-
let i =
|
|
11250
|
+
let i = Uf(t, n);
|
|
11244
11251
|
e.current.style.border = `1px solid ${r.border}`, e.current.style.background = r.background, e.current.style.left = `${i.minX}px`, e.current.style.top = `${i.minY}px`, e.current.style.width = `${i.maxX - i.minX}px`, e.current.style.height = `${i.maxY - i.minY}px`;
|
|
11245
11252
|
}
|
|
11246
|
-
function
|
|
11253
|
+
function dp(e) {
|
|
11247
11254
|
e.current?.remove(), e.current = null;
|
|
11248
11255
|
}
|
|
11249
11256
|
//#endregion
|
|
11250
11257
|
//#region src/viewer/Selector/useSelector.tsx
|
|
11251
|
-
var
|
|
11252
|
-
function
|
|
11253
|
-
if (Array.isArray(e)) return e.flatMap((e) =>
|
|
11258
|
+
var fp = 40;
|
|
11259
|
+
function pp(e) {
|
|
11260
|
+
if (Array.isArray(e)) return e.flatMap((e) => pp(e));
|
|
11254
11261
|
let t = e.userData;
|
|
11255
11262
|
return t.shaders ? Array.from(t.shaders) : t.shader ? [t.shader] : [];
|
|
11256
11263
|
}
|
|
11257
|
-
function
|
|
11264
|
+
function mp(e) {
|
|
11258
11265
|
let t = x(e);
|
|
11259
11266
|
return t.current = e, t;
|
|
11260
11267
|
}
|
|
11261
|
-
function
|
|
11262
|
-
|
|
11268
|
+
function hp(e, t) {
|
|
11269
|
+
pp(e)?.forEach((e) => {
|
|
11263
11270
|
let n = e.uniforms.preSelectionId;
|
|
11264
11271
|
n && (n.value = t);
|
|
11265
11272
|
});
|
|
11266
11273
|
}
|
|
11267
|
-
function
|
|
11274
|
+
function gp(e) {
|
|
11268
11275
|
return Number(e.current?.modelID ?? 0);
|
|
11269
11276
|
}
|
|
11270
|
-
function
|
|
11277
|
+
function _p(e) {
|
|
11271
11278
|
let t = e;
|
|
11272
11279
|
for (; t;) {
|
|
11273
11280
|
let e = t.modelID ?? t.userData.modelID;
|
|
@@ -11276,7 +11283,7 @@ function gp(e) {
|
|
|
11276
11283
|
}
|
|
11277
11284
|
return 0;
|
|
11278
11285
|
}
|
|
11279
|
-
function
|
|
11286
|
+
function vp(e) {
|
|
11280
11287
|
let t = e;
|
|
11281
11288
|
for (; t;) {
|
|
11282
11289
|
if (!t.visible) return !1;
|
|
@@ -11284,7 +11291,7 @@ function _p(e) {
|
|
|
11284
11291
|
}
|
|
11285
11292
|
return !0;
|
|
11286
11293
|
}
|
|
11287
|
-
function
|
|
11294
|
+
function yp(e) {
|
|
11288
11295
|
if (!e) return "";
|
|
11289
11296
|
let t = [
|
|
11290
11297
|
e.uuid,
|
|
@@ -11297,85 +11304,85 @@ function vp(e) {
|
|
|
11297
11304
|
});
|
|
11298
11305
|
}), t.join(":");
|
|
11299
11306
|
}
|
|
11300
|
-
function
|
|
11301
|
-
if (!
|
|
11307
|
+
function bp(e) {
|
|
11308
|
+
if (!vp(e.object) || !(e.object instanceof B) || e.faceIndex === void 0 || e.faceIndex === null) return !1;
|
|
11302
11309
|
let t = e.object.geometry;
|
|
11303
11310
|
return !!(t.index && t.attributes.ids);
|
|
11304
11311
|
}
|
|
11305
|
-
function
|
|
11306
|
-
if (!
|
|
11312
|
+
function xp(e) {
|
|
11313
|
+
if (!bp(e)) return null;
|
|
11307
11314
|
let t = e.object, n = t.geometry, r = n.index.getX(e.faceIndex * 3), i = n.attributes.ids;
|
|
11308
11315
|
if (r >= i.count) return null;
|
|
11309
11316
|
let a = n.attributes.modelID;
|
|
11310
11317
|
return {
|
|
11311
11318
|
elementID: i.getX(r),
|
|
11312
11319
|
hit: e,
|
|
11313
|
-
modelID: a ? a.getX(r) :
|
|
11320
|
+
modelID: a ? a.getX(r) : _p(t)
|
|
11314
11321
|
};
|
|
11315
11322
|
}
|
|
11316
|
-
function
|
|
11317
|
-
let c = x("end"), l = K((e) => e.selected), u = K((e) => e.setSelected), d = K((e) => e.addSelected), f = K((e) => e.removeSelected), p = K((e) => e.showStats), m = K((e) => e.preselectionEnabled), h =
|
|
11323
|
+
function Sp(e, t, n, r, i, a, o, s = 0) {
|
|
11324
|
+
let c = x("end"), l = K((e) => e.selected), u = K((e) => e.setSelected), d = K((e) => e.addSelected), f = K((e) => e.removeSelected), p = K((e) => e.showStats), m = K((e) => e.preselectionEnabled), h = mp(m), g = Tt(), v = x(null), y = x(null), b = x(!1), S = x(!1), C = x("add"), w = x(null), T = x(!1), E = x(0), D = x(null), k = x(null), ee = x(null), A = x(m), j = x({
|
|
11318
11325
|
meshesByModel: /* @__PURE__ */ new Map(),
|
|
11319
11326
|
root: null,
|
|
11320
11327
|
version: ""
|
|
11321
|
-
}),
|
|
11322
|
-
|
|
11323
|
-
},
|
|
11328
|
+
}), te = () => g.getState().selectionInteractionDisabled, M = () => h.current && (o?.() ?? !0), ne = () => c.current !== "end", re = () => {
|
|
11329
|
+
k.current = null, D.current !== null && (window.clearTimeout(D.current), D.current = null);
|
|
11330
|
+
}, ie = (e) => {
|
|
11324
11331
|
if (r) {
|
|
11325
11332
|
r(e);
|
|
11326
11333
|
return;
|
|
11327
11334
|
}
|
|
11328
11335
|
let n = t.current;
|
|
11329
11336
|
n && (n.cancel(), n.setOrbitPoint(e.x, e.y, e.z));
|
|
11330
|
-
},
|
|
11331
|
-
let t = e.current, n =
|
|
11337
|
+
}, N = () => {
|
|
11338
|
+
let t = e.current, n = yp(t), r = j.current;
|
|
11332
11339
|
if (r.root !== t || r.version !== n) {
|
|
11333
11340
|
let e = /* @__PURE__ */ new Map();
|
|
11334
11341
|
return t?.traverse((t) => {
|
|
11335
11342
|
if (!(t instanceof B) || !t.geometry.index || !t.geometry.attributes.ids) return;
|
|
11336
|
-
let n =
|
|
11343
|
+
let n = _p(t), r = e.get(n) ?? [];
|
|
11337
11344
|
r.push(t), e.set(n, r);
|
|
11338
|
-
}),
|
|
11345
|
+
}), j.current = {
|
|
11339
11346
|
meshesByModel: e,
|
|
11340
11347
|
root: t,
|
|
11341
11348
|
version: n
|
|
11342
|
-
},
|
|
11349
|
+
}, j.current;
|
|
11343
11350
|
}
|
|
11344
11351
|
return r;
|
|
11345
|
-
},
|
|
11352
|
+
}, ae = () => Array.from(N().meshesByModel.values()).flat(), oe = (e) => N().meshesByModel.get(e) ?? [], se = (e) => {
|
|
11346
11353
|
e && oe(e.modelID).forEach((e) => {
|
|
11347
|
-
e.preselected = !1,
|
|
11354
|
+
e.preselected = !1, hp(e.material, -1);
|
|
11348
11355
|
});
|
|
11349
11356
|
}, ce = () => {
|
|
11350
|
-
a?.(null), se(
|
|
11357
|
+
a?.(null), se(ee.current), ee.current = null;
|
|
11351
11358
|
};
|
|
11352
11359
|
_(() => {
|
|
11353
|
-
let e =
|
|
11354
|
-
|
|
11360
|
+
let e = A.current;
|
|
11361
|
+
A.current = m, !(!e || m) && (re(), ce());
|
|
11355
11362
|
}, [m]);
|
|
11356
11363
|
let le = (e, t) => {
|
|
11357
|
-
let n =
|
|
11364
|
+
let n = ee.current;
|
|
11358
11365
|
n?.modelID === e && n.elementID === t || (se(n), a?.({
|
|
11359
11366
|
elementID: t,
|
|
11360
11367
|
modelID: e
|
|
11361
11368
|
}), oe(e).forEach((e) => {
|
|
11362
|
-
e.preselected = !0,
|
|
11363
|
-
}),
|
|
11369
|
+
e.preselected = !0, hp(e.material, t);
|
|
11370
|
+
}), ee.current = {
|
|
11364
11371
|
elementID: t,
|
|
11365
11372
|
modelID: e
|
|
11366
11373
|
});
|
|
11367
11374
|
}, ue = () => {
|
|
11368
|
-
v.current = null, b.current = !1,
|
|
11375
|
+
v.current = null, b.current = !1, dp(y), t.current && (t.current.enabled = !0);
|
|
11369
11376
|
}, P = (e) => {
|
|
11370
|
-
if (
|
|
11371
|
-
|
|
11377
|
+
if (ne()) {
|
|
11378
|
+
re(), ce();
|
|
11372
11379
|
return;
|
|
11373
11380
|
}
|
|
11374
|
-
if (!
|
|
11381
|
+
if (!M()) {
|
|
11375
11382
|
ce();
|
|
11376
11383
|
return;
|
|
11377
11384
|
}
|
|
11378
|
-
if (
|
|
11385
|
+
if (te()) {
|
|
11379
11386
|
ce();
|
|
11380
11387
|
return;
|
|
11381
11388
|
}
|
|
@@ -11394,24 +11401,24 @@ function xp(e, t, n, r, i, a, o, s = 0) {
|
|
|
11394
11401
|
return performance.now();
|
|
11395
11402
|
}
|
|
11396
11403
|
let F = (e) => {
|
|
11397
|
-
if (
|
|
11398
|
-
|
|
11404
|
+
if (ne()) {
|
|
11405
|
+
re(), ce();
|
|
11399
11406
|
return;
|
|
11400
11407
|
}
|
|
11401
|
-
if (!
|
|
11402
|
-
|
|
11408
|
+
if (!M()) {
|
|
11409
|
+
re(), ce();
|
|
11403
11410
|
return;
|
|
11404
11411
|
}
|
|
11405
|
-
if (
|
|
11406
|
-
|
|
11412
|
+
if (te()) {
|
|
11413
|
+
re(), ce();
|
|
11407
11414
|
return;
|
|
11408
11415
|
}
|
|
11409
|
-
if (
|
|
11410
|
-
let t = de() -
|
|
11411
|
-
|
|
11412
|
-
|
|
11413
|
-
let e =
|
|
11414
|
-
|
|
11416
|
+
if (k.current = e, D.current !== null) return;
|
|
11417
|
+
let t = de() - E.current, n = Math.max(0, fp - t);
|
|
11418
|
+
D.current = window.setTimeout(() => {
|
|
11419
|
+
D.current = null;
|
|
11420
|
+
let e = k.current;
|
|
11421
|
+
k.current = null, e && (E.current = performance.now(), P(e));
|
|
11415
11422
|
}, n);
|
|
11416
11423
|
}, I = x(null);
|
|
11417
11424
|
_(() => {
|
|
@@ -11422,7 +11429,7 @@ function xp(e, t, n, r, i, a, o, s = 0) {
|
|
|
11422
11429
|
}
|
|
11423
11430
|
p && I.current !== null && (console.log("selection spend:", Date.now() - I.current, "ms"), I.current = null);
|
|
11424
11431
|
}, [l, p]);
|
|
11425
|
-
let { camera: fe, gl: L } =
|
|
11432
|
+
let { camera: fe, gl: L } = O();
|
|
11426
11433
|
function pe() {
|
|
11427
11434
|
return Date.now();
|
|
11428
11435
|
}
|
|
@@ -11430,12 +11437,12 @@ function xp(e, t, n, r, i, a, o, s = 0) {
|
|
|
11430
11437
|
let t = L.domElement.getBoundingClientRect();
|
|
11431
11438
|
return e.clientX >= t.left && e.clientX <= t.right && e.clientY >= t.top && e.clientY <= t.bottom;
|
|
11432
11439
|
}, he = (t) => {
|
|
11433
|
-
if (
|
|
11434
|
-
|
|
11440
|
+
if (te()) {
|
|
11441
|
+
T.current = !1, S.current = !1, ce();
|
|
11435
11442
|
return;
|
|
11436
11443
|
}
|
|
11437
|
-
if (!
|
|
11438
|
-
if (
|
|
11444
|
+
if (!T.current) return;
|
|
11445
|
+
if (T.current = !1, S.current) {
|
|
11439
11446
|
S.current = !1;
|
|
11440
11447
|
return;
|
|
11441
11448
|
}
|
|
@@ -11444,38 +11451,38 @@ function xp(e, t, n, r, i, a, o, s = 0) {
|
|
|
11444
11451
|
c.current = "end";
|
|
11445
11452
|
return;
|
|
11446
11453
|
}
|
|
11447
|
-
let n = t.shiftKey, r = t.ctrlKey, i = xe(t), a, o =
|
|
11454
|
+
let n = t.shiftKey, r = t.ctrlKey, i = xe(t), a, o = gp(e), s = null;
|
|
11448
11455
|
if (i && (o = i.modelID, s = i.hit.point, a = i.elementID), r) {
|
|
11449
11456
|
a !== void 0 && f(o, [a]);
|
|
11450
11457
|
return;
|
|
11451
11458
|
} else if (n) {
|
|
11452
|
-
a !== void 0 && (l[o]?.has(a) ?? !1 ? f(o, [a]) : (d(o, [a]), s &&
|
|
11459
|
+
a !== void 0 && (l[o]?.has(a) ?? !1 ? f(o, [a]) : (d(o, [a]), s && ie(s)));
|
|
11453
11460
|
return;
|
|
11454
11461
|
}
|
|
11455
|
-
u(o, a === void 0 ? [] : [a], !0), s &&
|
|
11462
|
+
u(o, a === void 0 ? [] : [a], !0), s && ie(s);
|
|
11456
11463
|
}, ge = (e) => {
|
|
11457
|
-
|
|
11464
|
+
te() || e.button !== 0 || !e.shiftKey && !e.ctrlKey || (v.current = new U(e.clientX, e.clientY), C.current = e.ctrlKey ? "remove" : "add", b.current = !1, t.current && (t.current.enabled = !1));
|
|
11458
11465
|
}, _e = (e) => {
|
|
11459
|
-
if (
|
|
11466
|
+
if (te()) {
|
|
11460
11467
|
ue();
|
|
11461
11468
|
return;
|
|
11462
11469
|
}
|
|
11463
11470
|
if (!v.current) return;
|
|
11464
11471
|
let t = new U(e.clientX, e.clientY), n = Math.abs(t.x - v.current.x), r = Math.abs(t.y - v.current.y);
|
|
11465
|
-
n < 6 && r < 6 || (b.current ||= !0, e.preventDefault(),
|
|
11472
|
+
n < 6 && r < 6 || (b.current ||= !0, e.preventDefault(), up(y, v.current, t));
|
|
11466
11473
|
}, ve = (r) => {
|
|
11467
|
-
if (
|
|
11474
|
+
if (te()) {
|
|
11468
11475
|
ue();
|
|
11469
11476
|
return;
|
|
11470
11477
|
}
|
|
11471
11478
|
if (!v.current) return;
|
|
11472
11479
|
I.current = pe();
|
|
11473
|
-
let i = b.current, a = new U(r.clientX, r.clientY), o =
|
|
11474
|
-
if (v.current = null, b.current = !1,
|
|
11480
|
+
let i = b.current, a = new U(r.clientX, r.clientY), o = Uf(v.current, a), s = Wf(v.current, a);
|
|
11481
|
+
if (v.current = null, b.current = !1, dp(y), t.current && setTimeout(() => {
|
|
11475
11482
|
t.current && (t.current.enabled = !0);
|
|
11476
11483
|
}, 100), !i) return;
|
|
11477
11484
|
S.current = !0, r.preventDefault();
|
|
11478
|
-
let { ids: c, profile: l } =
|
|
11485
|
+
let { ids: c, profile: l } = cp({
|
|
11479
11486
|
model: e.current,
|
|
11480
11487
|
camera: fe,
|
|
11481
11488
|
clippingPlanes: n.getActiveClippingPlanes(),
|
|
@@ -11495,7 +11502,7 @@ function xp(e, t, n, r, i, a, o, s = 0) {
|
|
|
11495
11502
|
let i = Array.isArray(t) ? t.filter((e) => e.visible) : t ? [t] : [];
|
|
11496
11503
|
return i.length ? n.getIntersection(!1, {
|
|
11497
11504
|
event: e,
|
|
11498
|
-
filter:
|
|
11505
|
+
filter: bp,
|
|
11499
11506
|
firstHitOnly: r,
|
|
11500
11507
|
object: i,
|
|
11501
11508
|
recursive: !0
|
|
@@ -11503,11 +11510,11 @@ function xp(e, t, n, r, i, a, o, s = 0) {
|
|
|
11503
11510
|
}, ye = () => i?.().filter((e) => e.visible) ?? [], be = (e, t) => {
|
|
11504
11511
|
let n = R(e, t, !0);
|
|
11505
11512
|
for (let e of n) {
|
|
11506
|
-
let t =
|
|
11513
|
+
let t = xp(e);
|
|
11507
11514
|
if (t) return t;
|
|
11508
11515
|
}
|
|
11509
11516
|
return null;
|
|
11510
|
-
}, xe = (e) => be(e, ye()) || be(e,
|
|
11517
|
+
}, xe = (e) => be(e, ye()) || be(e, ae()), z = mp({
|
|
11511
11518
|
clearPreselection: ce,
|
|
11512
11519
|
onBoxPointerDown: ge,
|
|
11513
11520
|
onBoxPointerMove: _e,
|
|
@@ -11522,10 +11529,10 @@ function xp(e, t, n, r, i, a, o, s = 0) {
|
|
|
11522
11529
|
typeof c.current == "number" ? c.current += 1 : c.current === "start" && (c.current = 1);
|
|
11523
11530
|
}
|
|
11524
11531
|
function d() {
|
|
11525
|
-
c.current = "start",
|
|
11532
|
+
c.current = "start", re(), ce();
|
|
11526
11533
|
}
|
|
11527
11534
|
function f(e) {
|
|
11528
|
-
|
|
11535
|
+
T.current = e.button === 0 || e.ctrlKey, d();
|
|
11529
11536
|
}
|
|
11530
11537
|
function p() {
|
|
11531
11538
|
d();
|
|
@@ -11539,7 +11546,7 @@ function xp(e, t, n, r, i, a, o, s = 0) {
|
|
|
11539
11546
|
e.ctrlKey && e.preventDefault();
|
|
11540
11547
|
}
|
|
11541
11548
|
return () => {
|
|
11542
|
-
|
|
11549
|
+
dp(y), D.current !== null && (window.clearTimeout(D.current), D.current = null), k.current = null, z.current.clearPreselection(), e?.removeEventListener("controlstart", p), e?.removeEventListener("update", u), n.removeEventListener("pointerdown", r), n.removeEventListener("pointermove", i), window.removeEventListener("pointerup", a), window.removeEventListener("pointerup", o), n.removeEventListener("contextmenu", g), n.removeEventListener("pointerup", h), n.removeEventListener("pointerdown", f), m && (n.removeEventListener("pointermove", s), n.removeEventListener("pointerleave", l));
|
|
11543
11550
|
};
|
|
11544
11551
|
}, [
|
|
11545
11552
|
t,
|
|
@@ -11551,30 +11558,30 @@ function xp(e, t, n, r, i, a, o, s = 0) {
|
|
|
11551
11558
|
}
|
|
11552
11559
|
//#endregion
|
|
11553
11560
|
//#region src/viewer/Camera/useCameraFit.tsx
|
|
11554
|
-
var
|
|
11555
|
-
function
|
|
11556
|
-
let n = e.top === e.bottom ? 1 : Math.abs((e.right - e.left) / (e.top - e.bottom)), r = Math.max(
|
|
11561
|
+
var Cp = new W(1, 1, 1).normalize(), wp = 1.18, Tp = .001, Ep = .001, Dp = 4, Op = 1.45;
|
|
11562
|
+
function kp(e, t) {
|
|
11563
|
+
let n = e.top === e.bottom ? 1 : Math.abs((e.right - e.left) / (e.top - e.bottom)), r = Math.max(Ep, t) * Math.max(e.zoom, 1e-4), i = r * n;
|
|
11557
11564
|
e.left = -i / 2, e.right = i / 2, e.top = r / 2, e.bottom = -r / 2;
|
|
11558
11565
|
}
|
|
11559
|
-
function
|
|
11566
|
+
function Ap(e, t) {
|
|
11560
11567
|
let n = xe.degToRad(e.fov), r = 2 * Math.atan(Math.tan(n / 2) * e.aspect);
|
|
11561
|
-
return t / Math.sin(Math.min(n, r) / 2) *
|
|
11568
|
+
return t / Math.sin(Math.min(n, r) / 2) * wp;
|
|
11562
11569
|
}
|
|
11563
|
-
function
|
|
11564
|
-
let { camera: e } =
|
|
11570
|
+
function jp() {
|
|
11571
|
+
let { camera: e } = O();
|
|
11565
11572
|
return h((t, n, r) => {
|
|
11566
11573
|
if (!t.current || !(e instanceof Ae) && !(e instanceof ke)) return;
|
|
11567
|
-
let i = new
|
|
11574
|
+
let i = new j().setFromObject(t.current);
|
|
11568
11575
|
if (i.isEmpty()) return;
|
|
11569
|
-
let a = i.getCenter(new W()), o = i.getBoundingSphere(new Ue()), s = n.current, c = e instanceof Ae ?
|
|
11576
|
+
let a = i.getCenter(new W()), o = i.getBoundingSphere(new Ue()), s = n.current, c = e instanceof Ae ? Ap(e, o.radius) : Math.max(o.radius * Dp, Tp);
|
|
11570
11577
|
e.up.set(0, 1, 0);
|
|
11571
|
-
let l = a.clone().addScaledVector(
|
|
11572
|
-
s ? (s.cancel(), s.updateCameraUp(), s.setFocalOffset(0, 0, 0, !1), s.setLookAt(l.x, l.y, l.z, a.x, a.y, a.z, !1), e instanceof ke && s.fitToSphere(new Ue(a, o.radius *
|
|
11578
|
+
let l = a.clone().addScaledVector(Cp, c);
|
|
11579
|
+
s ? (s.cancel(), s.updateCameraUp(), s.setFocalOffset(0, 0, 0, !1), s.setLookAt(l.x, l.y, l.z, a.x, a.y, a.z, !1), e instanceof ke && s.fitToSphere(new Ue(a, o.radius * Op), !1), s.update(0), e.updateMatrixWorld(!0)) : (e.position.copy(l), e.lookAt(a)), e instanceof ke && (s || (e.zoom = 1, kp(e, o.radius * 2 * Op))), e.updateProjectionMatrix(), e.updateMatrixWorld(!0), r.current && (r.current.position.copy(a).addScaledVector(Cp, c * .8), r.current.lookAt(a));
|
|
11573
11580
|
}, [e]);
|
|
11574
11581
|
}
|
|
11575
11582
|
//#endregion
|
|
11576
11583
|
//#region src/viewer/Camera/FirstPersonControls.tsx
|
|
11577
|
-
var
|
|
11584
|
+
var Mp = 1, Np = .004, Pp = -Math.PI / 2 + .01, Fp = Math.PI / 2 - .01, Ip = .24, Lp = 4, Rp = 1e4, zp = .5, Bp = .01, Vp = 1.5, Hp = 1500, Up = 3, Wp = new Set([
|
|
11578
11585
|
"KeyW",
|
|
11579
11586
|
"KeyA",
|
|
11580
11587
|
"KeyS",
|
|
@@ -11583,62 +11590,62 @@ var jp = 1, Mp = .004, Np = -Math.PI / 2 + .01, Pp = Math.PI / 2 - .01, Fp = .24
|
|
|
11583
11590
|
"ShiftRight",
|
|
11584
11591
|
"ControlLeft",
|
|
11585
11592
|
"ControlRight"
|
|
11586
|
-
]),
|
|
11587
|
-
function
|
|
11593
|
+
]), Gp = new Set(["AltLeft", "AltRight"]), Kp = new W(), qp = new W(), Jp = new W(), Yp = new W(), Xp = new W(0, -1, 0);
|
|
11594
|
+
function Zp(e, t) {
|
|
11588
11595
|
return typeof e == "number" && Number.isFinite(e) ? e : t;
|
|
11589
11596
|
}
|
|
11590
|
-
function
|
|
11597
|
+
function Qp(e, t, n) {
|
|
11591
11598
|
return Math.min(n, Math.max(t, e));
|
|
11592
11599
|
}
|
|
11593
|
-
function
|
|
11594
|
-
return Zp(
|
|
11600
|
+
function $p(e, t, n, r) {
|
|
11601
|
+
return Qp(Zp(e, t), n, r);
|
|
11595
11602
|
}
|
|
11596
|
-
function
|
|
11603
|
+
function em(e) {
|
|
11597
11604
|
if (!(e instanceof HTMLElement)) return !1;
|
|
11598
11605
|
let t = e.tagName.toLowerCase();
|
|
11599
11606
|
return e.isContentEditable || t === "input" || t === "textarea" || t === "select";
|
|
11600
11607
|
}
|
|
11601
|
-
function
|
|
11608
|
+
function tm(e) {
|
|
11602
11609
|
if (!e) return {
|
|
11603
|
-
eyeHeight:
|
|
11604
|
-
groundMaxDistance:
|
|
11605
|
-
moveSpeed:
|
|
11610
|
+
eyeHeight: Vp,
|
|
11611
|
+
groundMaxDistance: Vp * Up,
|
|
11612
|
+
moveSpeed: Lp
|
|
11606
11613
|
};
|
|
11607
|
-
let t = new
|
|
11614
|
+
let t = new j().setFromObject(e);
|
|
11608
11615
|
if (t.isEmpty()) return {
|
|
11609
|
-
eyeHeight:
|
|
11610
|
-
groundMaxDistance:
|
|
11611
|
-
moveSpeed:
|
|
11616
|
+
eyeHeight: Vp,
|
|
11617
|
+
groundMaxDistance: Vp * Up,
|
|
11618
|
+
moveSpeed: Lp
|
|
11612
11619
|
};
|
|
11613
|
-
let n = t.getBoundingSphere(new Ue()).radius, r = Math.min(
|
|
11620
|
+
let n = t.getBoundingSphere(new Ue()).radius, r = Math.min(Hp, Math.max(Vp, n * Bp));
|
|
11614
11621
|
return {
|
|
11615
11622
|
eyeHeight: r,
|
|
11616
|
-
groundMaxDistance: r *
|
|
11617
|
-
moveSpeed: Math.min(
|
|
11623
|
+
groundMaxDistance: r * Up,
|
|
11624
|
+
moveSpeed: Math.min(Rp, Math.max(Lp, n * Ip))
|
|
11618
11625
|
};
|
|
11619
11626
|
}
|
|
11620
|
-
function
|
|
11621
|
-
let n =
|
|
11627
|
+
function nm(e, t) {
|
|
11628
|
+
let n = tm(e), r = $p(t.eyeHeight, n.eyeHeight, .01, Hp), i = $p(t.groundSnapDistanceRatio, Up, .1, 100);
|
|
11622
11629
|
return {
|
|
11623
11630
|
eyeHeight: r,
|
|
11624
|
-
groundCheckInterval: Math.round(
|
|
11631
|
+
groundCheckInterval: Math.round($p(t.groundCheckInterval, Mp, 1, 120)),
|
|
11625
11632
|
groundMaxDistance: r * i,
|
|
11626
|
-
lookSensitivity:
|
|
11627
|
-
moveSpeed:
|
|
11633
|
+
lookSensitivity: $p(t.lookSensitivity, Np, 1e-4, .1),
|
|
11634
|
+
moveSpeed: $p(t.speed, n.moveSpeed, .01, Rp)
|
|
11628
11635
|
};
|
|
11629
11636
|
}
|
|
11630
|
-
function nm(e) {
|
|
11631
|
-
return e.getWorldDirection(Gp), Gp.y = 0, Gp.lengthSq() === 0 && Gp.set(0, 0, -1), Gp.normalize();
|
|
11632
|
-
}
|
|
11633
11637
|
function rm(e) {
|
|
11634
|
-
return
|
|
11638
|
+
return e.getWorldDirection(Kp), Kp.y = 0, Kp.lengthSq() === 0 && Kp.set(0, 0, -1), Kp.normalize();
|
|
11635
11639
|
}
|
|
11636
|
-
|
|
11637
|
-
|
|
11640
|
+
function im(e) {
|
|
11641
|
+
return qp.copy(e).cross(am).normalize(), qp.lengthSq() === 0 && qp.set(1, 0, 0), qp;
|
|
11642
|
+
}
|
|
11643
|
+
var am = new W(0, 1, 0);
|
|
11644
|
+
function om(e, t) {
|
|
11638
11645
|
let n = t.current;
|
|
11639
|
-
n && (e.getWorldDirection(
|
|
11646
|
+
n && (e.getWorldDirection(Yp), Yp.add(e.position), n.enabled = !0, n.cancel(), n.updateCameraUp(), n.setLookAt(e.position.x, e.position.y, e.position.z, Yp.x, Yp.y, Yp.z, !1), n.stop(), n.update(0));
|
|
11640
11647
|
}
|
|
11641
|
-
function
|
|
11648
|
+
function sm(e) {
|
|
11642
11649
|
return e.find((e) => {
|
|
11643
11650
|
let t = e.object;
|
|
11644
11651
|
for (; t;) {
|
|
@@ -11648,42 +11655,42 @@ function om(e) {
|
|
|
11648
11655
|
return !0;
|
|
11649
11656
|
});
|
|
11650
11657
|
}
|
|
11651
|
-
function
|
|
11652
|
-
let n = rm(
|
|
11653
|
-
return
|
|
11658
|
+
function cm(e, t) {
|
|
11659
|
+
let n = im(rm(e));
|
|
11660
|
+
return Jp.set(0, 0, 0), t.has("KeyW") && (e.getWorldDirection(Kp), Jp.add(Kp)), t.has("KeyS") && (e.getWorldDirection(Kp), Jp.sub(Kp)), t.has("KeyD") && Jp.add(n), t.has("KeyA") && Jp.sub(n), (t.has("ShiftLeft") || t.has("ShiftRight")) && Jp.add(am), (t.has("ControlLeft") || t.has("ControlRight")) && Jp.sub(am), Jp;
|
|
11654
11661
|
}
|
|
11655
|
-
function
|
|
11662
|
+
function lm(e) {
|
|
11656
11663
|
return e.has("ShiftLeft") || e.has("ShiftRight") || e.has("ControlLeft") || e.has("ControlRight");
|
|
11657
11664
|
}
|
|
11658
|
-
function
|
|
11659
|
-
let a =
|
|
11665
|
+
function um({ active: e, activeRef: t, controlRef: n, modelRef: r, settings: i }) {
|
|
11666
|
+
let a = O((e) => e.camera), o = O((e) => e.gl), s = O((e) => e.invalidate), c = Tt(), l = x(null), u = x(/* @__PURE__ */ new Set()), d = x(Vp), f = x(0), p = x(Vp * Up), m = x(Mp), h = x(Np), g = x(!1), v = x(!1), y = x(Lp), S = x({
|
|
11660
11667
|
pitch: 0,
|
|
11661
11668
|
yaw: 0
|
|
11662
11669
|
}), C = x(null), w = b(() => new Ie(), []);
|
|
11663
11670
|
return _(() => {
|
|
11664
11671
|
t.current = e;
|
|
11665
11672
|
}, [e, t]), _(() => {
|
|
11666
|
-
let e =
|
|
11673
|
+
let e = nm(r.current, i);
|
|
11667
11674
|
d.current = e.eyeHeight, m.current = e.groundCheckInterval, p.current = e.groundMaxDistance, h.current = e.lookSensitivity, y.current = e.moveSpeed;
|
|
11668
11675
|
}, [r, i]), _(() => {
|
|
11669
11676
|
let e = o.domElement, i = e.style.outline, c = e.style.userSelect;
|
|
11670
11677
|
e.tabIndex = Math.max(e.tabIndex, 0), e.style.outline = "none", e.style.userSelect = "none";
|
|
11671
11678
|
let _ = (e, t) => {
|
|
11672
11679
|
let n = S.current, r = h.current;
|
|
11673
|
-
n.yaw -= e * r, n.pitch -= t * r, n.pitch = Math.max(
|
|
11680
|
+
n.yaw -= e * r, n.pitch -= t * r, n.pitch = Math.max(Pp, Math.min(Fp, n.pitch)), a.quaternion.setFromEuler(new P(n.pitch, n.yaw, 0, "YXZ")), a.updateMatrixWorld(), s();
|
|
11674
11681
|
}, b = () => {
|
|
11675
11682
|
l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
|
|
11676
11683
|
}, x = (e) => {
|
|
11677
11684
|
if (!t.current) return;
|
|
11678
11685
|
n.current?.cancel(), n.current && (n.current.enabled = !1);
|
|
11679
|
-
let i =
|
|
11686
|
+
let i = cm(a, u.current);
|
|
11680
11687
|
if (i.lengthSq() === 0) return;
|
|
11681
|
-
let o = v.current ?
|
|
11682
|
-
if (i.normalize().multiplyScalar(y.current * o * e), a.position.add(i), f.current += 1, v.current && !
|
|
11688
|
+
let o = v.current ? zp : 1;
|
|
11689
|
+
if (i.normalize().multiplyScalar(y.current * o * e), a.position.add(i), f.current += 1, v.current && !lm(u.current) && f.current % m.current === 0) {
|
|
11683
11690
|
let e = w, t = e.firstHitOnly;
|
|
11684
|
-
e.firstHitOnly = !0, w.set(a.position,
|
|
11691
|
+
e.firstHitOnly = !0, w.set(a.position, Xp), w.far = p.current;
|
|
11685
11692
|
try {
|
|
11686
|
-
let e =
|
|
11693
|
+
let e = sm(r.current ? w.intersectObject(r.current, !0) : []);
|
|
11687
11694
|
e && (a.position.y = e.point.y + d.current);
|
|
11688
11695
|
} finally {
|
|
11689
11696
|
e.firstHitOnly = t, w.far = Infinity;
|
|
@@ -11698,27 +11705,27 @@ function lm({ active: e, activeRef: t, controlRef: n, modelRef: r, settings: i }
|
|
|
11698
11705
|
let i = Math.min((r - e) / 1e3, .05);
|
|
11699
11706
|
e = r, x(i), s(), l.current = requestAnimationFrame(n);
|
|
11700
11707
|
});
|
|
11701
|
-
}, ee = () => {
|
|
11702
|
-
t.current && (e.focus(), g.current = !0, document.pointerLockElement !== e && e.requestPointerLock?.());
|
|
11703
11708
|
}, T = () => {
|
|
11709
|
+
t.current && (e.focus(), g.current = !0, document.pointerLockElement !== e && e.requestPointerLock?.());
|
|
11710
|
+
}, E = () => {
|
|
11704
11711
|
g.current = !1;
|
|
11705
|
-
}, E = (n) => {
|
|
11706
|
-
t.current && document.pointerLockElement !== e && g.current && (n.preventDefault(), n.stopPropagation(), _(n.movementX, n.movementY));
|
|
11707
11712
|
}, D = (n) => {
|
|
11713
|
+
t.current && document.pointerLockElement !== e && g.current && (n.preventDefault(), n.stopPropagation(), _(n.movementX, n.movementY));
|
|
11714
|
+
}, O = (n) => {
|
|
11708
11715
|
t.current && document.pointerLockElement === e && _(n.movementX, n.movementY);
|
|
11709
|
-
},
|
|
11710
|
-
if (t.current &&
|
|
11711
|
-
if (
|
|
11716
|
+
}, k = (e) => {
|
|
11717
|
+
if (t.current && !em(e.target)) {
|
|
11718
|
+
if (Gp.has(e.code)) {
|
|
11712
11719
|
e.repeat || (v.current = !v.current), e.preventDefault(), e.stopPropagation();
|
|
11713
11720
|
return;
|
|
11714
11721
|
}
|
|
11715
|
-
|
|
11722
|
+
Wp.has(e.code) && (e.preventDefault(), e.stopPropagation(), u.current.add(e.code), C(), s());
|
|
11716
11723
|
}
|
|
11717
|
-
},
|
|
11718
|
-
|
|
11724
|
+
}, ee = (e) => {
|
|
11725
|
+
Wp.has(e.code) && (u.current.delete(e.code), u.current.size || b());
|
|
11719
11726
|
};
|
|
11720
|
-
return e.addEventListener("pointerdown",
|
|
11721
|
-
e.removeEventListener("pointerdown",
|
|
11727
|
+
return e.addEventListener("pointerdown", T, !0), e.addEventListener("pointermove", D, !0), window.addEventListener("pointerup", E, !0), window.addEventListener("mousemove", O), window.addEventListener("keydown", k, !0), window.addEventListener("keyup", ee, !0), () => {
|
|
11728
|
+
e.removeEventListener("pointerdown", T, !0), e.removeEventListener("pointermove", D, !0), window.removeEventListener("pointerup", E, !0), window.removeEventListener("mousemove", O), window.removeEventListener("keydown", k, !0), window.removeEventListener("keyup", ee, !0), b(), e.style.outline = i, e.style.userSelect = c, g.current = !1, u.current.clear(), document.pointerLockElement === e && document.exitPointerLock(), om(a, n), s();
|
|
11722
11729
|
};
|
|
11723
11730
|
}, [
|
|
11724
11731
|
a,
|
|
@@ -11738,14 +11745,14 @@ function lm({ active: e, activeRef: t, controlRef: n, modelRef: r, settings: i }
|
|
|
11738
11745
|
C.current = c.getState().preselectionEnabled, c.getState().setPreselectionEnabled(!1);
|
|
11739
11746
|
let l = n.current;
|
|
11740
11747
|
l && (l.enabled = !1, l.cancel());
|
|
11741
|
-
let f =
|
|
11748
|
+
let f = nm(r.current, i);
|
|
11742
11749
|
d.current = f.eyeHeight, m.current = f.groundCheckInterval, p.current = f.groundMaxDistance, h.current = f.lookSensitivity, y.current = f.moveSpeed;
|
|
11743
11750
|
let g = new P().setFromQuaternion(a.quaternion, "YXZ");
|
|
11744
11751
|
return S.current = {
|
|
11745
11752
|
pitch: g.x,
|
|
11746
11753
|
yaw: g.y
|
|
11747
11754
|
}, () => {
|
|
11748
|
-
u.current.clear(), t(), document.pointerLockElement === o.domElement && document.exitPointerLock(),
|
|
11755
|
+
u.current.clear(), t(), document.pointerLockElement === o.domElement && document.exitPointerLock(), om(a, n), s();
|
|
11749
11756
|
};
|
|
11750
11757
|
}, [
|
|
11751
11758
|
e,
|
|
@@ -11760,8 +11767,8 @@ function lm({ active: e, activeRef: t, controlRef: n, modelRef: r, settings: i }
|
|
|
11760
11767
|
}
|
|
11761
11768
|
//#endregion
|
|
11762
11769
|
//#region src/viewer/ViewerComponents/ViewerScene.tsx
|
|
11763
|
-
var
|
|
11764
|
-
function
|
|
11770
|
+
var dm = .1, fm = .02, pm = 150, mm = 150, hm = 500, gm = 5e6, _m = 50, vm = .001, ym = .001, bm = 1e3, xm = 50, Sm = 30, Cm = 240, wm = 7, Tm = 1.25, Em = .08, Dm = new W(1, 1, 1).normalize(), Om = new j(), km = new Ue(), Am = new W(), jm = new W(), Mm = new W();
|
|
11771
|
+
function Nm(e = !1) {
|
|
11765
11772
|
return {
|
|
11766
11773
|
active: e,
|
|
11767
11774
|
finalFitDone: !1,
|
|
@@ -11769,23 +11776,23 @@ function Mm(e = !1) {
|
|
|
11769
11776
|
userInteractedAfterFirstFit: !1
|
|
11770
11777
|
};
|
|
11771
11778
|
}
|
|
11772
|
-
function
|
|
11779
|
+
function Pm(e) {
|
|
11773
11780
|
let t = [];
|
|
11774
11781
|
return e?.traverse((e) => {
|
|
11775
11782
|
e instanceof B && e.geometry.attributes.ids && t.push(e);
|
|
11776
11783
|
}), t;
|
|
11777
11784
|
}
|
|
11778
|
-
function
|
|
11785
|
+
function Fm(e) {
|
|
11779
11786
|
let t = e.geometry.index?.count;
|
|
11780
11787
|
return t === void 0 ? (e.geometry.attributes.position?.count ?? 0) / 3 : t / 3;
|
|
11781
11788
|
}
|
|
11782
|
-
function Fm(e) {
|
|
11783
|
-
return e.reduce((e, t) => e + Pm(t), 0);
|
|
11784
|
-
}
|
|
11785
11789
|
function Im(e) {
|
|
11786
|
-
return
|
|
11790
|
+
return e.reduce((e, t) => e + Fm(t), 0);
|
|
11791
|
+
}
|
|
11792
|
+
function Lm(e) {
|
|
11793
|
+
return Im(e) > gm;
|
|
11787
11794
|
}
|
|
11788
|
-
function
|
|
11795
|
+
function Rm(e, t) {
|
|
11789
11796
|
if (t <= 0 || !e.length) return [];
|
|
11790
11797
|
let n = [...e];
|
|
11791
11798
|
for (let e = n.length - 1; e > 0 && n.length - e <= t; e--) {
|
|
@@ -11794,10 +11801,10 @@ function Lm(e, t) {
|
|
|
11794
11801
|
}
|
|
11795
11802
|
return n.slice(-t);
|
|
11796
11803
|
}
|
|
11797
|
-
function
|
|
11804
|
+
function zm(e, t) {
|
|
11798
11805
|
if (t <= 0) return null;
|
|
11799
|
-
let n =
|
|
11800
|
-
if (!
|
|
11806
|
+
let n = Pm(e);
|
|
11807
|
+
if (!Lm(n)) return null;
|
|
11801
11808
|
let r = n.filter((e) => e.visible);
|
|
11802
11809
|
if (r.length < 2) return null;
|
|
11803
11810
|
let i = Math.min(r.length, Math.round(r.length * t));
|
|
@@ -11810,88 +11817,88 @@ function Rm(e, t) {
|
|
|
11810
11817
|
}
|
|
11811
11818
|
o.push(e);
|
|
11812
11819
|
});
|
|
11813
|
-
let s = [...
|
|
11814
|
-
return c > 0 && s.push(...
|
|
11820
|
+
let s = [...Rm(o, i)], c = i - s.length;
|
|
11821
|
+
return c > 0 && s.push(...Rm(a, c)), s.length ? {
|
|
11815
11822
|
hiddenMeshes: s,
|
|
11816
11823
|
root: e
|
|
11817
11824
|
} : null;
|
|
11818
11825
|
}
|
|
11819
|
-
function
|
|
11826
|
+
function Bm(e) {
|
|
11820
11827
|
let t = /* @__PURE__ */ new Map(), n = 0;
|
|
11821
11828
|
return e.hiddenMeshes.forEach((e) => {
|
|
11822
11829
|
e.parent && (t.set(e, e.visible), e.visible && (e.userData[dl] = !0, e.visible = !1, n++));
|
|
11823
11830
|
}), n ? t : null;
|
|
11824
11831
|
}
|
|
11825
|
-
function
|
|
11832
|
+
function Vm(e) {
|
|
11826
11833
|
e?.forEach((e, t) => {
|
|
11827
11834
|
delete t.userData[dl], t.visible = e;
|
|
11828
11835
|
});
|
|
11829
11836
|
}
|
|
11830
|
-
function Vm(e) {
|
|
11831
|
-
let t = Um(e);
|
|
11832
|
-
return t ? Math.max(t.radius * dm, um) : um;
|
|
11833
|
-
}
|
|
11834
11837
|
function Hm(e) {
|
|
11838
|
+
let t = Wm(e);
|
|
11839
|
+
return t ? Math.max(t.radius * fm, dm) : dm;
|
|
11840
|
+
}
|
|
11841
|
+
function Um(e) {
|
|
11835
11842
|
if (e.dollyToCursor = !0, e.camera instanceof ke) {
|
|
11836
11843
|
e.mouseButtons.middle = Fs.ACTION.ZOOM, e.mouseButtons.wheel = Fs.ACTION.ZOOM, e.touches.two = Fs.ACTION.TOUCH_ZOOM_TRUCK, e.infinityDolly = !1;
|
|
11837
11844
|
return;
|
|
11838
11845
|
}
|
|
11839
11846
|
e.mouseButtons.middle = Fs.ACTION.DOLLY, e.mouseButtons.wheel = Fs.ACTION.DOLLY, e.touches.two = Fs.ACTION.TOUCH_DOLLY_TRUCK, e.infinityDolly = !0;
|
|
11840
11847
|
}
|
|
11841
|
-
function
|
|
11842
|
-
if (!e || (
|
|
11843
|
-
let t =
|
|
11848
|
+
function Wm(e) {
|
|
11849
|
+
if (!e || (Om.setFromObject(e), Om.isEmpty())) return null;
|
|
11850
|
+
let t = Om.getBoundingSphere(km);
|
|
11844
11851
|
return !Number.isFinite(t.radius) || t.radius <= 0 ? null : t;
|
|
11845
11852
|
}
|
|
11846
|
-
function
|
|
11853
|
+
function Gm(e) {
|
|
11847
11854
|
return e.type === "Group" && typeof e.userData.modelID == "number";
|
|
11848
11855
|
}
|
|
11849
|
-
function
|
|
11850
|
-
return e?.children.filter(
|
|
11856
|
+
function Km(e) {
|
|
11857
|
+
return e?.children.filter(Gm) ?? [];
|
|
11851
11858
|
}
|
|
11852
|
-
function
|
|
11853
|
-
return
|
|
11859
|
+
function qm(e, t) {
|
|
11860
|
+
return Km(e).find((e) => e.userData.modelID === t) ?? null;
|
|
11854
11861
|
}
|
|
11855
|
-
function
|
|
11862
|
+
function Jm(e) {
|
|
11856
11863
|
return e instanceof ke ? "orthographic" : "perspective";
|
|
11857
11864
|
}
|
|
11858
|
-
function
|
|
11865
|
+
function Ym(e) {
|
|
11859
11866
|
return e instanceof Ae || e instanceof ke;
|
|
11860
11867
|
}
|
|
11861
|
-
function
|
|
11868
|
+
function Xm(e) {
|
|
11862
11869
|
return e.height > 0 ? e.width / e.height : 1;
|
|
11863
11870
|
}
|
|
11864
|
-
function
|
|
11865
|
-
return Math.max(
|
|
11871
|
+
function Zm(e) {
|
|
11872
|
+
return Math.max(ym, (e.top - e.bottom) / Math.max(e.zoom, 1e-4));
|
|
11866
11873
|
}
|
|
11867
|
-
function
|
|
11868
|
-
let r = Math.max(
|
|
11874
|
+
function Qm(e, t, n) {
|
|
11875
|
+
let r = Math.max(ym, n) * Math.max(e.zoom, 1e-4), i = r * t;
|
|
11869
11876
|
e.left = -i / 2, e.right = i / 2, e.top = r / 2, e.bottom = -r / 2, e.updateProjectionMatrix();
|
|
11870
11877
|
}
|
|
11871
|
-
function
|
|
11872
|
-
if (e instanceof ke) return
|
|
11878
|
+
function $m(e, t) {
|
|
11879
|
+
if (e instanceof ke) return Zm(e);
|
|
11873
11880
|
if (e instanceof Ae) {
|
|
11874
|
-
let n = Math.max(
|
|
11881
|
+
let n = Math.max(vm, e.position.distanceTo(t));
|
|
11875
11882
|
return 2 * Math.tan(xe.degToRad(e.fov) / 2) * n;
|
|
11876
11883
|
}
|
|
11877
11884
|
return 1;
|
|
11878
11885
|
}
|
|
11879
|
-
function
|
|
11880
|
-
let n =
|
|
11886
|
+
function eh(e, t) {
|
|
11887
|
+
let n = Xm(t);
|
|
11881
11888
|
if (e instanceof Ae) {
|
|
11882
11889
|
e.aspect = n, e.updateProjectionMatrix();
|
|
11883
11890
|
return;
|
|
11884
11891
|
}
|
|
11885
|
-
e instanceof ke &&
|
|
11892
|
+
e instanceof ke && Qm(e, n, Zm(e));
|
|
11886
11893
|
}
|
|
11887
|
-
function
|
|
11888
|
-
let n =
|
|
11894
|
+
function th(e, t) {
|
|
11895
|
+
let n = Wm(t);
|
|
11889
11896
|
if (!n) return;
|
|
11890
|
-
let r = Math.max(
|
|
11897
|
+
let r = Math.max(bm, n.radius * xm, e.near + 1);
|
|
11891
11898
|
Math.abs(e.far - r) < 1 || (e.far = r, e.updateProjectionMatrix());
|
|
11892
11899
|
}
|
|
11893
|
-
function
|
|
11894
|
-
let n = new
|
|
11900
|
+
function nh(e, t) {
|
|
11901
|
+
let n = new j();
|
|
11895
11902
|
return Object.entries(e).forEach(([e, r]) => {
|
|
11896
11903
|
let i = Number(e), a = t.elementBounds.get(i);
|
|
11897
11904
|
a && r.forEach((e) => {
|
|
@@ -11900,35 +11907,35 @@ function th(e, t) {
|
|
|
11900
11907
|
});
|
|
11901
11908
|
}), n.isEmpty() ? null : n;
|
|
11902
11909
|
}
|
|
11903
|
-
function
|
|
11904
|
-
let t = e.getSize(
|
|
11905
|
-
return Number.isFinite(n) && n > 0 ? n *
|
|
11910
|
+
function rh(e) {
|
|
11911
|
+
let t = e.getSize(Mm), n = Math.max(t.x, t.y, t.z);
|
|
11912
|
+
return Number.isFinite(n) && n > 0 ? n * Em : dm;
|
|
11906
11913
|
}
|
|
11907
|
-
function
|
|
11908
|
-
let r = Math.max(
|
|
11909
|
-
return Number.isFinite(i) && i >= r ? e : (
|
|
11914
|
+
function ih(e, t, n) {
|
|
11915
|
+
let r = Math.max(dm, (Number.isFinite(n) ? n : dm) * Tm), i = t.position.distanceTo(e);
|
|
11916
|
+
return Number.isFinite(i) && i >= r ? e : (Am.copy(e).sub(t.position), (!Number.isFinite(Am.x + Am.y + Am.z) || Am.lengthSq() === 0) && t.getWorldDirection(Am), Am.lengthSq() === 0 && Am.set(0, 0, -1), Am.normalize(), jm.copy(t.position).addScaledVector(Am, r));
|
|
11910
11917
|
}
|
|
11911
|
-
function
|
|
11912
|
-
let
|
|
11918
|
+
function ah({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadGeneration: i, lightRef: a, materialMode: o, modelRef: s, modelsData: c, modelsLoading: l, initialPlanPlane: u, createPlanComment: d, createPlanMarkupCloud: f, deleteAllPlanNotes: p, onReady: m, onModelsReady: g, onCameraDprModeChange: v, publicApi: C, invalidatePlanViews: w, setPlanPreselectionHandler: T, setPlanVisualObjectsGetter: E, setSceneApi: D, setPlanNotesModeActive: k, usePerformanceMoving: ee, useWebGPU: A }) {
|
|
11919
|
+
let j = O((e) => e.camera), te = O((e) => e.gl), M = O((e) => e.invalidate), ne = O((e) => e.scene), re = O((e) => e.set), ie = O((e) => e.size), N = Ed(s), ae = Gd(N), { colorPaletteTexture: oe, colorUtils: se } = Ru(N), ce = Tt(), le = K((e) => e.selected), ue = Bs(s), P = wf(s, n, ue, A, w), de = h((e) => {
|
|
11913
11920
|
P.setCapsPreselection(e), w();
|
|
11914
11921
|
}, [P, w]);
|
|
11915
11922
|
_(() => {
|
|
11916
11923
|
w();
|
|
11917
|
-
}, [w, le]), _(() => (
|
|
11918
|
-
de(e),
|
|
11919
|
-
}), () =>
|
|
11924
|
+
}, [w, le]), _(() => (E(() => P.getPlanVisualObjects()), () => E(null)), [P, E]), _(() => (T((e) => {
|
|
11925
|
+
de(e), M();
|
|
11926
|
+
}), () => T(null)), [
|
|
11920
11927
|
P,
|
|
11921
|
-
|
|
11928
|
+
M,
|
|
11922
11929
|
de,
|
|
11923
|
-
|
|
11930
|
+
T
|
|
11924
11931
|
]);
|
|
11925
11932
|
let F = rc(s, n, ue, P.getSelectableObjects, P.getSnapPoints), I = h((e) => {
|
|
11926
11933
|
F.setActive(e), ce.getState().setDimensionsActive(e);
|
|
11927
11934
|
}, [F, ce]), fe = h(() => {
|
|
11928
11935
|
I(!F.getActive());
|
|
11929
11936
|
}, [F, I]), L = Lc(s), pe = h((e) => {
|
|
11930
|
-
L.setNodeModeActive(e),
|
|
11931
|
-
}, [L,
|
|
11937
|
+
L.setNodeModeActive(e), k(e);
|
|
11938
|
+
}, [L, k]), me = h(() => {
|
|
11932
11939
|
pe(!L.getNodeModeActive());
|
|
11933
11940
|
}, [L, pe]), he = b(() => ({
|
|
11934
11941
|
...L,
|
|
@@ -11952,51 +11959,51 @@ function ih({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
11952
11959
|
L,
|
|
11953
11960
|
pe,
|
|
11954
11961
|
me
|
|
11955
|
-
]), ge = b(() => new Qn(), []), _e =
|
|
11962
|
+
]), ge = b(() => new Qn(), []), _e = ae.buildIndex, ve = N.resetIndex, R = se.applyStoredColors, ye = jp(), be = x(null), z = x(null), B = x(null), Se = x(null), Ce = x(null), we = x(null), V = x(Nm()), Te = x([]), Ee = x(/* @__PURE__ */ new Map()), De = x(/* @__PURE__ */ new Set()), Oe = x(l), je = x(null), Me = x(null), Ne = x(null), Pe = x(0), Fe = x(!1), Ie = x(l), Le = x(!1), Re = x(!1), ze = x(i), Be = x(/* @__PURE__ */ new Map()), [Ve, He] = S(0), [Ue, We] = S(0), [Ge, Ke] = S(!0);
|
|
11956
11963
|
_(() => {
|
|
11957
11964
|
let e = new Set(Object.keys(c).map((e) => Number(e)));
|
|
11958
11965
|
De.current.forEach((t) => {
|
|
11959
11966
|
e.has(t) || se.clearModelColors(t);
|
|
11960
11967
|
}), De.current = e;
|
|
11961
11968
|
}, [se, c]);
|
|
11962
|
-
let [
|
|
11963
|
-
ze.current !== i && (ze.current = i, Be.current.clear(), V.current =
|
|
11964
|
-
let
|
|
11969
|
+
let [qe, Je] = S(!1), [Ye, H] = S({}), Xe = x(!1), Ze = K((e) => e.showStats), Qe = K((e) => e.lighting), U = K((e) => e.performanceMovingFactor);
|
|
11970
|
+
ze.current !== i && (ze.current = i, Be.current.clear(), V.current = Nm(), je.current = null);
|
|
11971
|
+
let $e = h((e, t, n) => {
|
|
11965
11972
|
let r = Be.current.get(e) ?? 0;
|
|
11966
11973
|
Be.current.set(e, t), n > 0 && t >= n && r < n && He((e) => e + 1);
|
|
11967
|
-
}, []),
|
|
11974
|
+
}, []), et = h((e) => {
|
|
11968
11975
|
if (s.current = e, !e) return;
|
|
11969
11976
|
let t = e;
|
|
11970
|
-
t.isClippingGroup =
|
|
11971
|
-
}, [s,
|
|
11977
|
+
t.isClippingGroup = A, t.enabled = !1, t.clipIntersection = !1, t.clipShadows = !1, t.clippingPlanes = [];
|
|
11978
|
+
}, [s, A]), rt = h((e) => {
|
|
11972
11979
|
let t = Me.current;
|
|
11973
11980
|
if (!t || e.camera.uuid !== t.cameraUuid) return !1;
|
|
11974
11981
|
Me.current = null, e.cancel(), e.updateCameraUp();
|
|
11975
11982
|
let n = e;
|
|
11976
|
-
return e.zoomTo(t.zoom, !1), e.setFocalOffset(0, 0, 0, !1), e.setLookAt(t.position.x, t.position.y, t.position.z, t.target.x, t.target.y, t.target.z, !1),
|
|
11977
|
-
}, [
|
|
11983
|
+
return e.zoomTo(t.zoom, !1), e.setFocalOffset(0, 0, 0, !1), e.setLookAt(t.position.x, t.position.y, t.position.z, t.target.x, t.target.y, t.target.z, !1), Um(e), e.minDistance = Hm(s.current), e.stop(), e.update(0), n.saveState?.(), M(), !0;
|
|
11984
|
+
}, [M, s]), it = h((e) => {
|
|
11978
11985
|
let t = n;
|
|
11979
|
-
t.current !== e && (t.current = e, e && (e.minDistance =
|
|
11986
|
+
t.current !== e && (t.current = e, e && (e.minDistance = Hm(s.current), Um(e), rt(e)), We((e) => e + 1));
|
|
11980
11987
|
}, [
|
|
11981
11988
|
n,
|
|
11982
11989
|
s,
|
|
11983
|
-
|
|
11984
|
-
]),
|
|
11985
|
-
|
|
11990
|
+
rt
|
|
11991
|
+
]), ot = h((e) => {
|
|
11992
|
+
Xe.current = e, Je(e);
|
|
11986
11993
|
let t = n.current;
|
|
11987
11994
|
t && (t.enabled = !e, e && (t.cancel(), t.stop()));
|
|
11988
|
-
}, [n]),
|
|
11989
|
-
|
|
11995
|
+
}, [n]), ct = h((e) => {
|
|
11996
|
+
H((t) => ({
|
|
11990
11997
|
...t,
|
|
11991
11998
|
...e
|
|
11992
11999
|
}));
|
|
11993
|
-
}, []),
|
|
11994
|
-
z.current !== null && (window.clearTimeout(z.current), z.current = null), B.current !== null && (window.clearTimeout(B.current), B.current = null), Se.current !== null && (window.clearTimeout(Se.current), Se.current = null),
|
|
12000
|
+
}, []), lt = h(() => {
|
|
12001
|
+
z.current !== null && (window.clearTimeout(z.current), z.current = null), B.current !== null && (window.clearTimeout(B.current), B.current = null), Se.current !== null && (window.clearTimeout(Se.current), Se.current = null), Vm(we.current), we.current = null, Ce.current = null, P.setCapsCameraMotionActive(!1), P.setEdgesCameraMotionActive?.(!1), v("sleep"), M();
|
|
11995
12002
|
}, [
|
|
11996
12003
|
P,
|
|
11997
|
-
|
|
12004
|
+
M,
|
|
11998
12005
|
v
|
|
11999
|
-
]),
|
|
12006
|
+
]), ut = h((e) => {
|
|
12000
12007
|
let t = n.current;
|
|
12001
12008
|
if (t) {
|
|
12002
12009
|
if (!e) {
|
|
@@ -12013,109 +12020,109 @@ function ih({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12013
12020
|
touches: { ...t.touches }
|
|
12014
12021
|
}, t.mouseButtons.left = Fs.ACTION.TRUCK, t.mouseButtons.middle = Fs.ACTION.ZOOM, t.mouseButtons.right = Fs.ACTION.TRUCK, t.mouseButtons.wheel = Fs.ACTION.ZOOM, t.touches.one = Fs.ACTION.TOUCH_TRUCK, t.touches.two = Fs.ACTION.TOUCH_ZOOM_TRUCK, t.touches.three = Fs.ACTION.TOUCH_TRUCK, t.dollyToCursor = !0, t.infinityDolly = !1);
|
|
12015
12022
|
}
|
|
12016
|
-
}, [n]),
|
|
12023
|
+
}, [n]), dt = h((e) => {
|
|
12017
12024
|
if (Fe.current = e, e) {
|
|
12018
|
-
|
|
12025
|
+
lt(), ut(!0);
|
|
12019
12026
|
return;
|
|
12020
12027
|
}
|
|
12021
|
-
|
|
12022
|
-
}, [
|
|
12028
|
+
ut(!1);
|
|
12029
|
+
}, [ut, lt]);
|
|
12023
12030
|
_(() => {
|
|
12024
|
-
Fe.current &&
|
|
12025
|
-
}, [Ue,
|
|
12031
|
+
Fe.current && ut(!0);
|
|
12032
|
+
}, [Ue, ut]), _(() => {
|
|
12026
12033
|
s.current && P.updateMaterials();
|
|
12027
12034
|
}, [
|
|
12028
12035
|
P,
|
|
12029
12036
|
s,
|
|
12030
|
-
|
|
12037
|
+
A
|
|
12031
12038
|
]), _(() => {
|
|
12032
|
-
|
|
12039
|
+
eh(j, ie), M();
|
|
12033
12040
|
}, [
|
|
12034
|
-
A,
|
|
12035
12041
|
j,
|
|
12036
|
-
|
|
12037
|
-
|
|
12042
|
+
M,
|
|
12043
|
+
ie.height,
|
|
12044
|
+
ie.width
|
|
12038
12045
|
]), y(() => {
|
|
12039
12046
|
let e = n.current;
|
|
12040
|
-
e &&
|
|
12047
|
+
e && rt(e);
|
|
12041
12048
|
}, [
|
|
12042
|
-
|
|
12049
|
+
j,
|
|
12043
12050
|
n,
|
|
12044
12051
|
Ue,
|
|
12045
|
-
|
|
12052
|
+
rt
|
|
12046
12053
|
]);
|
|
12047
|
-
let
|
|
12054
|
+
let ft = b(() => {
|
|
12048
12055
|
let e = Object.keys(c).sort((e, t) => Number(e) - Number(t));
|
|
12049
12056
|
for (let t of e) {
|
|
12050
|
-
let e =
|
|
12057
|
+
let e = sd(c[Number(t)]);
|
|
12051
12058
|
if (e) return e;
|
|
12052
12059
|
}
|
|
12053
12060
|
return null;
|
|
12054
|
-
}, [c]),
|
|
12055
|
-
Te.current =
|
|
12056
|
-
let e = new Set(
|
|
12061
|
+
}, [c]), pt = b(() => ad(ft ?? void 0), [ft]), mt = b(() => Object.entries(c).map(([e, t]) => [Number(e), t]), [c]), ht = b(() => mt.map(([e]) => e), [mt]), gt = b(() => new Map(mt.map(([e, t]) => [e, Object.keys(t.data).length])), [mt]);
|
|
12062
|
+
Te.current = ht, Ee.current = gt, Oe.current = l, _(() => {
|
|
12063
|
+
let e = new Set(ht);
|
|
12057
12064
|
Be.current.forEach((t, n) => {
|
|
12058
12065
|
e.has(n) || Be.current.delete(n);
|
|
12059
12066
|
});
|
|
12060
|
-
}, [
|
|
12061
|
-
let
|
|
12062
|
-
n.current && (n.current.minDistance =
|
|
12063
|
-
}, [n, s]),
|
|
12067
|
+
}, [ht]);
|
|
12068
|
+
let _t = o !== "performance", vt = h(() => {
|
|
12069
|
+
n.current && (n.current.minDistance = Hm(s.current));
|
|
12070
|
+
}, [n, s]), yt = h((e, t = !1) => {
|
|
12064
12071
|
let r = n.current;
|
|
12065
12072
|
if (!r) return !1;
|
|
12066
|
-
let i = t ?
|
|
12073
|
+
let i = t ? ih(e, j, r.minDistance) : e;
|
|
12067
12074
|
return r.cancel(), r.setOrbitPoint(i.x, i.y, i.z), !0;
|
|
12068
|
-
}, [
|
|
12069
|
-
be.current = e.clone(),
|
|
12070
|
-
}, [
|
|
12075
|
+
}, [j, n]), bt = h((e) => {
|
|
12076
|
+
be.current = e.clone(), yt(e, !0);
|
|
12077
|
+
}, [yt]), xt = h(() => {
|
|
12071
12078
|
be.current = null, ye(s, n, a);
|
|
12072
12079
|
}, [
|
|
12073
12080
|
n,
|
|
12074
12081
|
ye,
|
|
12075
12082
|
a,
|
|
12076
12083
|
s
|
|
12077
|
-
]),
|
|
12078
|
-
if (!
|
|
12079
|
-
if (
|
|
12084
|
+
]), St = h((e) => {
|
|
12085
|
+
if (!Ym(j)) return null;
|
|
12086
|
+
if (Jm(j) === e) return j;
|
|
12080
12087
|
let r = n.current, i = new W(), a = new W();
|
|
12081
|
-
r ? (r.getTarget(i, !0), r.getPosition(a, !0)) : (
|
|
12088
|
+
r ? (r.getTarget(i, !0), r.getPosition(a, !0)) : (j.getWorldDirection(i), a.copy(j.position), i.add(a));
|
|
12082
12089
|
let o = a.clone().sub(i);
|
|
12083
|
-
o.lengthSq() <
|
|
12084
|
-
let s =
|
|
12090
|
+
o.lengthSq() < vm * vm && j.getWorldDirection(o).multiplyScalar(-1), o.lengthSq() < vm * vm && o.copy(Dm), o.normalize();
|
|
12091
|
+
let s = Xm(ie), c = $m(j, i), l = j.near, u = j.far, d = e === "orthographic" ? new ke(-s * c * .5, s * c * .5, c * .5, -c * .5, l, u) : new Ae(_m, s, l, u);
|
|
12085
12092
|
if (d.manual = !0, d instanceof Ae) {
|
|
12086
12093
|
let e = c / (2 * Math.tan(xe.degToRad(d.fov) * .5));
|
|
12087
12094
|
a.copy(i).addScaledVector(o, e);
|
|
12088
12095
|
}
|
|
12089
|
-
return d.position.copy(a), d.up.copy(
|
|
12096
|
+
return d.position.copy(a), d.up.copy(j.up), d.layers.mask = j.layers.mask, d.lookAt(i), d.updateMatrixWorld(!0), eh(d, ie), Me.current = {
|
|
12090
12097
|
cameraUuid: d.uuid,
|
|
12091
12098
|
position: a.clone(),
|
|
12092
12099
|
target: i.clone(),
|
|
12093
12100
|
zoom: d.zoom
|
|
12094
|
-
}, r?.cancel(), je.current = d.uuid, t.current = d,
|
|
12101
|
+
}, r?.cancel(), je.current = d.uuid, t.current = d, re({ camera: d }), M(), d;
|
|
12095
12102
|
}, [
|
|
12096
|
-
|
|
12103
|
+
j,
|
|
12097
12104
|
t,
|
|
12098
12105
|
n,
|
|
12099
|
-
|
|
12106
|
+
M,
|
|
12100
12107
|
s,
|
|
12101
|
-
|
|
12102
|
-
|
|
12103
|
-
|
|
12104
|
-
]),
|
|
12105
|
-
let e =
|
|
12106
|
-
return
|
|
12107
|
-
}, [
|
|
12108
|
-
let i =
|
|
12108
|
+
re,
|
|
12109
|
+
ie.height,
|
|
12110
|
+
ie.width
|
|
12111
|
+
]), Ct = h(() => {
|
|
12112
|
+
let e = Jm(j) === "perspective" ? "orthographic" : "perspective";
|
|
12113
|
+
return St(e), e;
|
|
12114
|
+
}, [j, St]), wt = h((e, t, { createClippingPlane: r = !0 } = {}) => {
|
|
12115
|
+
let i = St("orthographic") ?? (Ym(j) ? j : null);
|
|
12109
12116
|
if (!i) return null;
|
|
12110
12117
|
let a = e.clone().normalize(), o = !1;
|
|
12111
|
-
Pe.current += 1,
|
|
12118
|
+
Pe.current += 1, dt(!0), P.setHelpersActive(!1), r && P.createPlaneFromPointAndNormal(wl(a), a.normal.clone());
|
|
12112
12119
|
let c = Cl({
|
|
12113
12120
|
camera: i,
|
|
12114
12121
|
controls: n.current,
|
|
12115
|
-
invalidate:
|
|
12122
|
+
invalidate: M,
|
|
12116
12123
|
model: s.current,
|
|
12117
12124
|
plane: a,
|
|
12118
|
-
size:
|
|
12125
|
+
size: ie,
|
|
12119
12126
|
viewNormal: t
|
|
12120
12127
|
});
|
|
12121
12128
|
return c ? (Me.current = {
|
|
@@ -12125,76 +12132,76 @@ function ih({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12125
12132
|
zoom: c.zoom
|
|
12126
12133
|
}, je.current = i.uuid, be.current = null, {
|
|
12127
12134
|
dispose: () => {
|
|
12128
|
-
o || (o = !0, Pe.current = Math.max(0, Pe.current - 1), Pe.current ||
|
|
12135
|
+
o || (o = !0, Pe.current = Math.max(0, Pe.current - 1), Pe.current || dt(!1));
|
|
12129
12136
|
},
|
|
12130
12137
|
plane: a.clone()
|
|
12131
|
-
}) : (Pe.current = Math.max(0, Pe.current - 1), Pe.current ||
|
|
12138
|
+
}) : (Pe.current = Math.max(0, Pe.current - 1), Pe.current || dt(!1), null);
|
|
12132
12139
|
}, [
|
|
12133
|
-
|
|
12140
|
+
j,
|
|
12134
12141
|
P,
|
|
12135
12142
|
n,
|
|
12136
|
-
|
|
12143
|
+
M,
|
|
12137
12144
|
s,
|
|
12138
|
-
|
|
12139
|
-
|
|
12140
|
-
|
|
12145
|
+
St,
|
|
12146
|
+
dt,
|
|
12147
|
+
ie
|
|
12141
12148
|
]);
|
|
12142
12149
|
_(() => {
|
|
12143
|
-
if (!u || Re.current || !s.current || !
|
|
12150
|
+
if (!u || Re.current || !s.current || !Ym(j)) return;
|
|
12144
12151
|
let e = u.clone().normalize();
|
|
12145
12152
|
Re.current = !0;
|
|
12146
|
-
let t =
|
|
12147
|
-
t && (
|
|
12153
|
+
let t = St("orthographic") ?? (Ym(j) ? j : null);
|
|
12154
|
+
t && (dt(!0), P.setHelpersActive(!1), P.createPlaneFromPointAndNormal(wl(e), e.normal.clone()), requestAnimationFrame(() => {
|
|
12148
12155
|
Cl({
|
|
12149
12156
|
camera: t,
|
|
12150
12157
|
controls: n.current,
|
|
12151
|
-
invalidate:
|
|
12158
|
+
invalidate: M,
|
|
12152
12159
|
model: s.current,
|
|
12153
12160
|
plane: e,
|
|
12154
|
-
size:
|
|
12161
|
+
size: ie
|
|
12155
12162
|
});
|
|
12156
12163
|
}));
|
|
12157
12164
|
}, [
|
|
12158
|
-
|
|
12165
|
+
j,
|
|
12159
12166
|
P,
|
|
12160
12167
|
n,
|
|
12161
12168
|
u,
|
|
12162
|
-
|
|
12169
|
+
M,
|
|
12163
12170
|
s,
|
|
12164
|
-
|
|
12165
|
-
|
|
12166
|
-
|
|
12171
|
+
St,
|
|
12172
|
+
dt,
|
|
12173
|
+
ie
|
|
12167
12174
|
]);
|
|
12168
|
-
let
|
|
12175
|
+
let Et = h(() => {
|
|
12169
12176
|
if (Oe.current) return !0;
|
|
12170
12177
|
let e = Te.current;
|
|
12171
12178
|
return e.length ? !e.every((e) => {
|
|
12172
12179
|
let t = Ee.current.get(e) ?? 0;
|
|
12173
12180
|
return t <= 0 ? !0 : (Be.current.get(e) ?? 0) >= t;
|
|
12174
12181
|
}) : !1;
|
|
12175
|
-
}, []),
|
|
12182
|
+
}, []), Dt = h((t) => {
|
|
12176
12183
|
if (!t) return !1;
|
|
12177
|
-
let n =
|
|
12178
|
-
if (!e || !r) return n || (V.current =
|
|
12184
|
+
let n = Et();
|
|
12185
|
+
if (!e || !r) return n || (V.current = Nm()), !1;
|
|
12179
12186
|
let i = V.current;
|
|
12180
12187
|
if (n) {
|
|
12181
|
-
i.active || (V.current =
|
|
12188
|
+
i.active || (V.current = Nm(!0));
|
|
12182
12189
|
let e = V.current;
|
|
12183
12190
|
return e.firstFitDone ? !1 : (e.firstFitDone = !0, !0);
|
|
12184
12191
|
}
|
|
12185
|
-
return i.active ? i.finalFitDone ? !1 : i.firstFitDone && i.userInteractedAfterFirstFit ? (V.current =
|
|
12192
|
+
return i.active ? i.finalFitDone ? !1 : i.firstFitDone && i.userInteractedAfterFirstFit ? (V.current = Nm(), !1) : (i.finalFitDone = !0, !0) : !0;
|
|
12186
12193
|
}, [
|
|
12187
12194
|
e,
|
|
12188
12195
|
r,
|
|
12189
|
-
|
|
12190
|
-
]),
|
|
12196
|
+
Et
|
|
12197
|
+
]), Ot = h((e, t = !1) => {
|
|
12191
12198
|
let r = n.current;
|
|
12192
12199
|
if (!r) return;
|
|
12193
|
-
let i =
|
|
12200
|
+
let i = nh(e, N.buildIndex());
|
|
12194
12201
|
if (!i) return;
|
|
12195
12202
|
let a = i.getCenter(new W());
|
|
12196
12203
|
if (be.current = a.clone(), r.cancel(), t) {
|
|
12197
|
-
let e =
|
|
12204
|
+
let e = rh(i);
|
|
12198
12205
|
r.fitToBox(i, !0, {
|
|
12199
12206
|
paddingBottom: e,
|
|
12200
12207
|
paddingLeft: e,
|
|
@@ -12202,16 +12209,16 @@ function ih({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12202
12209
|
paddingTop: e
|
|
12203
12210
|
}).then(() => {
|
|
12204
12211
|
let e = be.current;
|
|
12205
|
-
e &&
|
|
12212
|
+
e && yt(e, !0);
|
|
12206
12213
|
});
|
|
12207
12214
|
return;
|
|
12208
12215
|
}
|
|
12209
|
-
|
|
12216
|
+
yt(a, !0);
|
|
12210
12217
|
}, [
|
|
12211
|
-
|
|
12218
|
+
yt,
|
|
12212
12219
|
n,
|
|
12213
|
-
|
|
12214
|
-
]),
|
|
12220
|
+
N
|
|
12221
|
+
]), kt = b(() => {
|
|
12215
12222
|
let e = (e) => ({
|
|
12216
12223
|
...e,
|
|
12217
12224
|
activeViewRoot: s.current
|
|
@@ -12229,9 +12236,9 @@ function ih({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12229
12236
|
let e = () => {
|
|
12230
12237
|
z.current !== null && (window.clearTimeout(z.current), z.current = null);
|
|
12231
12238
|
}, t = () => {
|
|
12232
|
-
we.current && (
|
|
12239
|
+
we.current && (Vm(we.current), we.current = null, M());
|
|
12233
12240
|
};
|
|
12234
|
-
if (!
|
|
12241
|
+
if (!ee) {
|
|
12235
12242
|
e(), t(), P.setCapsCameraMotionActive(!1), P.setEdgesCameraMotionActive?.(!1), v("sleep");
|
|
12236
12243
|
return;
|
|
12237
12244
|
}
|
|
@@ -12244,7 +12251,7 @@ function ih({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12244
12251
|
return;
|
|
12245
12252
|
}
|
|
12246
12253
|
z.current = null, v("move"), P.setCapsCameraMotionActive(!0), P.setEdgesCameraMotionActive?.(!0);
|
|
12247
|
-
},
|
|
12254
|
+
}, pm));
|
|
12248
12255
|
}, a = () => {
|
|
12249
12256
|
e(), t(), P.setCapsCameraMotionActive(!1), P.setEdgesCameraMotionActive?.(!1), v("sleep");
|
|
12250
12257
|
};
|
|
@@ -12255,22 +12262,22 @@ function ih({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12255
12262
|
P,
|
|
12256
12263
|
n,
|
|
12257
12264
|
Ue,
|
|
12258
|
-
|
|
12265
|
+
M,
|
|
12259
12266
|
v,
|
|
12260
|
-
|
|
12267
|
+
ee
|
|
12261
12268
|
]), _(() => {
|
|
12262
12269
|
let e = () => {
|
|
12263
12270
|
B.current !== null && (window.clearTimeout(B.current), B.current = null);
|
|
12264
12271
|
}, t = () => {
|
|
12265
12272
|
Se.current !== null && (window.clearTimeout(Se.current), Se.current = null);
|
|
12266
12273
|
}, r = (n = !1) => {
|
|
12267
|
-
e(), we.current && (
|
|
12274
|
+
e(), we.current && (Vm(we.current), we.current = null, M()), n && (t(), Ce.current = null);
|
|
12268
12275
|
}, i = () => {
|
|
12269
12276
|
t(), Se.current = window.setTimeout(() => {
|
|
12270
12277
|
Se.current = null, Ce.current = null;
|
|
12271
|
-
},
|
|
12278
|
+
}, hm);
|
|
12272
12279
|
};
|
|
12273
|
-
if (!
|
|
12280
|
+
if (!ee) {
|
|
12274
12281
|
r(!0);
|
|
12275
12282
|
return;
|
|
12276
12283
|
}
|
|
@@ -12278,13 +12285,13 @@ function ih({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12278
12285
|
if (!a) return;
|
|
12279
12286
|
let o = () => {
|
|
12280
12287
|
if (B.current = null, Fe.current || we.current) return;
|
|
12281
|
-
s.current?.updateMatrixWorld(!0), (!Ce.current || Ce.current.root !== s.current) && (Ce.current =
|
|
12288
|
+
s.current?.updateMatrixWorld(!0), (!Ce.current || Ce.current.root !== s.current) && (Ce.current = zm(s.current, U));
|
|
12282
12289
|
let e = Ce.current;
|
|
12283
12290
|
if (!e) return;
|
|
12284
|
-
let t =
|
|
12285
|
-
t && (we.current = t,
|
|
12291
|
+
let t = Bm(e);
|
|
12292
|
+
t && (we.current = t, M());
|
|
12286
12293
|
}, c = () => {
|
|
12287
|
-
Fe.current || (t(), !we.current && B.current === null && (B.current = window.setTimeout(o,
|
|
12294
|
+
Fe.current || (t(), !we.current && B.current === null && (B.current = window.setTimeout(o, mm)));
|
|
12288
12295
|
}, l = () => {
|
|
12289
12296
|
r(), i();
|
|
12290
12297
|
};
|
|
@@ -12294,14 +12301,14 @@ function ih({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12294
12301
|
}, [
|
|
12295
12302
|
n,
|
|
12296
12303
|
Ue,
|
|
12297
|
-
|
|
12304
|
+
M,
|
|
12298
12305
|
s,
|
|
12299
|
-
|
|
12300
|
-
|
|
12306
|
+
U,
|
|
12307
|
+
ee
|
|
12301
12308
|
]), _(() => {
|
|
12302
|
-
l && !Ie.current && (V.current =
|
|
12309
|
+
l && !Ie.current && (V.current = Nm(!0)), Ie.current = l;
|
|
12303
12310
|
}, [l]), _(() => {
|
|
12304
|
-
let e = n.current, t =
|
|
12311
|
+
let e = n.current, t = te.domElement, r = () => {
|
|
12305
12312
|
let e = V.current;
|
|
12306
12313
|
!e.active || !e.firstFitDone || (e.userInteractedAfterFirstFit = !0);
|
|
12307
12314
|
};
|
|
@@ -12311,61 +12318,61 @@ function ih({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12311
12318
|
}, [
|
|
12312
12319
|
n,
|
|
12313
12320
|
Ue,
|
|
12314
|
-
|
|
12321
|
+
te
|
|
12315
12322
|
]);
|
|
12316
|
-
let
|
|
12317
|
-
return
|
|
12318
|
-
let e =
|
|
12323
|
+
let At = h(() => !Et(), [Et]);
|
|
12324
|
+
return Sp(s, n, ue, bt, P.getSelectableObjects, de, At, Ue), Ef(), _(() => {
|
|
12325
|
+
let e = te.domElement, t = (e) => {
|
|
12319
12326
|
let t = be.current;
|
|
12320
|
-
t && e.button === 0 && (e.ctrlKey || e.metaKey || e.shiftKey ||
|
|
12327
|
+
t && e.button === 0 && (e.ctrlKey || e.metaKey || e.shiftKey || yt(t, !0));
|
|
12321
12328
|
};
|
|
12322
12329
|
return e.addEventListener("pointerdown", t, !0), () => {
|
|
12323
12330
|
e.removeEventListener("pointerdown", t, !0);
|
|
12324
12331
|
};
|
|
12325
|
-
}, [
|
|
12332
|
+
}, [yt, te]), _(() => (ue.setClippingSource(P), () => {
|
|
12326
12333
|
ue.setClippingSource(null);
|
|
12327
|
-
}), [ue, P]), _(() => (t.current =
|
|
12328
|
-
t.current ===
|
|
12329
|
-
}), [
|
|
12334
|
+
}), [ue, P]), _(() => (t.current = j, () => {
|
|
12335
|
+
t.current === j && (t.current = null);
|
|
12336
|
+
}), [j, t]), _(() => {
|
|
12330
12337
|
if (!s.current) return;
|
|
12331
12338
|
let t = null, n = null, r = !1, a = (e) => {
|
|
12332
12339
|
t = requestAnimationFrame(e);
|
|
12333
12340
|
}, o = () => {
|
|
12334
|
-
let e =
|
|
12341
|
+
let e = Et();
|
|
12335
12342
|
if (!e) {
|
|
12336
12343
|
let e = V.current;
|
|
12337
12344
|
if (e.active && e.firstFitDone && e.userInteractedAfterFirstFit) {
|
|
12338
|
-
V.current =
|
|
12345
|
+
V.current = Nm();
|
|
12339
12346
|
return;
|
|
12340
12347
|
}
|
|
12341
12348
|
}
|
|
12342
|
-
|
|
12349
|
+
xt(), e || (V.current = Nm());
|
|
12343
12350
|
}, c = () => {
|
|
12344
12351
|
if (e) {
|
|
12345
|
-
if (!
|
|
12352
|
+
if (!A) {
|
|
12346
12353
|
o();
|
|
12347
12354
|
return;
|
|
12348
12355
|
}
|
|
12349
12356
|
a(() => {
|
|
12350
12357
|
r || !s.current || (s.current.updateMatrixWorld(!0), (async () => {
|
|
12351
|
-
let e =
|
|
12358
|
+
let e = te;
|
|
12352
12359
|
if (typeof e.compileAsync == "function") try {
|
|
12353
|
-
await e.compileAsync(
|
|
12360
|
+
await e.compileAsync(ne, j);
|
|
12354
12361
|
} catch {}
|
|
12355
12362
|
r || !s.current || a(() => {
|
|
12356
|
-
r || !s.current || (s.current.updateMatrixWorld(!0), o(),
|
|
12363
|
+
r || !s.current || (s.current.updateMatrixWorld(!0), o(), M());
|
|
12357
12364
|
});
|
|
12358
12365
|
})());
|
|
12359
12366
|
});
|
|
12360
12367
|
}
|
|
12361
12368
|
}, l = () => {
|
|
12362
12369
|
if (n !== null) return;
|
|
12363
|
-
let e =
|
|
12370
|
+
let e = wm, t = () => {
|
|
12364
12371
|
if (r) {
|
|
12365
12372
|
n = null;
|
|
12366
12373
|
return;
|
|
12367
12374
|
}
|
|
12368
|
-
if (!s.current ||
|
|
12375
|
+
if (!s.current || Et()) {
|
|
12369
12376
|
n = null;
|
|
12370
12377
|
return;
|
|
12371
12378
|
}
|
|
@@ -12378,29 +12385,29 @@ function ih({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12378
12385
|
n = requestAnimationFrame(t);
|
|
12379
12386
|
}, u = (e) => {
|
|
12380
12387
|
if (r || !s.current) return;
|
|
12381
|
-
s.current.updateMatrixWorld(!0), (
|
|
12388
|
+
s.current.updateMatrixWorld(!0), (j instanceof Ae || j instanceof ke) && th(j, s.current), vt(), ve();
|
|
12382
12389
|
let n = _e();
|
|
12383
12390
|
if (!n.records.size && e > 0) {
|
|
12384
12391
|
t = requestAnimationFrame(() => u(e - 1));
|
|
12385
12392
|
return;
|
|
12386
12393
|
}
|
|
12387
|
-
R(), P.syncWithModel(), F.syncWithModel(), n.records.size > 0 && !
|
|
12394
|
+
R(), P.syncWithModel(), F.syncWithModel(), n.records.size > 0 && !Et() && l(), je.current !== j.uuid && Dt(n.records.size > 0) && c();
|
|
12388
12395
|
};
|
|
12389
|
-
return a(() => u(
|
|
12396
|
+
return a(() => u(A ? Cm : Sm)), () => {
|
|
12390
12397
|
r = !0, t !== null && cancelAnimationFrame(t), n !== null && cancelAnimationFrame(n);
|
|
12391
12398
|
};
|
|
12392
12399
|
}, [
|
|
12393
12400
|
R,
|
|
12394
12401
|
e,
|
|
12395
12402
|
_e,
|
|
12396
|
-
|
|
12403
|
+
j,
|
|
12397
12404
|
P,
|
|
12398
12405
|
n,
|
|
12399
12406
|
F,
|
|
12400
|
-
|
|
12401
|
-
|
|
12407
|
+
xt,
|
|
12408
|
+
Et,
|
|
12402
12409
|
a,
|
|
12403
|
-
|
|
12410
|
+
te,
|
|
12404
12411
|
s,
|
|
12405
12412
|
c,
|
|
12406
12413
|
l,
|
|
@@ -12408,25 +12415,25 @@ function ih({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12408
12415
|
i,
|
|
12409
12416
|
g,
|
|
12410
12417
|
ve,
|
|
12411
|
-
|
|
12412
|
-
|
|
12413
|
-
|
|
12414
|
-
|
|
12418
|
+
ne,
|
|
12419
|
+
Dt,
|
|
12420
|
+
vt,
|
|
12421
|
+
A
|
|
12415
12422
|
]), _(() => {
|
|
12416
12423
|
let e = () => {
|
|
12417
12424
|
P.getActive() && P.syncWithModel();
|
|
12418
12425
|
}, t = (t) => {
|
|
12419
12426
|
t(), e();
|
|
12420
12427
|
};
|
|
12421
|
-
return
|
|
12428
|
+
return D({
|
|
12422
12429
|
camera: {
|
|
12423
|
-
fitCamera:
|
|
12430
|
+
fitCamera: xt,
|
|
12424
12431
|
getIntersection: ue.getIntersection,
|
|
12425
|
-
getProjection: () =>
|
|
12426
|
-
setFirstPersonControlActive:
|
|
12427
|
-
setFirstPersonControlSettings:
|
|
12428
|
-
setProjection:
|
|
12429
|
-
toggleProjection:
|
|
12432
|
+
getProjection: () => Jm(j),
|
|
12433
|
+
setFirstPersonControlActive: ot,
|
|
12434
|
+
setFirstPersonControlSettings: ct,
|
|
12435
|
+
setProjection: St,
|
|
12436
|
+
toggleProjection: Ct
|
|
12430
12437
|
},
|
|
12431
12438
|
clipping: {
|
|
12432
12439
|
createClippingRectangle: P.createClippingRectangle,
|
|
@@ -12456,7 +12463,7 @@ function ih({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12456
12463
|
rebuildModelByColors: se.rebuildModelByColors,
|
|
12457
12464
|
setColor: se.setColor
|
|
12458
12465
|
},
|
|
12459
|
-
converter:
|
|
12466
|
+
converter: kt,
|
|
12460
12467
|
dimensions: {
|
|
12461
12468
|
cancelDrawing: F.cancelDrawing,
|
|
12462
12469
|
changeAxes: F.changeAxes,
|
|
@@ -12489,61 +12496,63 @@ function ih({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12489
12496
|
},
|
|
12490
12497
|
geometryUtils: {
|
|
12491
12498
|
get indexesState() {
|
|
12492
|
-
return
|
|
12499
|
+
return ae.indexesState;
|
|
12493
12500
|
},
|
|
12494
|
-
getAllIds:
|
|
12495
|
-
getIfcSpacesVisibility:
|
|
12496
|
-
getModelGeometry: (e) =>
|
|
12497
|
-
getModelsGeometry: () =>
|
|
12498
|
-
hideByIds: (e, n) => t(() =>
|
|
12499
|
-
hideSelected: () => t(
|
|
12500
|
-
isolateByIds: (e, n) => t(() =>
|
|
12501
|
-
isolateSelected: () => t(
|
|
12502
|
-
removeByIds: (e, n) => t(() =>
|
|
12503
|
-
resetIsolation: () => t(
|
|
12504
|
-
setIfcSpacesVisibility: (e) => t(() =>
|
|
12505
|
-
showAll: () => t(
|
|
12506
|
-
showByIds: (e, n) => t(() =>
|
|
12507
|
-
toggleIIfcSpacesVisibility: () => t(
|
|
12508
|
-
useTrueNorth: (e
|
|
12501
|
+
getAllIds: ae.getAllIds,
|
|
12502
|
+
getIfcSpacesVisibility: ae.getIfcSpacesVisibility,
|
|
12503
|
+
getModelGeometry: (e) => qm(s.current, e),
|
|
12504
|
+
getModelsGeometry: () => Km(s.current),
|
|
12505
|
+
hideByIds: (e, n) => t(() => ae.hideByIds(e, n)),
|
|
12506
|
+
hideSelected: () => t(ae.hideSelected),
|
|
12507
|
+
isolateByIds: (e, n) => t(() => ae.isolateByIds(e, n)),
|
|
12508
|
+
isolateSelected: () => t(ae.isolateSelected),
|
|
12509
|
+
removeByIds: (e, n) => t(() => ae.removeByIds(e, n)),
|
|
12510
|
+
resetIsolation: () => t(ae.resetIsolation),
|
|
12511
|
+
setIfcSpacesVisibility: (e) => t(() => ae.setIfcSpacesVisibility(e)),
|
|
12512
|
+
showAll: () => t(ae.showAll),
|
|
12513
|
+
showByIds: (e, n) => t(() => ae.showByIds(e, n)),
|
|
12514
|
+
toggleIIfcSpacesVisibility: () => t(ae.toggleIIfcSpacesVisibility),
|
|
12515
|
+
useTrueNorth: (e = !0) => {
|
|
12516
|
+
Ke(e), t(() => ae.useTrueNorth(e));
|
|
12517
|
+
}
|
|
12509
12518
|
},
|
|
12510
|
-
plans: { createPlan:
|
|
12511
|
-
selector: { setTargetToSelection:
|
|
12512
|
-
}), Le.current || (Le.current = !0, m?.(C)), () =>
|
|
12519
|
+
plans: { createPlan: wt },
|
|
12520
|
+
selector: { setTargetToSelection: Ot }
|
|
12521
|
+
}), Le.current || (Le.current = !0, m?.(C)), () => D(null);
|
|
12513
12522
|
}, [
|
|
12514
|
-
|
|
12523
|
+
j,
|
|
12515
12524
|
P,
|
|
12516
12525
|
ue,
|
|
12517
12526
|
se,
|
|
12518
12527
|
n,
|
|
12519
|
-
|
|
12520
|
-
|
|
12528
|
+
kt,
|
|
12529
|
+
wt,
|
|
12521
12530
|
F,
|
|
12522
|
-
|
|
12523
|
-
|
|
12531
|
+
xt,
|
|
12532
|
+
ae,
|
|
12524
12533
|
a,
|
|
12525
12534
|
s,
|
|
12526
12535
|
he,
|
|
12527
12536
|
m,
|
|
12528
12537
|
C,
|
|
12529
|
-
|
|
12538
|
+
St,
|
|
12530
12539
|
I,
|
|
12531
|
-
|
|
12532
|
-
|
|
12533
|
-
|
|
12534
|
-
|
|
12540
|
+
ot,
|
|
12541
|
+
ct,
|
|
12542
|
+
D,
|
|
12543
|
+
Ot,
|
|
12535
12544
|
fe,
|
|
12536
|
-
|
|
12545
|
+
Ct
|
|
12537
12546
|
]), /* @__PURE__ */ nt(tt, { children: [
|
|
12538
|
-
|
|
12539
|
-
ambientColor:
|
|
12540
|
-
ambientIntensity:
|
|
12541
|
-
directionalColor:
|
|
12542
|
-
directionalIntensity:
|
|
12547
|
+
_t && (A ? /* @__PURE__ */ G(Lo, {
|
|
12548
|
+
ambientColor: Qe.ambient.color,
|
|
12549
|
+
ambientIntensity: Qe.ambient.intensity,
|
|
12550
|
+
directionalColor: Qe.directional.color,
|
|
12551
|
+
directionalIntensity: Qe.directional.intensity,
|
|
12543
12552
|
lightRef: a
|
|
12544
12553
|
}) : /* @__PURE__ */ nt(tt, { children: [/* @__PURE__ */ G("ambientLight", {
|
|
12545
|
-
intensity:
|
|
12546
|
-
color:
|
|
12554
|
+
intensity: Qe.ambient.intensity,
|
|
12555
|
+
color: Qe.ambient.color
|
|
12547
12556
|
}), /* @__PURE__ */ G("directionalLight", {
|
|
12548
12557
|
ref: a,
|
|
12549
12558
|
position: [
|
|
@@ -12551,47 +12560,48 @@ function ih({ autoFitCamera: e, cameraRef: t, controlRef: n, fitToView: r, loadG
|
|
|
12551
12560
|
10,
|
|
12552
12561
|
10
|
|
12553
12562
|
],
|
|
12554
|
-
color:
|
|
12555
|
-
intensity:
|
|
12563
|
+
color: Qe.directional.color,
|
|
12564
|
+
intensity: Qe.directional.intensity
|
|
12556
12565
|
})] })),
|
|
12557
|
-
|
|
12566
|
+
Ze && /* @__PURE__ */ G(st, {}),
|
|
12558
12567
|
/* @__PURE__ */ G("group", {
|
|
12559
|
-
ref:
|
|
12560
|
-
children:
|
|
12568
|
+
ref: et,
|
|
12569
|
+
children: mt.map(([e, t]) => /* @__PURE__ */ G(hd, {
|
|
12561
12570
|
colorPaletteTexture: oe,
|
|
12562
|
-
coordinationMatrix:
|
|
12571
|
+
coordinationMatrix: pt,
|
|
12563
12572
|
data: t,
|
|
12564
12573
|
loadGeneration: i,
|
|
12565
12574
|
materialMode: o,
|
|
12566
12575
|
modelID: e,
|
|
12567
|
-
onUploadComplete: (t) =>
|
|
12568
|
-
onUploadProgress: (t, n) =>
|
|
12569
|
-
|
|
12576
|
+
onUploadComplete: (t) => $e(e, t, gt.get(e) ?? t),
|
|
12577
|
+
onUploadProgress: (t, n) => $e(e, t, n),
|
|
12578
|
+
trueNorthEnabled: Ge,
|
|
12579
|
+
useWebGPU: A
|
|
12570
12580
|
}, e))
|
|
12571
12581
|
}),
|
|
12572
12582
|
he.layer,
|
|
12573
|
-
/* @__PURE__ */ G(
|
|
12574
|
-
active:
|
|
12575
|
-
activeRef:
|
|
12583
|
+
/* @__PURE__ */ G(um, {
|
|
12584
|
+
active: qe,
|
|
12585
|
+
activeRef: Xe,
|
|
12576
12586
|
controlRef: n,
|
|
12577
12587
|
modelRef: s,
|
|
12578
|
-
settings:
|
|
12588
|
+
settings: Ye
|
|
12579
12589
|
}),
|
|
12580
|
-
!
|
|
12581
|
-
camera:
|
|
12590
|
+
!qe && /* @__PURE__ */ G(at, {
|
|
12591
|
+
camera: Ym(j) ? j : void 0,
|
|
12582
12592
|
dollyToCursor: !0,
|
|
12583
|
-
infinityDolly:
|
|
12584
|
-
minDistance:
|
|
12585
|
-
ref:
|
|
12593
|
+
infinityDolly: j instanceof Ae,
|
|
12594
|
+
minDistance: dm,
|
|
12595
|
+
ref: it,
|
|
12586
12596
|
draggingSmoothTime: .03,
|
|
12587
12597
|
smoothTime: .05
|
|
12588
|
-
},
|
|
12598
|
+
}, j.uuid)
|
|
12589
12599
|
] });
|
|
12590
12600
|
}
|
|
12591
12601
|
//#endregion
|
|
12592
12602
|
//#region src/viewer/Viewer.tsx
|
|
12593
|
-
var
|
|
12594
|
-
function
|
|
12603
|
+
var oh = .75, sh = .6;
|
|
12604
|
+
function ch(e, t, n) {
|
|
12595
12605
|
let r = e?.[t.modelID] ?? {
|
|
12596
12606
|
coordinationMatrix: t.coordinationMatrix ?? t.geometry.matrix ?? void 0,
|
|
12597
12607
|
data: {},
|
|
@@ -12616,11 +12626,11 @@ function sh(e, t, n) {
|
|
|
12616
12626
|
}
|
|
12617
12627
|
};
|
|
12618
12628
|
}
|
|
12619
|
-
function
|
|
12629
|
+
function lh(e) {
|
|
12620
12630
|
let t = {};
|
|
12621
12631
|
return e.materialMode !== void 0 && (t.materialMode = e.materialMode), e.uploadMode !== void 0 && (t.uploadMode = e.uploadMode), e.useDoubleSideMaterial !== void 0 && (t.useDoubleSideMaterial = e.useDoubleSideMaterial), Object.keys(t).length ? t : void 0;
|
|
12622
12632
|
}
|
|
12623
|
-
function
|
|
12633
|
+
function uh(e, t, n) {
|
|
12624
12634
|
let r = { ...e ?? {} };
|
|
12625
12635
|
return Object.entries(t).forEach(([t, i]) => {
|
|
12626
12636
|
let a = Number(t);
|
|
@@ -12633,33 +12643,33 @@ function lh(e, t, n) {
|
|
|
12633
12643
|
});
|
|
12634
12644
|
}), r;
|
|
12635
12645
|
}
|
|
12636
|
-
function
|
|
12646
|
+
function dh(e, t) {
|
|
12637
12647
|
if (!e || !Object.prototype.hasOwnProperty.call(e, t)) return e;
|
|
12638
12648
|
let n = { ...e };
|
|
12639
12649
|
return delete n[t], Object.keys(n).length ? n : void 0;
|
|
12640
12650
|
}
|
|
12641
|
-
function
|
|
12651
|
+
function fh(e, t) {
|
|
12642
12652
|
return Array.isArray(e) ? [Math.min(e[0], t), Math.min(e[1], t)] : typeof e == "number" ? Math.min(e, t) : t;
|
|
12643
12653
|
}
|
|
12644
|
-
function
|
|
12654
|
+
function ph(e) {
|
|
12645
12655
|
return Array.isArray(e) ? [Math.max(e[0], 2), Math.max(e[1], 2)] : typeof e == "number" ? Math.max(e, 2) : 2;
|
|
12646
12656
|
}
|
|
12647
|
-
function
|
|
12657
|
+
function mh() {
|
|
12648
12658
|
let e = navigator, t = navigator.userAgent.toLowerCase(), n = navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1, r = window.matchMedia?.("(pointer: coarse)").matches ?? !1;
|
|
12649
12659
|
return e.userAgentData?.mobile || n || /android|iphone|ipad|ipod|mobile|tablet/.test(t) || navigator.maxTouchPoints > 1 && r ? "mobile" : "pc";
|
|
12650
12660
|
}
|
|
12651
|
-
function
|
|
12661
|
+
function hh({ autoFitCamera: e = !0, camera: t = {
|
|
12652
12662
|
position: [
|
|
12653
12663
|
10,
|
|
12654
12664
|
10,
|
|
12655
12665
|
10
|
|
12656
12666
|
],
|
|
12657
12667
|
fov: 50
|
|
12658
|
-
}, dpr: n = window.devicePixelRatio, fitToView: r, initialPlanPlane: i = null, modelUrls: a, modelSources: o, modelsData: s, materialMode: c, onReady: l, performanceMode: u = !1, publicApi: f, setModelsApi: p, setPlansContainerFactory: m, setSceneApi: g, showNavCube: v, showStats: y, usePerformanceMoving:
|
|
12659
|
-
let
|
|
12668
|
+
}, dpr: n = window.devicePixelRatio, fitToView: r, initialPlanPlane: i = null, modelUrls: a, modelSources: o, modelsData: s, materialMode: c, onReady: l, performanceMode: u = !1, publicApi: f, setModelsApi: p, setPlansContainerFactory: m, setSceneApi: g, showNavCube: v, showStats: y, usePerformanceMoving: T = !1, useWebGPU: E = !1 }) {
|
|
12669
|
+
let D = x(null), O = x(null), k = x(null), ee = x(null), [A, j] = S(), [te, M] = S(!1), [ne, re] = S(!0), [ie, N] = S(null), ae = x(void 0), oe = x(!1), se = x(null), ce = x(null), le = x({
|
|
12660
12670
|
lastProgress: 0,
|
|
12661
12671
|
requestID: 0
|
|
12662
|
-
}), ue = x(null), P = x(/* @__PURE__ */ new Set()), de = x(0), F = x(/* @__PURE__ */ new Map()), I = x(/* @__PURE__ */ new Set()), fe = x(/* @__PURE__ */ new Set()), L = x(!1), pe = x(null), me = x(null), he = x(/* @__PURE__ */ new Set()), ge = x(/* @__PURE__ */ new Map()), _e = x(!
|
|
12672
|
+
}), ue = x(null), P = x(/* @__PURE__ */ new Set()), de = x(0), F = x(/* @__PURE__ */ new Map()), I = x(/* @__PURE__ */ new Set()), fe = x(/* @__PURE__ */ new Set()), L = x(!1), pe = x(null), me = x(null), he = x(/* @__PURE__ */ new Set()), ge = x(/* @__PURE__ */ new Map()), _e = x(!E), ve = x(/* @__PURE__ */ new Set()), R = Tt(), ye = K((e) => e.setModelNames), be = K((e) => e.setModelProps), xe = K((e) => e.setModelStructure), z = K((e) => e.setShowNavCube), B = K((e) => e.setShowStats), Se = K((e) => e.setUserDevice), Ce = K((e) => e.showNavCube), we = te, V = we ? A ?? s : s ?? A, Te = r ?? ne, Ee = u ? fh(n, 1) : n, De = fh(Ee, u ? sh : oh), Oe = c ?? (u ? "performance" : void 0), [ke, Ae] = S("sleep"), je = ph(Ee), Me = b(() => E ? No({ performanceMode: u }) : u ? Wo : void 0, [u, E]), Ne = u ? Uo : Ho, Pe = h(() => {
|
|
12663
12673
|
I.current.forEach((e) => {
|
|
12664
12674
|
e();
|
|
12665
12675
|
});
|
|
@@ -12686,7 +12696,7 @@ function mh({ autoFitCamera: e = !0, camera: t = {
|
|
|
12686
12696
|
t.setNodeModeActive(e);
|
|
12687
12697
|
});
|
|
12688
12698
|
}, []), Ve = h((e, t, r, i) => {
|
|
12689
|
-
let a =
|
|
12699
|
+
let a = k.current;
|
|
12690
12700
|
if (!a) return null;
|
|
12691
12701
|
F.current.get(t)?.handle.dispose();
|
|
12692
12702
|
let o = C(t), s = (i ? Tl(a, i) : e).clone().normalize(), c = {
|
|
@@ -12714,7 +12724,7 @@ function mh({ autoFitCamera: e = !0, camera: t = {
|
|
|
12714
12724
|
registerNotesApi: Ie,
|
|
12715
12725
|
sourceModel: a,
|
|
12716
12726
|
useLocalClippingVisuals: !!i,
|
|
12717
|
-
useWebGPU:
|
|
12727
|
+
useWebGPU: E,
|
|
12718
12728
|
viewNormal: r
|
|
12719
12729
|
})
|
|
12720
12730
|
})), c;
|
|
@@ -12724,7 +12734,7 @@ function mh({ autoFitCamera: e = !0, camera: t = {
|
|
|
12724
12734
|
u,
|
|
12725
12735
|
Fe,
|
|
12726
12736
|
Ie,
|
|
12727
|
-
|
|
12737
|
+
E,
|
|
12728
12738
|
R
|
|
12729
12739
|
]);
|
|
12730
12740
|
_(() => (m(Ve), () => m(null)), [Ve, m]);
|
|
@@ -12760,14 +12770,14 @@ function mh({ autoFitCamera: e = !0, camera: t = {
|
|
|
12760
12770
|
e.forEach((e) => e());
|
|
12761
12771
|
}), ge.current.clear(), he.current.clear();
|
|
12762
12772
|
}, []), _(() => {
|
|
12763
|
-
|
|
12773
|
+
ae.current = V;
|
|
12764
12774
|
}, [V]), _(() => {
|
|
12765
12775
|
oe.current = we;
|
|
12766
12776
|
}, [we]), _(() => {
|
|
12767
|
-
se.current =
|
|
12768
|
-
}, [
|
|
12769
|
-
_e.current = !
|
|
12770
|
-
}, [
|
|
12777
|
+
se.current = ie;
|
|
12778
|
+
}, [ie]), _(() => {
|
|
12779
|
+
_e.current = !E, E || (ve.current.forEach((e) => e()), ve.current.clear());
|
|
12780
|
+
}, [E]);
|
|
12771
12781
|
let Je = h((e) => {
|
|
12772
12782
|
let t = le.current;
|
|
12773
12783
|
if (de.current !== t.requestID) return;
|
|
@@ -12775,41 +12785,41 @@ function mh({ autoFitCamera: e = !0, camera: t = {
|
|
|
12775
12785
|
...e,
|
|
12776
12786
|
progress: n
|
|
12777
12787
|
};
|
|
12778
|
-
t.lastProgress = r.progress, se.current = r,
|
|
12788
|
+
t.lastProgress = r.progress, se.current = r, N(r), t.onModelProgress?.(r), t.onProgress?.(r);
|
|
12779
12789
|
}, []), Ye = h(() => {
|
|
12780
12790
|
de.current += 1, ge.current.forEach((e) => {
|
|
12781
12791
|
e.forEach((e) => e());
|
|
12782
|
-
}), ge.current.clear(), he.current.clear(),
|
|
12792
|
+
}), ge.current.clear(), he.current.clear(), M(!1), N(null), se.current = null, ce.current = null, le.current = {
|
|
12783
12793
|
lastProgress: 0,
|
|
12784
12794
|
requestID: de.current
|
|
12785
|
-
}, P.current.clear(),
|
|
12795
|
+
}, P.current.clear(), j(void 0), ae.current = void 0, ue.current?.(void 0), R.getState().setSelection({}), R.getState().setModelNames({}), R.getState().setModelProps({}), R.getState().setModelStructure({});
|
|
12786
12796
|
}, [R]), H = h((e, t) => {
|
|
12787
|
-
|
|
12797
|
+
j((n) => {
|
|
12788
12798
|
let r = e(n);
|
|
12789
|
-
return r === n ? n : (
|
|
12799
|
+
return r === n ? n : (ae.current = r, t?.(r), r);
|
|
12790
12800
|
});
|
|
12791
12801
|
}, []), Xe = h((e, t, n) => {
|
|
12792
|
-
H((t) =>
|
|
12802
|
+
H((t) => ch(t, e, n), t);
|
|
12793
12803
|
}, [H]), Ze = h(async (e, t = {}) => {
|
|
12794
|
-
let { clearViewer: n = !1, fitToView: r = !0, onChunk: i, onModelLoadingChange: a, onModelProgress: o, onModelsDataChange: s, onProgress: c, ...l } = t, u = de.current + 1, d =
|
|
12795
|
-
f || de.current !== u || (f = !0,
|
|
12804
|
+
let { clearViewer: n = !1, fitToView: r = !0, onChunk: i, onModelLoadingChange: a, onModelProgress: o, onModelsDataChange: s, onProgress: c, ...l } = t, u = de.current + 1, d = lh(l), f = !1, p = !1, m = () => {
|
|
12805
|
+
f || de.current !== u || (f = !0, M(!1));
|
|
12796
12806
|
}, h = () => {
|
|
12797
12807
|
p || de.current !== u || (p = !0, a?.(!1));
|
|
12798
12808
|
};
|
|
12799
12809
|
de.current = u, ge.current.forEach((e) => {
|
|
12800
12810
|
e.forEach((e) => e());
|
|
12801
|
-
}), ge.current.clear(), he.current.clear(),
|
|
12811
|
+
}), ge.current.clear(), he.current.clear(), N(null), se.current = null, ce.current = null, le.current = {
|
|
12802
12812
|
lastProgress: 0,
|
|
12803
12813
|
onModelProgress: o,
|
|
12804
12814
|
onProgress: c,
|
|
12805
12815
|
requestID: u
|
|
12806
|
-
}, s && (ue.current = s),
|
|
12816
|
+
}, s && (ue.current = s), re(r), M(!0), o?.(null), a?.(!0), R.getState().setSelection({}), n && (P.current.clear(), j({}), s?.({}));
|
|
12807
12817
|
let g = (e) => {
|
|
12808
12818
|
ce.current = e, Je(e);
|
|
12809
12819
|
};
|
|
12810
12820
|
try {
|
|
12811
12821
|
let t = !!l.useWorker;
|
|
12812
|
-
|
|
12822
|
+
E && (!n && !ae.current && (j({}), s?.({})), await Ge());
|
|
12813
12823
|
let r = await bi.loadModel(e, {
|
|
12814
12824
|
...l,
|
|
12815
12825
|
...t ? {
|
|
@@ -12822,7 +12832,7 @@ function mh({ autoFitCamera: e = !0, camera: t = {
|
|
|
12822
12832
|
});
|
|
12823
12833
|
if (de.current !== u) return r;
|
|
12824
12834
|
let a = Object.fromEntries(Object.entries(r).filter(([e]) => !P.current.has(Number(e))));
|
|
12825
|
-
return H((e) => t ?
|
|
12835
|
+
return H((e) => t ? uh(e, a, P.current) : {
|
|
12826
12836
|
...e ?? {},
|
|
12827
12837
|
...a
|
|
12828
12838
|
}, s), m(), Object.keys(a).length > 0 && await qe(u), h(), r;
|
|
@@ -12833,17 +12843,17 @@ function mh({ autoFitCamera: e = !0, camera: t = {
|
|
|
12833
12843
|
Xe,
|
|
12834
12844
|
Je,
|
|
12835
12845
|
H,
|
|
12836
|
-
|
|
12846
|
+
E,
|
|
12837
12847
|
R,
|
|
12838
12848
|
qe,
|
|
12839
12849
|
Ge
|
|
12840
12850
|
]), Qe = h((e) => {
|
|
12841
12851
|
if (!Number.isFinite(e)) return;
|
|
12842
12852
|
P.current.add(e);
|
|
12843
|
-
let t =
|
|
12844
|
-
n !== t && (
|
|
12853
|
+
let t = ae.current, n = dh(t, e);
|
|
12854
|
+
n !== t && (ae.current = n, j(n), ue.current?.(n)), R.getState().removeModelState(e);
|
|
12845
12855
|
}, [R]), U = b(() => ({
|
|
12846
|
-
getData: () =>
|
|
12856
|
+
getData: () => ae.current,
|
|
12847
12857
|
getLoading: () => oe.current,
|
|
12848
12858
|
getProgress: () => se.current,
|
|
12849
12859
|
loadModels: Ze,
|
|
@@ -12855,7 +12865,7 @@ function mh({ autoFitCamera: e = !0, camera: t = {
|
|
|
12855
12865
|
Qe
|
|
12856
12866
|
]);
|
|
12857
12867
|
return _(() => (p(U), () => p(null)), [U, p]), _(() => {
|
|
12858
|
-
Se(
|
|
12868
|
+
Se(mh());
|
|
12859
12869
|
}, [Se]), _(() => {
|
|
12860
12870
|
B(!!y);
|
|
12861
12871
|
}, [B, y]), _(() => {
|
|
@@ -12888,7 +12898,7 @@ function mh({ autoFitCamera: e = !0, camera: t = {
|
|
|
12888
12898
|
style: Bo,
|
|
12889
12899
|
children: [/* @__PURE__ */ nt(w, {
|
|
12890
12900
|
camera: t,
|
|
12891
|
-
dpr:
|
|
12901
|
+
dpr: T && ke === "move" ? De : Ee,
|
|
12892
12902
|
gl: Me,
|
|
12893
12903
|
children: [/* @__PURE__ */ G("color", {
|
|
12894
12904
|
attach: "background",
|
|
@@ -12901,19 +12911,19 @@ function mh({ autoFitCamera: e = !0, camera: t = {
|
|
|
12901
12911
|
children: /* @__PURE__ */ G(Ro, {})
|
|
12902
12912
|
}),
|
|
12903
12913
|
/* @__PURE__ */ G(Io, {
|
|
12904
|
-
active:
|
|
12914
|
+
active: E,
|
|
12905
12915
|
onReady: We
|
|
12906
12916
|
}),
|
|
12907
|
-
/* @__PURE__ */ G(Fo, { active:
|
|
12908
|
-
/* @__PURE__ */ G(
|
|
12917
|
+
/* @__PURE__ */ G(Fo, { active: E }),
|
|
12918
|
+
/* @__PURE__ */ G(ah, {
|
|
12909
12919
|
autoFitCamera: e,
|
|
12910
|
-
cameraRef:
|
|
12911
|
-
controlRef:
|
|
12920
|
+
cameraRef: D,
|
|
12921
|
+
controlRef: O,
|
|
12912
12922
|
fitToView: Te,
|
|
12913
12923
|
loadGeneration: de.current,
|
|
12914
|
-
lightRef:
|
|
12924
|
+
lightRef: ee,
|
|
12915
12925
|
materialMode: Oe,
|
|
12916
|
-
modelRef:
|
|
12926
|
+
modelRef: k,
|
|
12917
12927
|
modelsData: V,
|
|
12918
12928
|
modelsLoading: we,
|
|
12919
12929
|
initialPlanPlane: i,
|
|
@@ -12929,14 +12939,14 @@ function mh({ autoFitCamera: e = !0, camera: t = {
|
|
|
12929
12939
|
setPlanVisualObjectsGetter: He,
|
|
12930
12940
|
setSceneApi: g,
|
|
12931
12941
|
setPlanNotesModeActive: Be,
|
|
12932
|
-
usePerformanceMoving:
|
|
12933
|
-
useWebGPU:
|
|
12942
|
+
usePerformanceMoving: T,
|
|
12943
|
+
useWebGPU: E
|
|
12934
12944
|
}),
|
|
12935
|
-
/* @__PURE__ */ G(Ao, { enabled: !
|
|
12936
|
-
/* @__PURE__ */ G(jo, { enabled:
|
|
12945
|
+
/* @__PURE__ */ G(Ao, { enabled: !E }),
|
|
12946
|
+
/* @__PURE__ */ G(jo, { enabled: E })
|
|
12937
12947
|
]
|
|
12938
12948
|
})]
|
|
12939
|
-
},
|
|
12949
|
+
}, E ? "viewer-webgpu" : "viewer-webgl"), Ce && /* @__PURE__ */ G("div", {
|
|
12940
12950
|
style: zo,
|
|
12941
12951
|
children: /* @__PURE__ */ G(w, {
|
|
12942
12952
|
camera: Vo,
|
|
@@ -12945,15 +12955,15 @@ function mh({ autoFitCamera: e = !0, camera: t = {
|
|
|
12945
12955
|
orthographic: !0,
|
|
12946
12956
|
children: /* @__PURE__ */ G($i, {
|
|
12947
12957
|
active: !0,
|
|
12948
|
-
cameraRef:
|
|
12949
|
-
controlRef:
|
|
12950
|
-
modelRef:
|
|
12958
|
+
cameraRef: D,
|
|
12959
|
+
controlRef: O,
|
|
12960
|
+
modelRef: k
|
|
12951
12961
|
})
|
|
12952
12962
|
}, "nav-cube-webgl")
|
|
12953
12963
|
})]
|
|
12954
12964
|
}) : /* @__PURE__ */ G(tt, {});
|
|
12955
12965
|
}
|
|
12956
|
-
var
|
|
12966
|
+
var gh = p(function(e, t) {
|
|
12957
12967
|
let [n] = S(St), r = x(!1), i = x(!1), a = b(() => new Go(), []), o = b(() => new qo(), []), { defaultSelected: s, onSelectedChange: c, selected: l } = e, u = h((e) => {
|
|
12958
12968
|
a.set(e);
|
|
12959
12969
|
}, [a]), d = b(() => new Ko(), []), f = h((e) => {
|
|
@@ -12982,7 +12992,7 @@ var hh = p(function(e, t) {
|
|
|
12982
12992
|
});
|
|
12983
12993
|
}, [c, n]), /* @__PURE__ */ G(wt, {
|
|
12984
12994
|
store: n,
|
|
12985
|
-
children: /* @__PURE__ */ G(
|
|
12995
|
+
children: /* @__PURE__ */ G(hh, {
|
|
12986
12996
|
...e,
|
|
12987
12997
|
publicApi: m,
|
|
12988
12998
|
setModelsApi: f,
|
|
@@ -12991,6 +13001,6 @@ var hh = p(function(e, t) {
|
|
|
12991
13001
|
})
|
|
12992
13002
|
});
|
|
12993
13003
|
});
|
|
12994
|
-
|
|
13004
|
+
gh.displayName = "Viewer";
|
|
12995
13005
|
//#endregion
|
|
12996
|
-
export { kr as BMTLoader, Qn as BmtConverter, er as ConvertIfcFileToBmt, tr as ConvertToBmt, qs as DimensionLine, nc as DimensionsUtils, pr as FilteredElementsCollector, Su as ModelGrids, $i as NavigationCube,
|
|
13006
|
+
export { kr as BMTLoader, Qn as BmtConverter, er as ConvertIfcFileToBmt, tr as ConvertToBmt, qs as DimensionLine, nc as DimensionsUtils, pr as FilteredElementsCollector, Su as ModelGrids, $i as NavigationCube, gh as Viewer, wt as ViewerStoreProvider, $n as bmtConverter, ei as convertIfcFilesToBmtInWorker, ti as createBmtConverterWorker, zr as createBmtWorker, pi as createIfcWorker, St as createViewerStore, hn as exportExcel, fn as exportModelPropertiesToExcel, Rr as loadBmtModelsInWorker, fi as loadIfcModelsInWorker, bi as loader, rc as useDimensionsUtils, K as useViewerStore, Tt as useViewerStoreApi };
|