@figurosity/consumer-three-dimension-tool 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +74 -0
- package/dist/consumer-three-dimension-tool.js +2454 -0
- package/dist/index-CIql5zKW.js +82 -0
- package/package.json +70 -0
|
@@ -0,0 +1,2454 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".tool-reset-button .qbtn{color:#333;font-weight:700}.debug-color{max-width:100px}.debug-color .swatch{height:20px;width:20px;border-radius:10px;border:1px solid #333}.debug-color .label{font-weight:700}.debug-value span{margin-top:2px;min-width:60px;font-size:11px}.debug-vector{min-width:130px}.debug-vector>div{font-size:10px}.debug-vector>div>span{min-width:20px;font-weight:700}.debug-boolean .indicator{margin-top:6px;margin-right:4px;height:10px;width:10px;border-radius:10px;border:1px solid #333;display:inline-block;background:red}.debug-boolean .indicator.on{background:#adff2f}.debug3D{position:absolute;z-index:14400;top:20px;left:40px;padding:20px;border:1px solid #ccc;border-radius:10px;background-color:#ffffffb3}.debug3D .color-square{display:inline-block;height:15px;width:15px;margin-bottom:-3px;border:1px dotted black}.three-dimension-tool{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100}.three-dimension-tool .tres{width:100%;height:100vh}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
+
import { nextTick as Ht, watch as U, ref as te, onUnmounted as Rt, computed as h, onMounted as Zt, openBlock as Je, createElementBlock as Kt, createCommentVNode as gt, createElementVNode as Yt, onBeforeMount as Qt, defineComponent as Z, h as m, inject as Wt, useModel as Jt, onBeforeUnmount as eo, createBlock as at, unref as it, withCtx as ct, createVNode as to, mergeModels as oo } from "vue";
|
|
3
|
+
import { Platform as ft, useQuasar as so, QBtn as qt, QSeparator as je } from "quasar";
|
|
4
|
+
import { CBaseButton as re, CColorPickerPopup as Ot, CExpansion as rt, CToggle as Ze, CSlider as dt, CDraggableDrawer as Qe, CBaseButtons as no, CDraggableDrawers as ro, CToolPage as lo } from "@figurosity/consumer-controls";
|
|
5
|
+
import { defineStore as ve, storeToRefs as $, getActivePinia as ao } from "pinia";
|
|
6
|
+
import * as S from "three";
|
|
7
|
+
import tt from "lodash.isequal";
|
|
8
|
+
import "three/examples/jsm/loaders/RGBELoader.js";
|
|
9
|
+
import { DEFAULT as ot, COLORS as se, GRID as Se, LIGHTS as ge, RELATED as xe } from "@figurosity/toolbox";
|
|
10
|
+
import { OrbitControls as io } from "three/examples/jsm/controls/OrbitControls.js";
|
|
11
|
+
import { mergeVertices as Bt, mergeGeometries as co } from "three/examples/jsm/utils/BufferGeometryUtils.js";
|
|
12
|
+
import { RoundedBoxGeometry as uo } from "three/examples/jsm/geometries/RoundedBoxGeometry.js";
|
|
13
|
+
import { FBXLoader as po } from "three/examples/jsm/loaders/FBXLoader.js";
|
|
14
|
+
function Ce(e) {
|
|
15
|
+
const o = e.startsWith("#") ? e.slice(1) : e;
|
|
16
|
+
return parseInt(o, 16);
|
|
17
|
+
}
|
|
18
|
+
function fe(e) {
|
|
19
|
+
return `#${e.toString(16).padStart(6, "0")}`;
|
|
20
|
+
}
|
|
21
|
+
const ut = new S.Vector3(), Dt = (e) => {
|
|
22
|
+
const o = new S.Box3().setFromObject(e);
|
|
23
|
+
console.log("box", o);
|
|
24
|
+
const t = o.getSize(new S.Vector3()), s = new S.Vector3(
|
|
25
|
+
(o.min.x + o.max.x) / 2,
|
|
26
|
+
(o.min.y + o.max.y) / 2,
|
|
27
|
+
(o.min.z + o.max.z) / 2
|
|
28
|
+
);
|
|
29
|
+
console.log("center", s);
|
|
30
|
+
let n = o.min.y;
|
|
31
|
+
return console.log("bottom", n), Math.abs(n) < -0.01 && (n = mo(e)), console.log("bottom", n), {
|
|
32
|
+
box: o,
|
|
33
|
+
size: t,
|
|
34
|
+
center: s,
|
|
35
|
+
bottom: n,
|
|
36
|
+
top: o.max.y
|
|
37
|
+
};
|
|
38
|
+
}, mo = (e) => {
|
|
39
|
+
let o = 1 / 0;
|
|
40
|
+
return e.updateMatrixWorld(!0), e.traverse((t) => {
|
|
41
|
+
var n, r;
|
|
42
|
+
if (!t.isMesh) return;
|
|
43
|
+
const s = (r = (n = t.geometry) == null ? void 0 : n.attributes) == null ? void 0 : r.position;
|
|
44
|
+
if (s)
|
|
45
|
+
for (let l = 0; l < s.count; l++)
|
|
46
|
+
ut.fromBufferAttribute(s, l), ut.applyMatrix4(t.matrixWorld), o = Math.min(o, ut.y);
|
|
47
|
+
}), o;
|
|
48
|
+
}, ho = (e) => ({
|
|
49
|
+
box: {
|
|
50
|
+
min: {
|
|
51
|
+
x: e.box.min.x,
|
|
52
|
+
y: e.box.min.y,
|
|
53
|
+
z: e.box.min.z
|
|
54
|
+
},
|
|
55
|
+
max: {
|
|
56
|
+
x: e.box.max.x,
|
|
57
|
+
y: e.box.max.y,
|
|
58
|
+
z: e.box.max.z
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
size: {
|
|
62
|
+
x: e.size.x,
|
|
63
|
+
y: e.size.y,
|
|
64
|
+
z: e.size.z
|
|
65
|
+
},
|
|
66
|
+
center: {
|
|
67
|
+
x: e.center.x,
|
|
68
|
+
y: e.center.y,
|
|
69
|
+
z: e.center.z
|
|
70
|
+
},
|
|
71
|
+
bottom: e.bottom,
|
|
72
|
+
top: e.top
|
|
73
|
+
}), go = [
|
|
74
|
+
"#141111",
|
|
75
|
+
"#3E251E",
|
|
76
|
+
"#633C30",
|
|
77
|
+
"#A56F57",
|
|
78
|
+
"#CC9E86",
|
|
79
|
+
"#543F2E",
|
|
80
|
+
"#7C5B48",
|
|
81
|
+
"#98775B",
|
|
82
|
+
"#AD8B6B",
|
|
83
|
+
"#BFA282",
|
|
84
|
+
"#794524",
|
|
85
|
+
"#8F603E",
|
|
86
|
+
"#B08057",
|
|
87
|
+
"#D7A56F",
|
|
88
|
+
"#F7DBA2",
|
|
89
|
+
"#673E28",
|
|
90
|
+
"#C5815E",
|
|
91
|
+
"#D59671",
|
|
92
|
+
"#EFB698",
|
|
93
|
+
"#F5D2C0",
|
|
94
|
+
"#6E453A",
|
|
95
|
+
"#996C5E",
|
|
96
|
+
"#C88D7D",
|
|
97
|
+
"#E7B09E",
|
|
98
|
+
"#EEC1AE",
|
|
99
|
+
"#432B26",
|
|
100
|
+
"#88635A",
|
|
101
|
+
"#BA8C82",
|
|
102
|
+
"#EBBAB6",
|
|
103
|
+
"#F7D2C8",
|
|
104
|
+
"#796362",
|
|
105
|
+
"#8F7277",
|
|
106
|
+
"#C399A0",
|
|
107
|
+
"#E3C7CB",
|
|
108
|
+
"#E6D1D2",
|
|
109
|
+
"#684C4B",
|
|
110
|
+
"#98807B",
|
|
111
|
+
"#BDACA8",
|
|
112
|
+
"#DACDC9",
|
|
113
|
+
"#E5E4E3"
|
|
114
|
+
], de = ve("3d-fbxs", {
|
|
115
|
+
state: () => ({
|
|
116
|
+
models: {},
|
|
117
|
+
loadingUrl: null,
|
|
118
|
+
palette: go
|
|
119
|
+
}),
|
|
120
|
+
getters: {
|
|
121
|
+
changed(e) {
|
|
122
|
+
var s, n, r, l, i;
|
|
123
|
+
const t = b().selected;
|
|
124
|
+
return console.log("fbx model", (s = e.models) == null ? void 0 : s[t]), (r = (n = e.models) == null ? void 0 : n[t]) != null && r.color ? ((i = (l = e.models) == null ? void 0 : l[t]) == null ? void 0 : i.color) !== 16777215 : !1;
|
|
125
|
+
},
|
|
126
|
+
selectedId() {
|
|
127
|
+
return b().selected;
|
|
128
|
+
},
|
|
129
|
+
poseId(e) {
|
|
130
|
+
var s, n;
|
|
131
|
+
const t = b().selected;
|
|
132
|
+
return (n = (s = e.models) == null ? void 0 : s[t]) == null ? void 0 : n.poseId;
|
|
133
|
+
},
|
|
134
|
+
model(e) {
|
|
135
|
+
const t = b().selected;
|
|
136
|
+
return t && e.models[t] ? e.models[t] : null;
|
|
137
|
+
},
|
|
138
|
+
url() {
|
|
139
|
+
var e;
|
|
140
|
+
return ((e = this.model) == null ? void 0 : e.url) || null;
|
|
141
|
+
},
|
|
142
|
+
bounds() {
|
|
143
|
+
var e;
|
|
144
|
+
return (e = this.model) == null ? void 0 : e.bounds;
|
|
145
|
+
},
|
|
146
|
+
color() {
|
|
147
|
+
var e;
|
|
148
|
+
return ((e = this.model) == null ? void 0 : e.color) || 16777215;
|
|
149
|
+
},
|
|
150
|
+
colorHex() {
|
|
151
|
+
var e;
|
|
152
|
+
return (e = this.model) != null && e.color ? fe(this.model.color) : "#fefefe";
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
actions: {
|
|
156
|
+
resetColor() {
|
|
157
|
+
const o = b().selected;
|
|
158
|
+
this.models[o].color = 16777215;
|
|
159
|
+
},
|
|
160
|
+
setBounds(e) {
|
|
161
|
+
const t = b().selected;
|
|
162
|
+
this.models[t].bounds = ho(e);
|
|
163
|
+
},
|
|
164
|
+
setSubjectsFromResponse(e) {
|
|
165
|
+
const o = e.entities.fbx;
|
|
166
|
+
this.models = { ...this.models, ...o };
|
|
167
|
+
},
|
|
168
|
+
setColorHex(e) {
|
|
169
|
+
const t = b().selected;
|
|
170
|
+
this.models[t].color = Ce(e);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}), vt = { visible: !0, opacity: 1, color: 16711422, texture: "none" }, zt = (e = {}) => ({ ...vt, ...e }), Ve = ve("3d-ground", {
|
|
174
|
+
state: () => ({
|
|
175
|
+
models: {},
|
|
176
|
+
offset: -0.75
|
|
177
|
+
}),
|
|
178
|
+
getters: {
|
|
179
|
+
changed(e) {
|
|
180
|
+
var t, s;
|
|
181
|
+
const o = b().selected;
|
|
182
|
+
return ((s = (t = e.models) == null ? void 0 : t[o]) == null ? void 0 : s.color) !== 16711422;
|
|
183
|
+
},
|
|
184
|
+
property() {
|
|
185
|
+
return (e, o = null) => {
|
|
186
|
+
var t;
|
|
187
|
+
return ((t = this.selectedModel) == null ? void 0 : t[e]) ?? o;
|
|
188
|
+
};
|
|
189
|
+
},
|
|
190
|
+
selectedId() {
|
|
191
|
+
return b().selected;
|
|
192
|
+
},
|
|
193
|
+
selectedModel(e) {
|
|
194
|
+
const o = this.selectedId;
|
|
195
|
+
return e.models[o] ?? null;
|
|
196
|
+
},
|
|
197
|
+
mergedModel() {
|
|
198
|
+
return { ...vt, ...this.selectedModel ?? {} };
|
|
199
|
+
},
|
|
200
|
+
model(e) {
|
|
201
|
+
const t = b().selected;
|
|
202
|
+
return t && e.models[t] ? e.models[t] : null;
|
|
203
|
+
},
|
|
204
|
+
color() {
|
|
205
|
+
return this.mergedModel.color;
|
|
206
|
+
},
|
|
207
|
+
colorHex() {
|
|
208
|
+
return fe(this.mergedModel.color);
|
|
209
|
+
},
|
|
210
|
+
opacity() {
|
|
211
|
+
return this.mergedModel.opacity;
|
|
212
|
+
},
|
|
213
|
+
texture() {
|
|
214
|
+
return this.mergedModel.texture;
|
|
215
|
+
},
|
|
216
|
+
visible() {
|
|
217
|
+
return this.mergedModel.visible;
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
actions: {
|
|
221
|
+
reset() {
|
|
222
|
+
const e = b().selected;
|
|
223
|
+
this.models[e] = zt();
|
|
224
|
+
},
|
|
225
|
+
ensureSelectedModel() {
|
|
226
|
+
const e = b().selected;
|
|
227
|
+
return this.models[e] || (this.models[e] = { ...vt }), this.models[e];
|
|
228
|
+
},
|
|
229
|
+
patchSelected(e) {
|
|
230
|
+
const o = this.ensureSelectedModel();
|
|
231
|
+
Object.assign(o, e);
|
|
232
|
+
},
|
|
233
|
+
setProperty(e, o) {
|
|
234
|
+
const t = this.ensureSelectedModel();
|
|
235
|
+
t[e] = o;
|
|
236
|
+
},
|
|
237
|
+
setColor(e) {
|
|
238
|
+
this.setProperty("color", e);
|
|
239
|
+
},
|
|
240
|
+
setColorHex(e) {
|
|
241
|
+
this.setProperty("color", Ce(e));
|
|
242
|
+
},
|
|
243
|
+
setTexture(e) {
|
|
244
|
+
this.setProperty("texture", e);
|
|
245
|
+
},
|
|
246
|
+
setVisible(e) {
|
|
247
|
+
this.setProperty("visible", e);
|
|
248
|
+
},
|
|
249
|
+
setGroundFromResponse(e) {
|
|
250
|
+
this.models[e] || (this.models[e] = zt());
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}), Ke = {
|
|
254
|
+
color: 16777215,
|
|
255
|
+
visible: !0,
|
|
256
|
+
debug: !1,
|
|
257
|
+
shadow: !0,
|
|
258
|
+
opacity: 1,
|
|
259
|
+
visualization: !0
|
|
260
|
+
}, pt = (e = {}) => ({ ...Ke, ...e }), he = {
|
|
261
|
+
advanced: !1,
|
|
262
|
+
move: !1,
|
|
263
|
+
position: { x: 0, y: 0, z: 1.5 },
|
|
264
|
+
quaternion: { x: 0, y: 0, z: 0, w: 1 },
|
|
265
|
+
target: { x: 0, y: 0, z: 0 }
|
|
266
|
+
}, Et = (e = {}) => ({ ...he, ...e }), Me = ve("3d-lights", {
|
|
267
|
+
state: () => ({
|
|
268
|
+
lights: {},
|
|
269
|
+
options: {},
|
|
270
|
+
collection: ["key", "fill", "back"],
|
|
271
|
+
debug: !1
|
|
272
|
+
}),
|
|
273
|
+
getters: {
|
|
274
|
+
changed(e) {
|
|
275
|
+
const t = b().selected, s = !tt(e.options[t], he), n = {
|
|
276
|
+
key: { ...Ke },
|
|
277
|
+
fill: { ...Ke },
|
|
278
|
+
back: { ...Ke }
|
|
279
|
+
}, r = !tt(e.lights[t], n);
|
|
280
|
+
return s || r;
|
|
281
|
+
},
|
|
282
|
+
move(e) {
|
|
283
|
+
var s;
|
|
284
|
+
const t = b().selected;
|
|
285
|
+
return ((s = e.options[t]) == null ? void 0 : s.move) || !1;
|
|
286
|
+
},
|
|
287
|
+
advancedMode(e) {
|
|
288
|
+
var s;
|
|
289
|
+
const t = b().selected;
|
|
290
|
+
return ((s = e.options[t]) == null ? void 0 : s.advanced) || !1;
|
|
291
|
+
},
|
|
292
|
+
position(e) {
|
|
293
|
+
var s;
|
|
294
|
+
const t = b().selected;
|
|
295
|
+
return ((s = e.options[t]) == null ? void 0 : s.position) || he.position;
|
|
296
|
+
},
|
|
297
|
+
quaternion(e) {
|
|
298
|
+
var s;
|
|
299
|
+
const t = b().selected;
|
|
300
|
+
return ((s = e.options[t]) == null ? void 0 : s.quaternion) || he.quaternion;
|
|
301
|
+
},
|
|
302
|
+
target(e) {
|
|
303
|
+
var s;
|
|
304
|
+
const t = b().selected;
|
|
305
|
+
return ((s = e.options[t]) == null ? void 0 : s.target) || he.target;
|
|
306
|
+
},
|
|
307
|
+
radius(e) {
|
|
308
|
+
var s;
|
|
309
|
+
const t = b().selected;
|
|
310
|
+
return ((s = e.options[t]) == null ? void 0 : s.radius) || he.radius;
|
|
311
|
+
},
|
|
312
|
+
property(e) {
|
|
313
|
+
return (o, t = null, s = null) => {
|
|
314
|
+
const r = b().selected;
|
|
315
|
+
return !e.lights[r] || !e.lights[r][o] || !(t in e.lights[r][o]) ? s : e.lights[r][o][t];
|
|
316
|
+
};
|
|
317
|
+
},
|
|
318
|
+
colorHex(e) {
|
|
319
|
+
return (o) => {
|
|
320
|
+
const s = b().selected;
|
|
321
|
+
return !e.lights[s] || !e.lights[s][o] ? "#ffffff" : fe(e.lights[s][o].color);
|
|
322
|
+
};
|
|
323
|
+
},
|
|
324
|
+
lightKeys(e) {
|
|
325
|
+
const t = b().selected;
|
|
326
|
+
return Object.keys(e.lights[t]);
|
|
327
|
+
},
|
|
328
|
+
isVisible(e) {
|
|
329
|
+
return (o) => e.move && (this.advancedMode === !0 && this.property(o, "visible") || o === "key");
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
actions: {
|
|
333
|
+
reset() {
|
|
334
|
+
const e = b().selected;
|
|
335
|
+
this.options[e] = { ...he }, this.collection.forEach(
|
|
336
|
+
(o) => this.lights[e][o] = { ...Ke }
|
|
337
|
+
);
|
|
338
|
+
},
|
|
339
|
+
ensureSelectedOptions() {
|
|
340
|
+
const e = b().selected;
|
|
341
|
+
return this.options[e] || (this.options[e] = { ...he }), this.options[e];
|
|
342
|
+
},
|
|
343
|
+
patchSelected(e) {
|
|
344
|
+
const o = this.ensureSelectedOptions();
|
|
345
|
+
Object.assign(o, e);
|
|
346
|
+
},
|
|
347
|
+
setControlProperty(e, o) {
|
|
348
|
+
const t = this.ensureSelectedOptions();
|
|
349
|
+
t[e] = o;
|
|
350
|
+
},
|
|
351
|
+
setPosition(e) {
|
|
352
|
+
this.setControlProperty("position", e);
|
|
353
|
+
},
|
|
354
|
+
setQuaternion(e) {
|
|
355
|
+
this.setControlProperty("quaternion", e);
|
|
356
|
+
},
|
|
357
|
+
setTarget(e) {
|
|
358
|
+
this.setControlProperty("target", e);
|
|
359
|
+
},
|
|
360
|
+
setRadius(e) {
|
|
361
|
+
this.setControlProperty("radius", e);
|
|
362
|
+
},
|
|
363
|
+
setMove(e = !1) {
|
|
364
|
+
const t = b().selected;
|
|
365
|
+
this.options[t].move = e;
|
|
366
|
+
},
|
|
367
|
+
setAdvanced(e = !1) {
|
|
368
|
+
const t = b().selected;
|
|
369
|
+
if (e === !0) {
|
|
370
|
+
this.options[t].advanced = !0;
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
this.options[t].advanced = !1;
|
|
374
|
+
const s = this.lights[t].key;
|
|
375
|
+
this.lightKeys.forEach((n) => {
|
|
376
|
+
n !== "key" && (this.lights[t][n].color = s.color);
|
|
377
|
+
});
|
|
378
|
+
},
|
|
379
|
+
setControlOptions(e, o, t = null) {
|
|
380
|
+
t === null && (t = b().selected), this.options[t] || (this.options[t] = Et());
|
|
381
|
+
const s = e.position.clone(), n = e.quaternion.clone(), r = o.target.clone();
|
|
382
|
+
this.options[t].position = { x: s.x, y: s.y, z: s.z }, this.options[t].quaternion = { x: n.x, y: n.y, z: n.z, w: n.w }, this.options[t].target = { x: r.x, y: r.y, z: r.z };
|
|
383
|
+
},
|
|
384
|
+
setColorHex(e, o) {
|
|
385
|
+
var l;
|
|
386
|
+
const s = b().selected, n = this.lights[s], r = Ce(o);
|
|
387
|
+
if (((l = this.options[s]) == null ? void 0 : l.advanced) === !0) {
|
|
388
|
+
n[e].color = r;
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
this.collection.forEach((i) => {
|
|
392
|
+
n[i].color = r;
|
|
393
|
+
});
|
|
394
|
+
},
|
|
395
|
+
setProperty(e, o, t) {
|
|
396
|
+
const n = b().selected;
|
|
397
|
+
this.lights[n][e][o] = t;
|
|
398
|
+
},
|
|
399
|
+
initLights() {
|
|
400
|
+
const o = b().selected;
|
|
401
|
+
this.lights[o] || (this.lights[o] = {
|
|
402
|
+
key: pt(),
|
|
403
|
+
fill: pt({ shadow: !0 }),
|
|
404
|
+
back: pt({ shadow: !0 })
|
|
405
|
+
}), this.options[o] || (this.options[o] = Et());
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}), Ye = {
|
|
409
|
+
position: { x: 0, y: 0.39999999999999986, z: 1.5 },
|
|
410
|
+
quaternion: { x: -0.12993279108591813, y: 0, z: 0, w: 0.9915228034698058 },
|
|
411
|
+
target: { x: 0, y: 0, z: 0 },
|
|
412
|
+
radius: 1.5
|
|
413
|
+
}, Tt = (e = {}) => ({ ...Ye, ...e }), Ct = ve("3d-controls", {
|
|
414
|
+
state: () => ({
|
|
415
|
+
models: {}
|
|
416
|
+
}),
|
|
417
|
+
getters: {
|
|
418
|
+
changed(e) {
|
|
419
|
+
var s;
|
|
420
|
+
const t = b().selected;
|
|
421
|
+
return (s = e.models) != null && s[t] ? !tt(e.models[t], Ye) : !1;
|
|
422
|
+
},
|
|
423
|
+
property() {
|
|
424
|
+
return (e, o = null) => {
|
|
425
|
+
var t;
|
|
426
|
+
return ((t = this.selectedModel) == null ? void 0 : t[e]) ?? o;
|
|
427
|
+
};
|
|
428
|
+
},
|
|
429
|
+
selectedId() {
|
|
430
|
+
return b().selected;
|
|
431
|
+
},
|
|
432
|
+
selectedModel(e) {
|
|
433
|
+
const o = this.selectedId;
|
|
434
|
+
return e.models[o] ?? null;
|
|
435
|
+
},
|
|
436
|
+
mergedModel() {
|
|
437
|
+
return { ...Ye, ...this.selectedModel ?? {} };
|
|
438
|
+
},
|
|
439
|
+
position() {
|
|
440
|
+
return this.mergedModel.position;
|
|
441
|
+
},
|
|
442
|
+
quaternion() {
|
|
443
|
+
return this.mergedModel.quaternion;
|
|
444
|
+
},
|
|
445
|
+
target() {
|
|
446
|
+
return this.mergedModel.target;
|
|
447
|
+
},
|
|
448
|
+
radius() {
|
|
449
|
+
return this.mergedModel.radius;
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
actions: {
|
|
453
|
+
reset() {
|
|
454
|
+
const e = b().selected;
|
|
455
|
+
this.models[e] = { ...Ye };
|
|
456
|
+
},
|
|
457
|
+
ensureSelectedModel() {
|
|
458
|
+
const e = b().selected;
|
|
459
|
+
return this.models[e] || (this.models[e] = { ...Ye }), this.models[e];
|
|
460
|
+
},
|
|
461
|
+
patchSelected(e) {
|
|
462
|
+
const o = this.ensureSelectedModel();
|
|
463
|
+
Object.assign(o, e);
|
|
464
|
+
},
|
|
465
|
+
setProperty(e, o) {
|
|
466
|
+
const t = this.ensureSelectedModel();
|
|
467
|
+
t[e] = o;
|
|
468
|
+
},
|
|
469
|
+
setPosition(e) {
|
|
470
|
+
this.setProperty("position", e);
|
|
471
|
+
},
|
|
472
|
+
setQuaternion(e) {
|
|
473
|
+
this.setProperty("quaternion", e);
|
|
474
|
+
},
|
|
475
|
+
setTarget(e) {
|
|
476
|
+
this.setProperty("target", e);
|
|
477
|
+
},
|
|
478
|
+
setRadius(e) {
|
|
479
|
+
this.setProperty("radius", e);
|
|
480
|
+
},
|
|
481
|
+
setControlOptions(e, o, t = null) {
|
|
482
|
+
t === null && (t = b().selected), this.models[t] || (this.models[t] = Tt());
|
|
483
|
+
const s = e.position.clone(), n = e.quaternion.clone(), r = o.target.clone();
|
|
484
|
+
this.models[t].position = { x: s.x, y: s.y, z: s.z }, this.models[t].quaternion = { x: n.x, y: n.y, z: n.z, w: n.w }, this.models[t].target = { x: r.x, y: r.y, z: r.z };
|
|
485
|
+
},
|
|
486
|
+
initControls() {
|
|
487
|
+
const o = b().selected;
|
|
488
|
+
o && !this.models[o] && (this.models[o] = Tt());
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}), bt = {
|
|
492
|
+
color: 16711422
|
|
493
|
+
}, At = (e = {}) => ({ ...bt, ...e }), lt = ve("3d-scene", {
|
|
494
|
+
state: () => ({
|
|
495
|
+
models: {}
|
|
496
|
+
}),
|
|
497
|
+
getters: {
|
|
498
|
+
changed(e) {
|
|
499
|
+
var s, n;
|
|
500
|
+
const t = b().selected;
|
|
501
|
+
return ((n = (s = e.models) == null ? void 0 : s[t]) == null ? void 0 : n.color) !== 16711422;
|
|
502
|
+
},
|
|
503
|
+
colorHex(e) {
|
|
504
|
+
var n;
|
|
505
|
+
const t = b().selected, s = (n = e.models[t]) == null ? void 0 : n.color;
|
|
506
|
+
return fe(s || bt.color);
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
actions: {
|
|
510
|
+
reset() {
|
|
511
|
+
const o = b().selected;
|
|
512
|
+
this.models[o] = { ...bt };
|
|
513
|
+
},
|
|
514
|
+
selectedId() {
|
|
515
|
+
return b().selected;
|
|
516
|
+
},
|
|
517
|
+
setColorHex(e) {
|
|
518
|
+
const t = b().selected;
|
|
519
|
+
this.models[t] || (this.models[t] = At()), this.models[t].color = Ce(e);
|
|
520
|
+
},
|
|
521
|
+
init() {
|
|
522
|
+
const o = b().selected;
|
|
523
|
+
this.models[o] || (this.models[o] = At());
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}), Te = {
|
|
527
|
+
show: !1,
|
|
528
|
+
front: !1,
|
|
529
|
+
back: !1,
|
|
530
|
+
left: !1,
|
|
531
|
+
right: !1,
|
|
532
|
+
top: !1,
|
|
533
|
+
bottom: !1,
|
|
534
|
+
divisions: 6,
|
|
535
|
+
opacity: 0.5,
|
|
536
|
+
size: 2,
|
|
537
|
+
lineColor: 13421772,
|
|
538
|
+
centerLineColor: 16711680
|
|
539
|
+
}, fo = (e = {}) => ({ ...Te, ...e }), ke = ve("3d-grid", {
|
|
540
|
+
state: () => ({
|
|
541
|
+
models: {}
|
|
542
|
+
}),
|
|
543
|
+
getters: {
|
|
544
|
+
changed(e) {
|
|
545
|
+
const t = b().selected;
|
|
546
|
+
return console.log("state.models[id]", e.models[t]), console.log("defaults", Te), !tt(e.models[t], Te);
|
|
547
|
+
},
|
|
548
|
+
property() {
|
|
549
|
+
return (e, o = null) => {
|
|
550
|
+
var t;
|
|
551
|
+
return ((t = this.selectedModel) == null ? void 0 : t[e]) ?? o;
|
|
552
|
+
};
|
|
553
|
+
},
|
|
554
|
+
selectedId() {
|
|
555
|
+
return b().selected;
|
|
556
|
+
},
|
|
557
|
+
selectedModel(e) {
|
|
558
|
+
const o = this.selectedId;
|
|
559
|
+
return e.models[o] ?? null;
|
|
560
|
+
},
|
|
561
|
+
mergedModel() {
|
|
562
|
+
return { ...Te, ...this.selectedModel ?? {} };
|
|
563
|
+
},
|
|
564
|
+
show() {
|
|
565
|
+
return this.mergedModel.show;
|
|
566
|
+
},
|
|
567
|
+
lineColor() {
|
|
568
|
+
return this.mergedModel.lineColor;
|
|
569
|
+
},
|
|
570
|
+
centerLineColor() {
|
|
571
|
+
return this.mergedModel.centerLineColor;
|
|
572
|
+
},
|
|
573
|
+
opacity() {
|
|
574
|
+
return this.mergedModel.opacity;
|
|
575
|
+
},
|
|
576
|
+
size() {
|
|
577
|
+
return this.mergedModel.size;
|
|
578
|
+
},
|
|
579
|
+
divisions() {
|
|
580
|
+
return this.mergedModel.divisions;
|
|
581
|
+
},
|
|
582
|
+
lineColorHex() {
|
|
583
|
+
return fe(this.mergedModel.lineColor);
|
|
584
|
+
},
|
|
585
|
+
centerLineColorHex() {
|
|
586
|
+
return fe(this.mergedModel.centerLineColor);
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
actions: {
|
|
590
|
+
reset() {
|
|
591
|
+
const o = b().selected;
|
|
592
|
+
this.models[o] = { ...Te }, Ht(() => {
|
|
593
|
+
this.models[o].show = !1;
|
|
594
|
+
});
|
|
595
|
+
},
|
|
596
|
+
ensureSelectedModel() {
|
|
597
|
+
const e = b().selected;
|
|
598
|
+
return this.models[e] || (this.models[e] = { ...Te }), this.models[e];
|
|
599
|
+
},
|
|
600
|
+
patchSelected(e) {
|
|
601
|
+
const o = this.ensureSelectedModel();
|
|
602
|
+
Object.assign(o, e);
|
|
603
|
+
},
|
|
604
|
+
setProperty(e, o) {
|
|
605
|
+
const t = this.ensureSelectedModel();
|
|
606
|
+
t[e] = o;
|
|
607
|
+
},
|
|
608
|
+
setLineColorHex(e) {
|
|
609
|
+
this.setProperty("lineColor", Ce(e));
|
|
610
|
+
},
|
|
611
|
+
setCenterLineColorHex(e) {
|
|
612
|
+
this.setProperty("centerLineColor", Ce(e));
|
|
613
|
+
},
|
|
614
|
+
init() {
|
|
615
|
+
const o = b().selected;
|
|
616
|
+
this.models[o] || (this.models[o] = fo());
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}), vo = [
|
|
620
|
+
"#141111",
|
|
621
|
+
"#3E251E",
|
|
622
|
+
"#633C30",
|
|
623
|
+
"#A56F57",
|
|
624
|
+
"#CC9E86",
|
|
625
|
+
"#543F2E",
|
|
626
|
+
"#7C5B48",
|
|
627
|
+
"#98775B",
|
|
628
|
+
"#AD8B6B",
|
|
629
|
+
"#BFA282",
|
|
630
|
+
"#794524",
|
|
631
|
+
"#8F603E",
|
|
632
|
+
"#B08057",
|
|
633
|
+
"#D7A56F",
|
|
634
|
+
"#F7DBA2",
|
|
635
|
+
"#673E28",
|
|
636
|
+
"#C5815E",
|
|
637
|
+
"#D59671",
|
|
638
|
+
"#EFB698",
|
|
639
|
+
"#F5D2C0",
|
|
640
|
+
"#6E453A",
|
|
641
|
+
"#996C5E",
|
|
642
|
+
"#C88D7D",
|
|
643
|
+
"#E7B09E",
|
|
644
|
+
"#EEC1AE",
|
|
645
|
+
"#432B26",
|
|
646
|
+
"#88635A",
|
|
647
|
+
"#BA8C82",
|
|
648
|
+
"#EBBAB6",
|
|
649
|
+
"#F7D2C8",
|
|
650
|
+
"#796362",
|
|
651
|
+
"#8F7277",
|
|
652
|
+
"#C399A0",
|
|
653
|
+
"#E3C7CB",
|
|
654
|
+
"#E6D1D2",
|
|
655
|
+
"#684C4B",
|
|
656
|
+
"#98807B",
|
|
657
|
+
"#BDACA8",
|
|
658
|
+
"#DACDC9",
|
|
659
|
+
"#E5E4E3"
|
|
660
|
+
], yt = "background", et = "subject", St = "ground", Vt = {
|
|
661
|
+
[et]: 16711422,
|
|
662
|
+
[yt]: 16777215,
|
|
663
|
+
[St]: 12961221
|
|
664
|
+
}, Ut = ve("3d-colors", {
|
|
665
|
+
state: () => ({
|
|
666
|
+
models: {},
|
|
667
|
+
palette: vo
|
|
668
|
+
}),
|
|
669
|
+
getters: {
|
|
670
|
+
property() {
|
|
671
|
+
return (e, o = null) => {
|
|
672
|
+
var t;
|
|
673
|
+
return ((t = this.selectedModel) == null ? void 0 : t[e]) ?? o;
|
|
674
|
+
};
|
|
675
|
+
},
|
|
676
|
+
selectedId() {
|
|
677
|
+
return b().selected;
|
|
678
|
+
},
|
|
679
|
+
selectedModel(e) {
|
|
680
|
+
const o = this.selectedId;
|
|
681
|
+
return e.models[o] ?? null;
|
|
682
|
+
},
|
|
683
|
+
mergedModel() {
|
|
684
|
+
return { ...Vt, ...this.selectedModel ?? {} };
|
|
685
|
+
},
|
|
686
|
+
model(e) {
|
|
687
|
+
const t = b().selected;
|
|
688
|
+
return t && e.models[t] ? e.models[t] : null;
|
|
689
|
+
},
|
|
690
|
+
subjectHex() {
|
|
691
|
+
return this.getHexColor(et);
|
|
692
|
+
},
|
|
693
|
+
groundHex() {
|
|
694
|
+
return this.getHexColor(St);
|
|
695
|
+
},
|
|
696
|
+
backgroundHex() {
|
|
697
|
+
return this.getHexColor(yt);
|
|
698
|
+
}
|
|
699
|
+
},
|
|
700
|
+
actions: {
|
|
701
|
+
initModel(e) {
|
|
702
|
+
this.models[e] = { ...Vt };
|
|
703
|
+
},
|
|
704
|
+
getHexColor(e) {
|
|
705
|
+
const t = b().selected;
|
|
706
|
+
if (!this.models[t] || !this.models[t][e]) return "#F0F0F0";
|
|
707
|
+
const s = this.models[t][e];
|
|
708
|
+
return fe(s);
|
|
709
|
+
},
|
|
710
|
+
setHexColor(e = et, o = "#e6e6e6") {
|
|
711
|
+
const s = b().selected;
|
|
712
|
+
!this.models[s] || !this.models[s][e] || (this.models[s][e] = Ce(o));
|
|
713
|
+
},
|
|
714
|
+
setSubjectHex(e) {
|
|
715
|
+
this.setHexColor(et, e);
|
|
716
|
+
},
|
|
717
|
+
setGroundHex(e) {
|
|
718
|
+
this.setHexColor(St, e);
|
|
719
|
+
},
|
|
720
|
+
setBackgroundHex(e) {
|
|
721
|
+
this.setHexColor(yt, e);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
}), b = ve("3d", {
|
|
725
|
+
state: () => ({
|
|
726
|
+
// models: {},
|
|
727
|
+
selected: null,
|
|
728
|
+
width: 0,
|
|
729
|
+
height: 0,
|
|
730
|
+
loaded: {
|
|
731
|
+
camera: !1,
|
|
732
|
+
renderer: !1,
|
|
733
|
+
scene: !1,
|
|
734
|
+
subject: !1
|
|
735
|
+
},
|
|
736
|
+
loading: {
|
|
737
|
+
active: !1,
|
|
738
|
+
percent: 0,
|
|
739
|
+
url: null
|
|
740
|
+
},
|
|
741
|
+
subjectLoaded: !1,
|
|
742
|
+
models: {}
|
|
743
|
+
}),
|
|
744
|
+
getters: {
|
|
745
|
+
active(e) {
|
|
746
|
+
var t, s;
|
|
747
|
+
const o = ft.is.mobile ? ot : se;
|
|
748
|
+
return ((s = (t = this.models) == null ? void 0 : t[e.selected]) == null ? void 0 : s.active) || o;
|
|
749
|
+
},
|
|
750
|
+
aspect(e) {
|
|
751
|
+
return e.height > 0 ? e.width / e.height : 0;
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
actions: {
|
|
755
|
+
hasAccess(e) {
|
|
756
|
+
var o;
|
|
757
|
+
return ((o = this.appAccessStore) == null ? void 0 : o.hasAccess(e)) || !1;
|
|
758
|
+
},
|
|
759
|
+
block(e) {
|
|
760
|
+
var o;
|
|
761
|
+
return ((o = this.appPaywallStore) == null ? void 0 : o.block(e)) || !0;
|
|
762
|
+
},
|
|
763
|
+
isExpanded(e = []) {
|
|
764
|
+
return e = Array.isArray(e) ? e : [e], e.includes(this.active);
|
|
765
|
+
},
|
|
766
|
+
setActive(e, o = 0) {
|
|
767
|
+
this.models[this.selected] || (this.models[this.selected] = {}), this.models[this.selected].active !== e && (this.models[this.selected].active = e);
|
|
768
|
+
},
|
|
769
|
+
subscribe(e) {
|
|
770
|
+
const o = this;
|
|
771
|
+
e.$on("fbx:loaded", (t) => {
|
|
772
|
+
console.log("bus.$on('fbx:loaded')", t), console.log(o.setFromResponse), o.setFromResponse(t);
|
|
773
|
+
});
|
|
774
|
+
},
|
|
775
|
+
setFromResponse(e) {
|
|
776
|
+
var u;
|
|
777
|
+
console.log("3d setFromresponse", e);
|
|
778
|
+
const o = Ut(), t = Ct(), s = ke(), n = Ve(), r = Me(), l = lt(), i = de(), d = e.result.fbx;
|
|
779
|
+
this.selected = parseInt(d), o.initModel(d), r.initLights(), n.setGroundFromResponse(d), i.setSubjectsFromResponse(e), t.initControls(), s.init(), l.init(), this.models[d] || (this.models[d] = {}), (u = this.models[d]) != null && u.active || (this.models[d].active = ft.is.mobile ? ot : se);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
});
|
|
783
|
+
let ae = null, Fe = null;
|
|
784
|
+
const Ae = () => {
|
|
785
|
+
const e = b(), { aspect: o, width: t, height: s } = $(e), n = (i = { x: 0, y: 0.8, z: 1.5 }) => (console.debug("useCamera init"), ae ? (console.debug("view camera already inited"), ae) : (ae = new S.PerspectiveCamera(75, o.value, 0.1, 100), e.loaded.camera = !0, ae)), r = () => {
|
|
786
|
+
if (ae)
|
|
787
|
+
return ae;
|
|
788
|
+
};
|
|
789
|
+
return Fe = U(
|
|
790
|
+
() => o.value,
|
|
791
|
+
(i) => {
|
|
792
|
+
if (!ae) {
|
|
793
|
+
n();
|
|
794
|
+
return;
|
|
795
|
+
}
|
|
796
|
+
ae.aspect = i, ae.updateProjectionMatrix();
|
|
797
|
+
}
|
|
798
|
+
), {
|
|
799
|
+
init: n,
|
|
800
|
+
getCamera: r,
|
|
801
|
+
dispose: () => {
|
|
802
|
+
Fe == null || Fe(), Fe = null, ae = null;
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
};
|
|
806
|
+
let ne = null;
|
|
807
|
+
const st = () => {
|
|
808
|
+
const e = te(!1), o = te({
|
|
809
|
+
mode: null,
|
|
810
|
+
camera: null,
|
|
811
|
+
// camera (or your lights-camera)
|
|
812
|
+
store: null
|
|
813
|
+
// pinia store with position/quaternion/target
|
|
814
|
+
}), t = (v, f = {}) => {
|
|
815
|
+
if (console.debug("useOrbitControlsBase init"), ne)
|
|
816
|
+
return console.debug("controls already inited"), ne;
|
|
817
|
+
const A = new S.Object3D();
|
|
818
|
+
return ne = new io(A, v.domElement), n(f), ne;
|
|
819
|
+
}, s = () => {
|
|
820
|
+
if (!ne) throw new Error("OrbitControls not initialized");
|
|
821
|
+
return ne;
|
|
822
|
+
}, n = (v = {}) => {
|
|
823
|
+
const f = s();
|
|
824
|
+
f.enableDamping = v.enableDamping ?? !0, f.dampingFactor = v.dampingFactor ?? 0.5, f.rotateSpeed = v.rotateSpeed ?? 0.2, f.enableZoom = v.enableZoom ?? !0, f.minDistance = v.minDistance ?? 0.5, f.maxDistance = v.maxDistance ?? 6;
|
|
825
|
+
}, r = ({ mode: v, camera: f, store: A, options: C }) => {
|
|
826
|
+
const y = s();
|
|
827
|
+
if (!f) throw new Error(`setMode(${v}): camera is required`);
|
|
828
|
+
if (!A) throw new Error(`setMode(${v}): store is required`);
|
|
829
|
+
y.object = f, n(C), o.value = { mode: v, camera: f, store: A }, d(), y.update();
|
|
830
|
+
}, l = () => {
|
|
831
|
+
ne && ne.update();
|
|
832
|
+
}, i = () => {
|
|
833
|
+
const v = s(), { camera: f, store: A } = o.value;
|
|
834
|
+
!f || !A || e.value || (A.setPosition({ ...f.position }), A.setQuaternion({ ...f.quaternion }), A.setTarget({ ...v.target }), A.setRadius(f.position.distanceTo(v.target)));
|
|
835
|
+
}, d = () => {
|
|
836
|
+
const v = s(), { camera: f, store: A } = o.value;
|
|
837
|
+
if (!f || !A) return;
|
|
838
|
+
e.value = !0;
|
|
839
|
+
const { position: C, quaternion: y, target: B, radius: M } = A;
|
|
840
|
+
v.target.set(B.x, B.y, B.z);
|
|
841
|
+
const z = new S.Vector3(
|
|
842
|
+
C.x - B.x,
|
|
843
|
+
C.y - B.y,
|
|
844
|
+
C.z - B.z
|
|
845
|
+
).normalize();
|
|
846
|
+
f.position.copy(v.target).add(z.multiplyScalar(M)), f.quaternion.set(
|
|
847
|
+
y.x,
|
|
848
|
+
y.y,
|
|
849
|
+
y.z,
|
|
850
|
+
y.w
|
|
851
|
+
), v.update(), e.value = !1;
|
|
852
|
+
};
|
|
853
|
+
return {
|
|
854
|
+
init: t,
|
|
855
|
+
get: s,
|
|
856
|
+
setMode: r,
|
|
857
|
+
update: l,
|
|
858
|
+
syncToStore: i,
|
|
859
|
+
applyFromStore: d,
|
|
860
|
+
frameToBounds: (v, f = 1.75, A = 0.02) => {
|
|
861
|
+
const C = s(), { camera: y } = o.value;
|
|
862
|
+
if (!y || !v) return;
|
|
863
|
+
const B = new S.Vector3(
|
|
864
|
+
v.center.x,
|
|
865
|
+
v.center.y + v.size.y * A,
|
|
866
|
+
v.center.z
|
|
867
|
+
);
|
|
868
|
+
console.log("bounds", v);
|
|
869
|
+
const M = Math.max(v.size.x, v.size.y, v.size.z), z = S.MathUtils.degToRad(y.fov);
|
|
870
|
+
let H = M / 2 / Math.tan(z / 2) * f;
|
|
871
|
+
C.target.copy(B), y.position.set(B.x, B.y, B.z + H), y.near = H / 100, y.far = H * 100, y.updateProjectionMatrix(), C.update();
|
|
872
|
+
},
|
|
873
|
+
dispose: () => {
|
|
874
|
+
console.debug("controls disposed"), ne && (ne.dispose(), ne = null, o.value = { mode: null, camera: null, store: null });
|
|
875
|
+
}
|
|
876
|
+
};
|
|
877
|
+
}, wt = () => {
|
|
878
|
+
const { getCamera: e } = Ae(), o = Ct(), t = st();
|
|
879
|
+
return {
|
|
880
|
+
activate: () => {
|
|
881
|
+
t.setMode({
|
|
882
|
+
mode: "camera",
|
|
883
|
+
camera: e(),
|
|
884
|
+
store: o,
|
|
885
|
+
options: {
|
|
886
|
+
enableZoom: !0,
|
|
887
|
+
minDistance: 0.5,
|
|
888
|
+
maxDistance: 6
|
|
889
|
+
}
|
|
890
|
+
});
|
|
891
|
+
},
|
|
892
|
+
frameToBounds: t.frameToBounds,
|
|
893
|
+
syncToStore: t.syncToStore,
|
|
894
|
+
applyFromStore: t.applyFromStore
|
|
895
|
+
};
|
|
896
|
+
};
|
|
897
|
+
let oe = null, Pe = null;
|
|
898
|
+
const we = () => {
|
|
899
|
+
const e = lt(), o = b(), { colorHex: t } = $(e), s = () => (console.debug("useScene init"), oe ? (console.debug("scene already inited"), oe) : (oe = new S.Scene(), r(t.value), o.loaded.scene = !0, oe)), n = () => {
|
|
900
|
+
if (oe)
|
|
901
|
+
return oe;
|
|
902
|
+
}, r = (i) => {
|
|
903
|
+
if (!oe) throw new Error("Scene has not been initialized");
|
|
904
|
+
oe.background = new S.Color(i);
|
|
905
|
+
};
|
|
906
|
+
return Pe = U(
|
|
907
|
+
() => t.value,
|
|
908
|
+
(i) => r(i)
|
|
909
|
+
), {
|
|
910
|
+
init: s,
|
|
911
|
+
get: n,
|
|
912
|
+
dispose: () => {
|
|
913
|
+
o.loaded.scene = !1, Pe == null || Pe(), Pe = null, oe && (oe.traverse((i) => {
|
|
914
|
+
var d, u;
|
|
915
|
+
i.isMesh && ((d = i.geometry) == null || d.dispose(), Array.isArray(i.material) ? i.material.forEach((g) => g == null ? void 0 : g.dispose()) : (u = i.material) == null || u.dispose());
|
|
916
|
+
}), oe.clear(), oe = null);
|
|
917
|
+
},
|
|
918
|
+
setBackgroundColor: r
|
|
919
|
+
};
|
|
920
|
+
}, bo = {
|
|
921
|
+
asphalt: {
|
|
922
|
+
ao: "ao.jpg",
|
|
923
|
+
color: "color.jpg",
|
|
924
|
+
displacement: "displacement.jpg",
|
|
925
|
+
normal: "normal.jpg",
|
|
926
|
+
roughness: "roughness.jpg",
|
|
927
|
+
repeat: 100
|
|
928
|
+
},
|
|
929
|
+
"diamond-plate": {
|
|
930
|
+
ao: "ao.jpg",
|
|
931
|
+
color: "color.jpg",
|
|
932
|
+
displacement: "displacement.jpg",
|
|
933
|
+
metalness: "metalness.jpg",
|
|
934
|
+
normal: "normal.jpg",
|
|
935
|
+
roughness: "roughness.jpg",
|
|
936
|
+
repeat: 100
|
|
937
|
+
},
|
|
938
|
+
tiles: {
|
|
939
|
+
ao: "ao.jpg",
|
|
940
|
+
color: "color.jpg",
|
|
941
|
+
displacement: "displacement.jpg",
|
|
942
|
+
normal: "normal.jpg",
|
|
943
|
+
roughness: "roughness.jpg",
|
|
944
|
+
repeat: 200
|
|
945
|
+
},
|
|
946
|
+
"wood-floor": {
|
|
947
|
+
ao: "ao.jpg",
|
|
948
|
+
color: "color.jpg",
|
|
949
|
+
displacement: "displacement.jpg",
|
|
950
|
+
metalness: "metalness.jpg",
|
|
951
|
+
normal: "normal.jpg",
|
|
952
|
+
roughness: "roughness.jpg",
|
|
953
|
+
repeat: 100
|
|
954
|
+
}
|
|
955
|
+
};
|
|
956
|
+
let T = null, Ge = null, He = null, Re = null;
|
|
957
|
+
const Lt = () => {
|
|
958
|
+
const e = Ve(), { get: o } = we(), { getCamera: t } = Ae(), {
|
|
959
|
+
visible: s,
|
|
960
|
+
color: n,
|
|
961
|
+
texture: r,
|
|
962
|
+
offset: l
|
|
963
|
+
} = $(e), i = () => {
|
|
964
|
+
if (console.debug("useGround init"), T)
|
|
965
|
+
return console.debug("ground already inited"), T;
|
|
966
|
+
const C = o(), y = new S.PlaneGeometry(100, 100), B = new S.Color(n.value || 16777215), M = new S.MeshStandardMaterial({
|
|
967
|
+
color: B,
|
|
968
|
+
// Default to white
|
|
969
|
+
side: S.DoubleSide,
|
|
970
|
+
roughness: 0.4,
|
|
971
|
+
metalness: 0.3,
|
|
972
|
+
emissive: B,
|
|
973
|
+
emissiveIntensity: 0.05
|
|
974
|
+
// tweak 0.1–0.6
|
|
975
|
+
});
|
|
976
|
+
return T = new S.Mesh(y, M), T.rotation.x = -Math.PI / 2, T.receiveShadow = !0, T.visible = s.value, C.add(T), Ge = U(
|
|
977
|
+
() => s.value,
|
|
978
|
+
() => d()
|
|
979
|
+
), He = U(
|
|
980
|
+
() => n.value,
|
|
981
|
+
(z) => f(z)
|
|
982
|
+
), Re = U(
|
|
983
|
+
() => r.value,
|
|
984
|
+
(z) => g(z)
|
|
985
|
+
), T;
|
|
986
|
+
};
|
|
987
|
+
function d() {
|
|
988
|
+
if (t().position.y < T.position.y) {
|
|
989
|
+
T.visible = !1;
|
|
990
|
+
return;
|
|
991
|
+
}
|
|
992
|
+
T.visible = s.value;
|
|
993
|
+
}
|
|
994
|
+
function u(C, y = 1, B = 1) {
|
|
995
|
+
return new S.TextureLoader().load(C, (H) => {
|
|
996
|
+
H.wrapS = S.RepeatWrapping, H.wrapT = S.RepeatWrapping, H.repeat.set(y, B), H.needsUpdate = !0;
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
const g = (C) => {
|
|
1000
|
+
if (!T) throw new Error("Ground has not been initialized");
|
|
1001
|
+
const y = bo[C];
|
|
1002
|
+
if (!y)
|
|
1003
|
+
T.material.map = null, T.material.normalMap = null, T.material.displacementMap = null, T.material.roughnessMap = null, T.material.aoMap = null, T.material.metalnessMap = null, T.material.needsUpdate = !0;
|
|
1004
|
+
else {
|
|
1005
|
+
const B = `https://static.figurosity.com/3d/textures/${C}/`, M = y.repeat;
|
|
1006
|
+
T.material.map = u(
|
|
1007
|
+
`${B}${y.color}`,
|
|
1008
|
+
M,
|
|
1009
|
+
M
|
|
1010
|
+
), T.material.normalMap = u(
|
|
1011
|
+
`${B}${y.normal}`,
|
|
1012
|
+
M,
|
|
1013
|
+
M
|
|
1014
|
+
), T.material.displacementMap = u(
|
|
1015
|
+
`${B}${y.displacement}`,
|
|
1016
|
+
M,
|
|
1017
|
+
M
|
|
1018
|
+
), T.material.roughnessMap = u(
|
|
1019
|
+
`${B}${y.roughness}`,
|
|
1020
|
+
M,
|
|
1021
|
+
M
|
|
1022
|
+
), T.material.aoMap = u(
|
|
1023
|
+
`${B}${y.ao}`,
|
|
1024
|
+
M,
|
|
1025
|
+
M
|
|
1026
|
+
), y.metalness && (T.material.metalnessMap = u(
|
|
1027
|
+
`${B}${y.metalness}`,
|
|
1028
|
+
M,
|
|
1029
|
+
M
|
|
1030
|
+
)), T.material.displacementScale = 0.1, T.material.displacementBias = -0.05, T.material.needsUpdate = !0;
|
|
1031
|
+
}
|
|
1032
|
+
T.position.y = l.value, T.geometry.computeBoundingBox(), T.geometry.computeVertexNormals();
|
|
1033
|
+
}, v = () => {
|
|
1034
|
+
if (!T) throw new Error("Ground has not been initialized");
|
|
1035
|
+
return T;
|
|
1036
|
+
}, f = (C) => {
|
|
1037
|
+
if (!T) throw new Error("Ground has not been initialized");
|
|
1038
|
+
T.material.color.set(C);
|
|
1039
|
+
};
|
|
1040
|
+
return { init: i, get: v, setColor: f, updateVisibility: d, dispose: () => {
|
|
1041
|
+
var y, B;
|
|
1042
|
+
if (Ge == null || Ge(), He == null || He(), Re == null || Re(), Ge = null, He = null, Re = null, !T) return;
|
|
1043
|
+
const C = o();
|
|
1044
|
+
C == null || C.remove(T), (y = T.geometry) == null || y.dispose(), Array.isArray(T.material) ? T.material.forEach((M) => M == null ? void 0 : M.dispose()) : (B = T.material) == null || B.dispose(), T = null;
|
|
1045
|
+
} };
|
|
1046
|
+
}, yo = (e, o = 16711422) => {
|
|
1047
|
+
const t = new uo(0.1, 0.1, 0.1, 6, 0.01), s = 0.1, n = 0.05, r = new S.ConeGeometry(n, s, 32);
|
|
1048
|
+
t.index || t.setIndex(
|
|
1049
|
+
Array.from(
|
|
1050
|
+
{ length: t.attributes.position.count },
|
|
1051
|
+
(u, g) => g
|
|
1052
|
+
)
|
|
1053
|
+
), r.index || r.setIndex(
|
|
1054
|
+
Array.from(
|
|
1055
|
+
{ length: r.attributes.position.count },
|
|
1056
|
+
(u, g) => g
|
|
1057
|
+
)
|
|
1058
|
+
), r.rotateX(-Math.PI / 2), r.translate(0, 0, s / 2), Bt(t), Bt(r);
|
|
1059
|
+
const l = co([t, r]), i = new S.MeshBasicMaterial({
|
|
1060
|
+
color: o,
|
|
1061
|
+
transparent: !0,
|
|
1062
|
+
opacity: 0.8
|
|
1063
|
+
}), d = new S.Mesh(l, i);
|
|
1064
|
+
if (d.position.set(0, 0, 0), d.rotateX(Math.PI), e && e.target) {
|
|
1065
|
+
const u = new S.Vector3();
|
|
1066
|
+
e.target.getWorldPosition(u), d.lookAt(u);
|
|
1067
|
+
}
|
|
1068
|
+
return d.position.copy(e.position), d;
|
|
1069
|
+
};
|
|
1070
|
+
let We = {}, ie = {}, Y = {}, mt = {}, ye = {}, Be = null, pe = null, qe = [], De = /* @__PURE__ */ new Map();
|
|
1071
|
+
const nt = () => {
|
|
1072
|
+
const e = b(), o = Me(), t = de();
|
|
1073
|
+
te(!1);
|
|
1074
|
+
const { subjectLoaded: s, width: n, height: r, selected: l } = $(e), { debug: i, collection: d, advancedMode: u, move: g } = $(o), { get: v } = we(), f = o.property, A = () => {
|
|
1075
|
+
if (pe)
|
|
1076
|
+
return console.warn("lights camera already inited"), pe;
|
|
1077
|
+
const c = v();
|
|
1078
|
+
return Be = y(), pe = B(), d.value.forEach((a) => {
|
|
1079
|
+
const w = a === "key" ? pe : c, { group: E, light: L, directional: j, visualization: D } = M(
|
|
1080
|
+
a,
|
|
1081
|
+
w
|
|
1082
|
+
);
|
|
1083
|
+
Y[a] = L, We[a] = E, mt[a] = j, ye[a] = D, Y[a].castShadow = !0, Y[a].angle = Math.PI / 8, Y[a].penumbra = 0.2, Y[a].shadow.camera.near = 0.5, Y[a].shadow.camera.far = 12, Y[a].shadow.focus = 0.9, Y[a].shadow.mapSize.set(4096, 4096), Y[a].shadow.bias = -2e-4, Y[a].shadow.normalBias = 0.02, Y[a].shadow.radius = 2, Y[a].shadow.camera.updateProjectionMatrix();
|
|
1084
|
+
}), W(), k(), pe;
|
|
1085
|
+
}, C = () => {
|
|
1086
|
+
if (!pe)
|
|
1087
|
+
throw new Error("Light camera not initialized.");
|
|
1088
|
+
return pe;
|
|
1089
|
+
}, y = () => {
|
|
1090
|
+
const c = v(), a = new S.AmbientLight(f("key", "color"), 0.75);
|
|
1091
|
+
return c.add(a), a;
|
|
1092
|
+
}, B = () => {
|
|
1093
|
+
const c = v(), a = new S.PerspectiveCamera(
|
|
1094
|
+
75,
|
|
1095
|
+
n.value / r.value,
|
|
1096
|
+
0.1,
|
|
1097
|
+
100
|
|
1098
|
+
);
|
|
1099
|
+
return a.position.set(0, 0, 1.5), c.add(a), a;
|
|
1100
|
+
};
|
|
1101
|
+
function M(c, a = null) {
|
|
1102
|
+
const w = v(), E = new S.Group(), L = new S.SpotLight(
|
|
1103
|
+
f(c, "color"),
|
|
1104
|
+
f(c, "opacity")
|
|
1105
|
+
);
|
|
1106
|
+
L.position.set(0, 0, 0);
|
|
1107
|
+
const j = new S.DirectionalLight(f(c, "color"), 0.2);
|
|
1108
|
+
j.position.set(0, 0, 4), H(), L.target.position.set(0, 1, 0), L.target.updateMatrixWorld(), w.add(L.target), E.add(L), E.add(j);
|
|
1109
|
+
const D = yo(
|
|
1110
|
+
L,
|
|
1111
|
+
f(c, "visualizationColor")
|
|
1112
|
+
), F = o.isVisible(c);
|
|
1113
|
+
return D.visible = F, E.add(D), a.add(E), { group: E, light: L, directional: j, visualization: D };
|
|
1114
|
+
}
|
|
1115
|
+
const z = () => {
|
|
1116
|
+
H(), Q(), R();
|
|
1117
|
+
}, H = () => {
|
|
1118
|
+
Be && Be.color.set(f("key", "color"));
|
|
1119
|
+
const c = o.lights[l.value];
|
|
1120
|
+
c && Object.keys(c).forEach((a) => {
|
|
1121
|
+
const w = Y[a];
|
|
1122
|
+
if (!w) return;
|
|
1123
|
+
const E = f(a, "color"), L = f(a, "visible"), j = f(a, "opacity"), D = f(a, "shadow") || !1;
|
|
1124
|
+
if (E && w.color.set(E), w.visible = L, j != null && (w.intensity = j), w.castShadow = D, D) {
|
|
1125
|
+
const F = f(a, "shadowSettings", {});
|
|
1126
|
+
w.shadow.mapSize.set(
|
|
1127
|
+
F.width || 1024,
|
|
1128
|
+
F.height || 1024
|
|
1129
|
+
), w.shadow.camera.near = F.near || 0.5, w.shadow.camera.far = F.far || 50, w.shadow.needsUpdate = !0;
|
|
1130
|
+
}
|
|
1131
|
+
});
|
|
1132
|
+
}, Q = () => {
|
|
1133
|
+
const c = o.lights[l.value];
|
|
1134
|
+
c && Object.keys(c).forEach((a) => {
|
|
1135
|
+
if (!ye[a]) return console.warn(`${a} does not exist`);
|
|
1136
|
+
const w = o.isVisible(a);
|
|
1137
|
+
ye[a].visible = w, ye[a].material.color.set(f(a, "color"));
|
|
1138
|
+
});
|
|
1139
|
+
}, R = () => {
|
|
1140
|
+
const c = o.lights[l.value];
|
|
1141
|
+
c && Object.keys(c).forEach((a) => {
|
|
1142
|
+
const w = f(a, "debug") || i.value;
|
|
1143
|
+
!ie[a] && w && (ie[a] = I(a, Y[a]), Y[a].add(ie[a])), ie[a] && !w && (ie[a] = N(ie[a]));
|
|
1144
|
+
});
|
|
1145
|
+
}, I = (c, a) => {
|
|
1146
|
+
const w = v(), E = new S.SpotLightHelper(
|
|
1147
|
+
a,
|
|
1148
|
+
f(c, "visualizationColor")
|
|
1149
|
+
);
|
|
1150
|
+
return w.add(E), E;
|
|
1151
|
+
}, N = (c) => {
|
|
1152
|
+
const a = v();
|
|
1153
|
+
if (!(!a || !c))
|
|
1154
|
+
return a.remove(c), c.dispose(), c = null, c;
|
|
1155
|
+
}, W = () => {
|
|
1156
|
+
const c = C(), a = t.bounds;
|
|
1157
|
+
if (!a) return;
|
|
1158
|
+
const w = new S.Vector3(
|
|
1159
|
+
a.center.x,
|
|
1160
|
+
a.center.y,
|
|
1161
|
+
// + bounds.size.y + 0.05,
|
|
1162
|
+
a.center.z
|
|
1163
|
+
), E = new S.Vector3().subVectors(w, c.position).normalize(), L = new S.Vector3(
|
|
1164
|
+
E.x,
|
|
1165
|
+
0,
|
|
1166
|
+
E.z
|
|
1167
|
+
).normalize(), j = new S.Vector3(
|
|
1168
|
+
-L.z,
|
|
1169
|
+
0,
|
|
1170
|
+
L.x
|
|
1171
|
+
), F = 2 * c.position.distanceTo(w) / Math.sqrt(3), _ = 1, G = w.clone().add(j.clone().multiplyScalar(-F / _)).add(E.clone().multiplyScalar(Math.sqrt(3) * F / 2)), X = w.clone().add(j.clone().multiplyScalar(F / _)).add(E.clone().multiplyScalar(Math.sqrt(3) * F / 2));
|
|
1172
|
+
We.fill.position.copy(G), We.back.position.copy(X), d.value.forEach((J) => {
|
|
1173
|
+
var K, le, ue;
|
|
1174
|
+
const p = Y[J];
|
|
1175
|
+
p.shadow.needsUpdate = !0, p.target.position.copy(w), p.target.updateMatrixWorld(), (K = ye[J]) == null || K.lookAt(w), (ue = (le = ie[J]) == null ? void 0 : le.update) == null || ue.call(le);
|
|
1176
|
+
});
|
|
1177
|
+
}, x = (c) => {
|
|
1178
|
+
const a = o.lights[c];
|
|
1179
|
+
if (!a) return;
|
|
1180
|
+
const w = `watcher-${c}`;
|
|
1181
|
+
if (De.has(w)) return;
|
|
1182
|
+
const E = [];
|
|
1183
|
+
Object.keys(a).forEach((j) => {
|
|
1184
|
+
var D, F;
|
|
1185
|
+
(D = a[j]) != null && D.color && E.push(() => a[j].color), (F = a[j]) != null && F.visible && E.push(() => a[j].visible);
|
|
1186
|
+
});
|
|
1187
|
+
const L = U(
|
|
1188
|
+
() => E.map((j) => j()),
|
|
1189
|
+
z,
|
|
1190
|
+
{ deep: !0 }
|
|
1191
|
+
);
|
|
1192
|
+
De.set(w, L);
|
|
1193
|
+
}, V = (c) => {
|
|
1194
|
+
const a = `watcher-${c}`, w = De.get(a);
|
|
1195
|
+
w && (w(), De.delete(a));
|
|
1196
|
+
}, k = () => {
|
|
1197
|
+
qe.push(
|
|
1198
|
+
U(
|
|
1199
|
+
() => [u.value, l.value, g.value],
|
|
1200
|
+
() => z()
|
|
1201
|
+
)
|
|
1202
|
+
), qe.push(
|
|
1203
|
+
U(
|
|
1204
|
+
() => s.value,
|
|
1205
|
+
(c) => {
|
|
1206
|
+
c === !0 && W();
|
|
1207
|
+
}
|
|
1208
|
+
)
|
|
1209
|
+
), qe.push(
|
|
1210
|
+
U(
|
|
1211
|
+
() => l.value,
|
|
1212
|
+
(c, a) => {
|
|
1213
|
+
a && V(a), c != null && (x(c), Ht(z));
|
|
1214
|
+
},
|
|
1215
|
+
{ immediate: !0 }
|
|
1216
|
+
)
|
|
1217
|
+
);
|
|
1218
|
+
};
|
|
1219
|
+
return {
|
|
1220
|
+
init: A,
|
|
1221
|
+
updatePosition: W,
|
|
1222
|
+
getCamera: C,
|
|
1223
|
+
dispose: () => {
|
|
1224
|
+
const c = v();
|
|
1225
|
+
c && (qe.forEach((a) => a()), qe = [], De.forEach((a) => a()), De.clear(), Object.values(Y).forEach((a) => c.remove(a)), Object.values(mt).forEach((a) => c.remove(a)), Object.values(ie).forEach((a) => c.remove(a)), Object.values(ye).forEach((a) => {
|
|
1226
|
+
var w, E, L, j;
|
|
1227
|
+
c.remove(a), (E = (w = a.geometry) == null ? void 0 : w.dispose) == null || E.call(w), (j = (L = a.material) == null ? void 0 : L.dispose) == null || j.call(L);
|
|
1228
|
+
}), Be && c.remove(Be), We = {}, ie = {}, Y = {}, mt = {}, ye = {}, Be = null, pe = null);
|
|
1229
|
+
}
|
|
1230
|
+
};
|
|
1231
|
+
}, Mt = () => {
|
|
1232
|
+
const e = Me(), o = st(), { getCamera: t } = nt();
|
|
1233
|
+
return {
|
|
1234
|
+
activate: () => {
|
|
1235
|
+
o.setMode({
|
|
1236
|
+
mode: "lights",
|
|
1237
|
+
camera: t(),
|
|
1238
|
+
store: e,
|
|
1239
|
+
options: {
|
|
1240
|
+
enableZoom: !0,
|
|
1241
|
+
minDistance: 0.5,
|
|
1242
|
+
maxDistance: 10
|
|
1243
|
+
}
|
|
1244
|
+
});
|
|
1245
|
+
},
|
|
1246
|
+
frameToBounds: o.frameToBounds,
|
|
1247
|
+
syncToStore: o.syncToStore,
|
|
1248
|
+
applyFromStore: o.applyFromStore
|
|
1249
|
+
};
|
|
1250
|
+
};
|
|
1251
|
+
let me = null;
|
|
1252
|
+
const So = () => {
|
|
1253
|
+
const e = () => {
|
|
1254
|
+
const t = b(), s = de(), { loadingUrl: n } = $(s);
|
|
1255
|
+
return console.log("laodingUrl", n), me = new S.LoadingManager(), me.onStart = function(r, l, i) {
|
|
1256
|
+
n.url = r, t.loading.active = !0, t.loading.url = r, t.loading.percent = 0;
|
|
1257
|
+
}, me.onError = () => {
|
|
1258
|
+
n.url = null, t.loading.active = !1, t.loading.url = null;
|
|
1259
|
+
}, me.onLoad = function() {
|
|
1260
|
+
n.url = null, t.loading.active = !1, t.loading.url = null, t.loading.percent = 100;
|
|
1261
|
+
}, me.onProgress = function(r, l, i) {
|
|
1262
|
+
t.loading.percent = Math.round(l / i * 100);
|
|
1263
|
+
}, me;
|
|
1264
|
+
};
|
|
1265
|
+
return { get: () => (me || e(), me) };
|
|
1266
|
+
};
|
|
1267
|
+
let O = null, Oe = null, Ue = null;
|
|
1268
|
+
const xt = () => {
|
|
1269
|
+
const e = b(), { get: o } = we(), { getCamera: t } = Ae(), { width: s, height: n, subjectLoaded: r } = $(e);
|
|
1270
|
+
function l(g) {
|
|
1271
|
+
return console.debug("useRenderer init"), O ? (console.debug("renderer already inited"), O) : (O = new S.WebGLRenderer({ antialias: !0, alpha: !0 }), O.setSize(s.value, n.value), O.toneMapping = S.ACESFilmicToneMapping, O.toneMappingExposure = 1.2, O.shadowMap.enabled = !0, O.shadowMap.type = S.PCFSoftShadowMap, O.gammaFactor = 2.2, O.gammaOutput = !0, O.outputColorSpace = S.SRGBColorSpace, g && g.appendChild(O.domElement), e.loaded.renderer = !0, O);
|
|
1272
|
+
}
|
|
1273
|
+
const i = () => {
|
|
1274
|
+
if (!O) throw new Error("Renderer has not been initialized");
|
|
1275
|
+
return O;
|
|
1276
|
+
}, d = () => {
|
|
1277
|
+
const g = o(), v = t();
|
|
1278
|
+
!g || !v || O.render(g, v);
|
|
1279
|
+
};
|
|
1280
|
+
Oe = U(
|
|
1281
|
+
() => [s.value, n.value],
|
|
1282
|
+
([g, v]) => {
|
|
1283
|
+
!g || !v || !O || O.setSize(g, v);
|
|
1284
|
+
}
|
|
1285
|
+
), Ue = U(
|
|
1286
|
+
() => r.value,
|
|
1287
|
+
() => d()
|
|
1288
|
+
);
|
|
1289
|
+
function u() {
|
|
1290
|
+
console.debug("renderer disposed"), e.loaded.renderer = !1, Oe == null || Oe(), Ue == null || Ue(), Oe = null, Ue = null, O && (O.domElement.parentElement && O.domElement.parentElement.removeChild(O.domElement), O.dispose(), O = null);
|
|
1291
|
+
}
|
|
1292
|
+
return {
|
|
1293
|
+
init: l,
|
|
1294
|
+
get: i,
|
|
1295
|
+
dispose: u,
|
|
1296
|
+
render: d
|
|
1297
|
+
};
|
|
1298
|
+
}, jt = (e, o, t = {}) => {
|
|
1299
|
+
const { removeSpecular: s = !1, removeShininess: n = !1 } = t;
|
|
1300
|
+
e && e.traverse((r) => {
|
|
1301
|
+
if (!r.isMesh) return;
|
|
1302
|
+
(Array.isArray(r.material) ? r.material : [r.material]).forEach((i) => {
|
|
1303
|
+
i && (i.color && i.color.set(o), s && i.specular && i.specular.set(0), n && typeof i.shininess == "number" && (i.shininess = 0), i.needsUpdate = !0);
|
|
1304
|
+
});
|
|
1305
|
+
});
|
|
1306
|
+
};
|
|
1307
|
+
let ce = null, _e = null, ze, Ee, ht = 0;
|
|
1308
|
+
const Ft = () => {
|
|
1309
|
+
const { get: e } = So(), o = de(), t = b(), s = Ve(), { selected: n } = $(t), { color: r, url: l, loadingUrl: i } = $(o), { offset: d } = $(s), { getCamera: u } = Ae(), { get: g } = we(), { get: v, render: f } = xt();
|
|
1310
|
+
new S.Vector3();
|
|
1311
|
+
const A = (R, I) => {
|
|
1312
|
+
const N = I.load(
|
|
1313
|
+
"https://static.figurosity.com/3d/textures/stainless-steel/color.jpg"
|
|
1314
|
+
);
|
|
1315
|
+
return N.colorSpace = S.SRGBColorSpace, N.anisotropy = R.capabilities.getMaxAnisotropy(), _e = new S.MeshBasicMaterial({
|
|
1316
|
+
color: 16777215
|
|
1317
|
+
}), _e;
|
|
1318
|
+
}, C = (R) => {
|
|
1319
|
+
const { frameToBounds: I } = wt(), { frameToBounds: N } = Mt(), W = ++ht;
|
|
1320
|
+
t.subjectLoaded = !1, y();
|
|
1321
|
+
const x = v(), V = e(), k = new S.TextureLoader();
|
|
1322
|
+
A(x, k);
|
|
1323
|
+
const P = new po(V);
|
|
1324
|
+
P.setWithCredentials(!0), P.manager.setURLModifier((c) => c), P.load(R, (c) => {
|
|
1325
|
+
if (W !== ht) {
|
|
1326
|
+
c.traverse((_) => {
|
|
1327
|
+
var X;
|
|
1328
|
+
if (!_.isMesh) return;
|
|
1329
|
+
(X = _.geometry) == null || X.dispose();
|
|
1330
|
+
const G = _.material;
|
|
1331
|
+
Array.isArray(G) ? G.forEach((J) => J == null ? void 0 : J.dispose()) : G == null || G.dispose();
|
|
1332
|
+
});
|
|
1333
|
+
return;
|
|
1334
|
+
} else
|
|
1335
|
+
console.debug("currentLoad === loadVersion"), console.debug(`${W} === ${ht}`);
|
|
1336
|
+
if (!c) {
|
|
1337
|
+
console.debug("model not loaded");
|
|
1338
|
+
return;
|
|
1339
|
+
}
|
|
1340
|
+
ce = c;
|
|
1341
|
+
const a = g(), w = u(), E = new S.Group();
|
|
1342
|
+
E.name = "FBXSubject", E.add(c), c.traverse((_) => {
|
|
1343
|
+
_.isMesh && (_.castShadow = !0, _.receiveShadow = !0);
|
|
1344
|
+
}), jt(c, r.value, {
|
|
1345
|
+
removeSpecular: !0,
|
|
1346
|
+
removeShininess: !0
|
|
1347
|
+
});
|
|
1348
|
+
const L = new S.Box3().setFromObject(c), j = new S.Vector3();
|
|
1349
|
+
L.getSize(j), Math.max(j.x, j.y, j.z), c.scale.setScalar(0.01), c.updateMatrixWorld(!0);
|
|
1350
|
+
const D = Dt(c);
|
|
1351
|
+
E.position.y -= D.bottom, E.updateMatrixWorld(!0), a.add(E), ce = E;
|
|
1352
|
+
const F = Dt(E);
|
|
1353
|
+
o.setBounds(F), f(a, w), I(F), N(F), t.subjectLoaded = !0;
|
|
1354
|
+
});
|
|
1355
|
+
}, y = () => {
|
|
1356
|
+
if (console.log("removeSubject", ce), !ce) return;
|
|
1357
|
+
g().remove(ce), ce.traverse((I) => {
|
|
1358
|
+
var W;
|
|
1359
|
+
if (!I.isMesh) return;
|
|
1360
|
+
(W = I.geometry) == null || W.dispose();
|
|
1361
|
+
const N = I.material;
|
|
1362
|
+
Array.isArray(N) ? N.forEach((x) => x == null ? void 0 : x.dispose()) : N == null || N.dispose();
|
|
1363
|
+
}), ce = null, t.subjectLoaded = !1;
|
|
1364
|
+
}, B = () => {
|
|
1365
|
+
_e && (_e.dispose(), _e = null);
|
|
1366
|
+
}, M = (R) => {
|
|
1367
|
+
jt(ce, R, {
|
|
1368
|
+
removeSpecular: !0,
|
|
1369
|
+
removeShininess: !0
|
|
1370
|
+
});
|
|
1371
|
+
}, z = () => ce, H = () => {
|
|
1372
|
+
if (ze || Ee) {
|
|
1373
|
+
console.warn("useSubject.init() called more than once");
|
|
1374
|
+
return;
|
|
1375
|
+
}
|
|
1376
|
+
ze = U(
|
|
1377
|
+
() => n.value,
|
|
1378
|
+
(R, I) => {
|
|
1379
|
+
!R || R === I || (console.log("url", l.value), l.value && C(l.value));
|
|
1380
|
+
},
|
|
1381
|
+
{ immediate: !0 }
|
|
1382
|
+
), Ee = U(
|
|
1383
|
+
() => r.value,
|
|
1384
|
+
(R) => M(R)
|
|
1385
|
+
);
|
|
1386
|
+
}, Q = () => {
|
|
1387
|
+
console.debug("fbx disposed"), ze == null || ze(), Ee == null || Ee(), ze = null, Ee = null, y(), B();
|
|
1388
|
+
};
|
|
1389
|
+
return Rt(() => {
|
|
1390
|
+
Q();
|
|
1391
|
+
}), { init: H, get: z, dispose: Q, updateColor: M };
|
|
1392
|
+
}, xo = (e, o, t = 500) => {
|
|
1393
|
+
const s = e.material;
|
|
1394
|
+
s.transparent = !0;
|
|
1395
|
+
const n = s.opacity, r = performance.now(), l = (i) => {
|
|
1396
|
+
const d = i - r, u = Math.min(d / t, 1), g = n + (o - n) * u;
|
|
1397
|
+
s.opacity = g, u < 1 && requestAnimationFrame(l);
|
|
1398
|
+
};
|
|
1399
|
+
requestAnimationFrame(l);
|
|
1400
|
+
};
|
|
1401
|
+
let q = null, $e = null, Ie = null, Ne = null, Xe = null;
|
|
1402
|
+
const Pt = () => {
|
|
1403
|
+
const e = ke(), o = Ve(), t = de(), { show: s, lineColor: n, centerLineColor: r, divisions: l, size: i, opacity: d } = $(e), { offset: u } = $(o), { bounds: g } = $(t), { get: v } = we(), f = () => {
|
|
1404
|
+
const x = Q(n.value), V = Q(r.value), { positions: k, colors: P } = A({
|
|
1405
|
+
size: i.value,
|
|
1406
|
+
divisions: l.value,
|
|
1407
|
+
color: x,
|
|
1408
|
+
centerColor: V
|
|
1409
|
+
}), c = C(k, P), a = y(d.value);
|
|
1410
|
+
return new S.LineSegments(c, a);
|
|
1411
|
+
}, A = ({ size: x, divisions: V, color: k, centerColor: P }) => {
|
|
1412
|
+
const c = x / 2, a = x / V, w = [], E = [], L = Math.floor(V / 2), j = (D, F, _, G) => {
|
|
1413
|
+
w.push(D, F, _);
|
|
1414
|
+
const X = G ? P : k;
|
|
1415
|
+
E.push(X.r, X.g, X.b);
|
|
1416
|
+
};
|
|
1417
|
+
for (let D = 0; D <= V; D++) {
|
|
1418
|
+
const F = -c + D * a, _ = D === L;
|
|
1419
|
+
for (let G = 0; G <= V; G++) {
|
|
1420
|
+
const X = -c + G * a, p = _ || G === L;
|
|
1421
|
+
j(-c, F, X, p), j(+c, F, X, p);
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
for (let D = 0; D <= V; D++) {
|
|
1425
|
+
const F = -c + D * a, _ = D === L;
|
|
1426
|
+
for (let G = 0; G <= V; G++) {
|
|
1427
|
+
const X = -c + G * a, p = _ || G === L;
|
|
1428
|
+
j(F, -c, X, p), j(F, +c, X, p);
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
for (let D = 0; D <= V; D++) {
|
|
1432
|
+
const F = -c + D * a, _ = D === L;
|
|
1433
|
+
for (let G = 0; G <= V; G++) {
|
|
1434
|
+
const X = -c + G * a, p = _ || G === L;
|
|
1435
|
+
j(F, X, -c, p), j(F, X, +c, p);
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
return { positions: w, colors: E };
|
|
1439
|
+
}, C = (x, V) => {
|
|
1440
|
+
const k = new S.BufferGeometry();
|
|
1441
|
+
return k.setAttribute(
|
|
1442
|
+
"position",
|
|
1443
|
+
new S.Float32BufferAttribute(x, 3)
|
|
1444
|
+
), k.setAttribute("color", new S.Float32BufferAttribute(V, 3)), k;
|
|
1445
|
+
}, y = (x) => new S.LineBasicMaterial({
|
|
1446
|
+
transparent: !0,
|
|
1447
|
+
opacity: x,
|
|
1448
|
+
depthWrite: !1,
|
|
1449
|
+
blending: S.NormalBlending,
|
|
1450
|
+
vertexColors: !1
|
|
1451
|
+
}), B = () => {
|
|
1452
|
+
q && H(s.value);
|
|
1453
|
+
}, M = () => {
|
|
1454
|
+
const x = v();
|
|
1455
|
+
q = f(n.value), N(), x.add(q), z(0);
|
|
1456
|
+
}, z = (x) => {
|
|
1457
|
+
q && (q.material.transparent = !0, x = s.value ? x : 0, q.material.opacity = x);
|
|
1458
|
+
}, H = (x) => {
|
|
1459
|
+
const V = x ? d.value : 0;
|
|
1460
|
+
xo(q, V, 500);
|
|
1461
|
+
}, Q = (x) => ({
|
|
1462
|
+
r: (x >> 16 & 255) / 255,
|
|
1463
|
+
g: (x >> 8 & 255) / 255,
|
|
1464
|
+
b: (x & 255) / 255
|
|
1465
|
+
}), R = (x, V) => {
|
|
1466
|
+
if (!q) return;
|
|
1467
|
+
const k = Q(x), P = Q(V), c = q.geometry.attributes.color, a = q.geometry.attributes.position, w = a.count, E = i.value / 2, L = i.value / l.value, j = Math.floor(l.value / 2);
|
|
1468
|
+
for (let D = 0; D < w; D++) {
|
|
1469
|
+
const F = a.getX(D), _ = a.getY(D), G = a.getZ(D), X = Math.round((F + E) / L), J = Math.round((_ + E) / L), p = Math.round((G + E) / L), le = X === j || J === j || p === j ? k : P;
|
|
1470
|
+
c.setXYZ(D, le.r, le.g, le.b);
|
|
1471
|
+
}
|
|
1472
|
+
c.needsUpdate = !0;
|
|
1473
|
+
}, I = () => {
|
|
1474
|
+
const x = v();
|
|
1475
|
+
q && (x.remove(q), q.geometry.dispose(), q.material.dispose(), q = null), q = f(n.value), N(), x.add(q);
|
|
1476
|
+
}, N = () => {
|
|
1477
|
+
var V;
|
|
1478
|
+
const x = ((V = g.value) == null ? void 0 : V.bottom) || 0;
|
|
1479
|
+
q.position.set(0, x + i.value / 2 + 7e-3, 0);
|
|
1480
|
+
};
|
|
1481
|
+
return $e = U(
|
|
1482
|
+
() => [i.value, l.value],
|
|
1483
|
+
([x, V], [k, P]) => {
|
|
1484
|
+
x === k && V === P || (I(), B());
|
|
1485
|
+
},
|
|
1486
|
+
{ flush: "post" }
|
|
1487
|
+
), Ie = U(
|
|
1488
|
+
() => s.value,
|
|
1489
|
+
() => {
|
|
1490
|
+
B();
|
|
1491
|
+
},
|
|
1492
|
+
{ flush: "post" }
|
|
1493
|
+
), Ne = U(
|
|
1494
|
+
() => d.value,
|
|
1495
|
+
(x) => {
|
|
1496
|
+
z(x);
|
|
1497
|
+
},
|
|
1498
|
+
{ flush: "post" }
|
|
1499
|
+
), Xe = U(
|
|
1500
|
+
() => [n.value, r.value],
|
|
1501
|
+
([x, V]) => {
|
|
1502
|
+
R(V, x);
|
|
1503
|
+
}
|
|
1504
|
+
), {
|
|
1505
|
+
init: M,
|
|
1506
|
+
showHideGrid: H,
|
|
1507
|
+
updateGridColors: R,
|
|
1508
|
+
dispose: () => {
|
|
1509
|
+
var V, k;
|
|
1510
|
+
const x = v();
|
|
1511
|
+
$e == null || $e(), Ie == null || Ie(), Ne == null || Ne(), Xe == null || Xe(), $e = null, Ie = null, Ne = null, Xe = null, q && (x.remove(q), (V = q.geometry) == null || V.dispose(), Array.isArray(q.material) ? q.material.forEach((P) => P == null ? void 0 : P.dispose()) : (k = q.material) == null || k.dispose(), q = null);
|
|
1512
|
+
}
|
|
1513
|
+
};
|
|
1514
|
+
}, Co = { class: "three-dimension-tool" }, wo = ["data-id"], Mo = /* @__PURE__ */ Object.assign({
|
|
1515
|
+
name: "ThreeDimensionTool",
|
|
1516
|
+
slug: "three-dimension-tool",
|
|
1517
|
+
inheritAttrs: !1
|
|
1518
|
+
}, {
|
|
1519
|
+
__name: "ThreeDimensionTool",
|
|
1520
|
+
props: {
|
|
1521
|
+
id: Number
|
|
1522
|
+
},
|
|
1523
|
+
setup(e) {
|
|
1524
|
+
const o = e;
|
|
1525
|
+
let t = null;
|
|
1526
|
+
const s = h(() => Number(o.id)), n = b(), r = Me(), l = de(), { move: i } = $(r), d = te(null), u = te(!1);
|
|
1527
|
+
let g, v, f;
|
|
1528
|
+
const A = st(), C = wt(), y = Mt(), { init: B } = we(), { init: M } = xt(), { init: z } = Ae(), { init: H, updateVisibility: Q } = Lt(), { init: R, updatePosition: I } = nt(), { init: N } = Ft(), { init: W } = Pt(), x = () => {
|
|
1529
|
+
if (!d.value || u.value) {
|
|
1530
|
+
console.warn("Canvas element not found");
|
|
1531
|
+
return;
|
|
1532
|
+
}
|
|
1533
|
+
u.value = !0, f = B(), v = M(d.value), N(), g = z(), R(), W(), H(), A.init(v), V();
|
|
1534
|
+
}, V = () => {
|
|
1535
|
+
u.value && (i.value !== t && (t = i.value, i.value ? y.activate() : C.activate()), A.update(), i.value ? (I(), y.syncToStore()) : C.syncToStore(), Q(), v.render(f, g), requestAnimationFrame(V));
|
|
1536
|
+
}, k = () => {
|
|
1537
|
+
if (d.value) {
|
|
1538
|
+
const P = window.innerWidth, c = window.innerHeight;
|
|
1539
|
+
n.$patch({ width: P, height: c }), d.value.style.height = c + "px";
|
|
1540
|
+
}
|
|
1541
|
+
};
|
|
1542
|
+
return Zt(() => {
|
|
1543
|
+
console.log("onMounted", d.value), x(), window.addEventListener("resize", k), k();
|
|
1544
|
+
}), U(
|
|
1545
|
+
() => l.bounds,
|
|
1546
|
+
(P) => {
|
|
1547
|
+
P && (A.frameToBounds(P), y.activate(), y.frameToBounds(P), y.syncToStore(), C.activate(), C.frameToBounds(P), C.syncToStore());
|
|
1548
|
+
}
|
|
1549
|
+
), U(
|
|
1550
|
+
() => n.subjectLoaded,
|
|
1551
|
+
(P) => {
|
|
1552
|
+
if (!P) return;
|
|
1553
|
+
const c = l.bounds;
|
|
1554
|
+
if (!c) return;
|
|
1555
|
+
A.frameToBounds(c);
|
|
1556
|
+
const a = A.get();
|
|
1557
|
+
a.update(), a.saveState();
|
|
1558
|
+
}
|
|
1559
|
+
), Rt(() => {
|
|
1560
|
+
console.debug("ThreeDimensionTool unMounted"), window.removeEventListener("resize", this), u.value = !1, Ft().dispose(), Pt().dispose(), Lt().dispose(), nt().dispose(), st().dispose(), Ae().dispose(), we().dispose(), xt().dispose();
|
|
1561
|
+
}), (P, c) => (Je(), Kt("div", Co, [
|
|
1562
|
+
gt("", !0),
|
|
1563
|
+
Yt("div", {
|
|
1564
|
+
class: "tres",
|
|
1565
|
+
ref_key: "tres",
|
|
1566
|
+
ref: d,
|
|
1567
|
+
"data-id": s.value
|
|
1568
|
+
}, null, 8, wo)
|
|
1569
|
+
]));
|
|
1570
|
+
}
|
|
1571
|
+
}), Gt = /* @__PURE__ */ Object.assign({ "../i18n/en-US/index.js": () => import("./index-CIql5zKW.js") }), ee = (e = "../i18n") => {
|
|
1572
|
+
const o = so(), t = te({}), s = h(() => o.lang.isoName || "en-US"), n = async () => {
|
|
1573
|
+
const r = `${e}/${s.value}/index.js`;
|
|
1574
|
+
if (Gt[r])
|
|
1575
|
+
try {
|
|
1576
|
+
const l = await Gt[r]();
|
|
1577
|
+
l.default && Object.assign(t.value, l.default);
|
|
1578
|
+
} catch (l) {
|
|
1579
|
+
console.error(`Error loading i18n for ${s.value}`, l);
|
|
1580
|
+
}
|
|
1581
|
+
else
|
|
1582
|
+
console.error(`Module not found: ${r}`);
|
|
1583
|
+
};
|
|
1584
|
+
return U(
|
|
1585
|
+
() => s.value,
|
|
1586
|
+
() => {
|
|
1587
|
+
n();
|
|
1588
|
+
},
|
|
1589
|
+
{ immediate: !0 }
|
|
1590
|
+
), Qt(() => {
|
|
1591
|
+
n();
|
|
1592
|
+
}), { lang: t };
|
|
1593
|
+
}, be = ({ tab: e = se, store: o, options: t = [] }) => {
|
|
1594
|
+
const s = ao(), n = b(s), r = h({
|
|
1595
|
+
get: () => n.isExpanded(t),
|
|
1596
|
+
set: (d) => {
|
|
1597
|
+
d && n.setActive(e);
|
|
1598
|
+
}
|
|
1599
|
+
}), l = h(() => o && o.changed);
|
|
1600
|
+
return { click: () => n.setActive(e), expanded: r, selected: l };
|
|
1601
|
+
}, kt = Z({
|
|
1602
|
+
name: "ToolResetButton",
|
|
1603
|
+
props: {
|
|
1604
|
+
label: { type: String, required: !1, default: "Reset" },
|
|
1605
|
+
disable: Boolean
|
|
1606
|
+
},
|
|
1607
|
+
emits: ["click"],
|
|
1608
|
+
setup(e, { slots: o, emit: t }) {
|
|
1609
|
+
function s() {
|
|
1610
|
+
t("click");
|
|
1611
|
+
}
|
|
1612
|
+
function n() {
|
|
1613
|
+
const r = {
|
|
1614
|
+
label: e.label,
|
|
1615
|
+
class: "full-width",
|
|
1616
|
+
flat: !0,
|
|
1617
|
+
onClick: s,
|
|
1618
|
+
disable: e.disable
|
|
1619
|
+
};
|
|
1620
|
+
return m("div", { class: "tool-reset-button q-pa-md" }, m(qt, r));
|
|
1621
|
+
}
|
|
1622
|
+
return () => n();
|
|
1623
|
+
}
|
|
1624
|
+
}), _t = Z({
|
|
1625
|
+
name: "TdColorsSection",
|
|
1626
|
+
setup(e, { slots: o, emit: t }) {
|
|
1627
|
+
const { lang: s } = ee(), n = b(), r = lt(), l = de(), i = Ve(), { active: d } = $(n), u = te(!1), g = te(!1), v = te(!1), f = h(
|
|
1628
|
+
() => {
|
|
1629
|
+
var k;
|
|
1630
|
+
return (k = s.value.td) == null ? void 0 : k.components.colors.items.background;
|
|
1631
|
+
}
|
|
1632
|
+
), A = h(
|
|
1633
|
+
() => {
|
|
1634
|
+
var k;
|
|
1635
|
+
return (k = s.value.td) == null ? void 0 : k.components.colors.items.subject;
|
|
1636
|
+
}
|
|
1637
|
+
), C = h(
|
|
1638
|
+
() => {
|
|
1639
|
+
var k;
|
|
1640
|
+
return (k = s.value.td) == null ? void 0 : k.components.colors.items.ground;
|
|
1641
|
+
}
|
|
1642
|
+
), y = h(() => ({
|
|
1643
|
+
key: A.value,
|
|
1644
|
+
label: A.value,
|
|
1645
|
+
type: "none",
|
|
1646
|
+
icon: "f_subject",
|
|
1647
|
+
size: "sm",
|
|
1648
|
+
color: l.colorHex,
|
|
1649
|
+
onClick: () => g.value = !0
|
|
1650
|
+
})), B = h(() => ({
|
|
1651
|
+
key: f.value,
|
|
1652
|
+
label: f.value,
|
|
1653
|
+
type: "none",
|
|
1654
|
+
icon: "f_scene",
|
|
1655
|
+
size: "sm",
|
|
1656
|
+
color: r.colorHex,
|
|
1657
|
+
onClick: () => u.value = !0
|
|
1658
|
+
})), M = h(() => ({
|
|
1659
|
+
key: C.value,
|
|
1660
|
+
label: C.value,
|
|
1661
|
+
type: "none",
|
|
1662
|
+
icon: "f_ground",
|
|
1663
|
+
size: "sm",
|
|
1664
|
+
color: i.colorHex,
|
|
1665
|
+
onClick: () => v.value = !0
|
|
1666
|
+
})), z = h({
|
|
1667
|
+
get: () => v.value || u.value || g.value,
|
|
1668
|
+
set: (k) => v.value = u.value = g.value = !1
|
|
1669
|
+
}), H = h({
|
|
1670
|
+
get: () => v.value ? i.colorHex : u.value ? r.colorHex : l.colorHex,
|
|
1671
|
+
set: (k) => {
|
|
1672
|
+
if (console.log("showGround", v.value), v.value) {
|
|
1673
|
+
console.log("val", k), i.setColorHex(k);
|
|
1674
|
+
return;
|
|
1675
|
+
}
|
|
1676
|
+
if (u.value) {
|
|
1677
|
+
r.setColorHex(k);
|
|
1678
|
+
return;
|
|
1679
|
+
}
|
|
1680
|
+
l.setColorHex(k);
|
|
1681
|
+
}
|
|
1682
|
+
}), Q = h(() => ({
|
|
1683
|
+
class: "td-colors-tool q-pa-xs row justify-center items-center q-gutter-md",
|
|
1684
|
+
style: z.value ? "display: none" : ""
|
|
1685
|
+
})), R = h(() => ({
|
|
1686
|
+
modelValue: H.value,
|
|
1687
|
+
"onUpdate:modelValue": (k) => H.value = k,
|
|
1688
|
+
show: z.value,
|
|
1689
|
+
"onUpdate:show": (k) => z.value = k,
|
|
1690
|
+
label: I.value
|
|
1691
|
+
})), I = h(() => v.value ? C.value : u.value ? f.value : A.value), N = () => {
|
|
1692
|
+
r.reset(), l.resetColor(), i.reset();
|
|
1693
|
+
}, W = h(() => l.changed || i.changed || r.changed), x = h(() => ({
|
|
1694
|
+
label: "Reset Colors",
|
|
1695
|
+
onClick: N,
|
|
1696
|
+
style: z.value ? "display: none" : "",
|
|
1697
|
+
disable: !W.value
|
|
1698
|
+
}));
|
|
1699
|
+
U(d, (k) => {
|
|
1700
|
+
k !== se && (z.value = !1);
|
|
1701
|
+
});
|
|
1702
|
+
function V() {
|
|
1703
|
+
return m("div", {
|
|
1704
|
+
class: "full-width"
|
|
1705
|
+
// style: pickerShow.value ? 'display: none' : '',
|
|
1706
|
+
}, [
|
|
1707
|
+
m("div", Q.value, [
|
|
1708
|
+
m(re, y.value),
|
|
1709
|
+
m(re, B.value),
|
|
1710
|
+
m(re, M.value)
|
|
1711
|
+
]),
|
|
1712
|
+
m(kt, x.value),
|
|
1713
|
+
m(Ot, R.value)
|
|
1714
|
+
]);
|
|
1715
|
+
}
|
|
1716
|
+
return () => V();
|
|
1717
|
+
}
|
|
1718
|
+
}), ko = Z({
|
|
1719
|
+
name: "TdColorsExpansion",
|
|
1720
|
+
props: {
|
|
1721
|
+
modelValue: { type: Number, default: 0 },
|
|
1722
|
+
"onUpdate:modelValue": [Function, Array],
|
|
1723
|
+
label: { type: String, required: !1 }
|
|
1724
|
+
},
|
|
1725
|
+
emits: ["click", "update:modelValue"],
|
|
1726
|
+
setup(e, { slots: o, emit: t }) {
|
|
1727
|
+
const { lang: s } = ee(), n = Ut(), { expanded: r, selected: l } = be({
|
|
1728
|
+
store: n,
|
|
1729
|
+
options: se,
|
|
1730
|
+
tab: se
|
|
1731
|
+
}), i = h(() => {
|
|
1732
|
+
var u;
|
|
1733
|
+
return (u = s.value.td) == null ? void 0 : u.components.colors.title;
|
|
1734
|
+
});
|
|
1735
|
+
h({
|
|
1736
|
+
get: () => e.modelValue,
|
|
1737
|
+
set: (u) => t("update:modelValue", u)
|
|
1738
|
+
});
|
|
1739
|
+
function d() {
|
|
1740
|
+
const u = {
|
|
1741
|
+
class: "td-colors-expansion",
|
|
1742
|
+
"data-cy": "td-colors-expansion",
|
|
1743
|
+
modelValue: r.value,
|
|
1744
|
+
"onUpdate:modelValue": (g) => r.value = g,
|
|
1745
|
+
label: i.value,
|
|
1746
|
+
selected: l.value,
|
|
1747
|
+
icon: "f_palette"
|
|
1748
|
+
};
|
|
1749
|
+
return m(rt, u, () => m(_t));
|
|
1750
|
+
}
|
|
1751
|
+
return () => d();
|
|
1752
|
+
}
|
|
1753
|
+
}), $t = Z({
|
|
1754
|
+
name: "TdGridSection",
|
|
1755
|
+
setup(e, { slots: o, emit: t }) {
|
|
1756
|
+
const { lang: s } = ee(), n = ke(), r = h(
|
|
1757
|
+
() => {
|
|
1758
|
+
var f, A;
|
|
1759
|
+
return l.value ? ((f = s.value.td) == null ? void 0 : f.components.grid.toggle.off) || "" : ((A = s.value.td) == null ? void 0 : A.components.grid.toggle.on) || "";
|
|
1760
|
+
}
|
|
1761
|
+
), l = h({
|
|
1762
|
+
get: () => n.show,
|
|
1763
|
+
set: (f) => n.setProperty("show", f)
|
|
1764
|
+
}), i = h({
|
|
1765
|
+
get: () => n.opacity,
|
|
1766
|
+
set: (f) => n.setProperty("opacity", f)
|
|
1767
|
+
}), d = h({
|
|
1768
|
+
get: () => n.size,
|
|
1769
|
+
set: (f) => n.setProperty("size", f)
|
|
1770
|
+
}), u = h({
|
|
1771
|
+
get: () => n.divisions,
|
|
1772
|
+
set: (f) => n.setProperty("divisions", f)
|
|
1773
|
+
}), g = h(() => ({
|
|
1774
|
+
label: "Reset Grid",
|
|
1775
|
+
disable: !n.changed,
|
|
1776
|
+
onClick: n.reset
|
|
1777
|
+
}));
|
|
1778
|
+
function v() {
|
|
1779
|
+
const f = {
|
|
1780
|
+
class: "td-grid-tool"
|
|
1781
|
+
}, A = {
|
|
1782
|
+
access: "grd",
|
|
1783
|
+
// drawer: !props.noIcons,
|
|
1784
|
+
modelValue: l.value,
|
|
1785
|
+
"onUpdate:modelValue": (z) => l.value = z,
|
|
1786
|
+
label: r.value
|
|
1787
|
+
// dark: props.dark,
|
|
1788
|
+
// disable: props.disable,
|
|
1789
|
+
// hasAccess: props.hasAccess,
|
|
1790
|
+
// onBlockAccess: emitBlockAccess,
|
|
1791
|
+
}, C = {
|
|
1792
|
+
title: "Opacity",
|
|
1793
|
+
icon: "f_opacity",
|
|
1794
|
+
min: 1,
|
|
1795
|
+
max: 100,
|
|
1796
|
+
initial: 50,
|
|
1797
|
+
modelValue: i.value * 100,
|
|
1798
|
+
"onUpdate:modelValue": (z) => i.value = z / 100
|
|
1799
|
+
}, y = {
|
|
1800
|
+
title: "Size",
|
|
1801
|
+
icon: "f_size",
|
|
1802
|
+
min: 100,
|
|
1803
|
+
max: 300,
|
|
1804
|
+
initial: 200,
|
|
1805
|
+
modelValue: d.value * 100,
|
|
1806
|
+
"onUpdate:modelValue": (z) => d.value = z / 100
|
|
1807
|
+
}, B = {
|
|
1808
|
+
title: "Number of lines",
|
|
1809
|
+
icon: "f_grid",
|
|
1810
|
+
min: 2,
|
|
1811
|
+
max: 10,
|
|
1812
|
+
initial: 6,
|
|
1813
|
+
modelValue: u.value,
|
|
1814
|
+
"onUpdate:modelValue": (z) => u.value = z
|
|
1815
|
+
}, M = [m(Ze, A)];
|
|
1816
|
+
return l.value && (M.push(m(dt, y)), M.push(m(dt, B)), M.push(m(dt, C)), M.push(m(kt, g.value))), m("div", f, M);
|
|
1817
|
+
}
|
|
1818
|
+
return () => v();
|
|
1819
|
+
}
|
|
1820
|
+
}), Bo = Z({
|
|
1821
|
+
name: "TdGridExpansion",
|
|
1822
|
+
props: {
|
|
1823
|
+
modelValue: { type: Number, default: 0 },
|
|
1824
|
+
"onUpdate:modelValue": [Function, Array],
|
|
1825
|
+
label: { type: String, required: !1 }
|
|
1826
|
+
},
|
|
1827
|
+
emits: ["click", "update:modelValue"],
|
|
1828
|
+
setup(e, { slots: o, emit: t }) {
|
|
1829
|
+
const { lang: s } = ee(), n = ke(), { expanded: r, selected: l } = be({
|
|
1830
|
+
store: n,
|
|
1831
|
+
options: Se,
|
|
1832
|
+
tab: Se
|
|
1833
|
+
}), i = h(() => {
|
|
1834
|
+
var u;
|
|
1835
|
+
return (u = s.value.td) == null ? void 0 : u.components.grid.title;
|
|
1836
|
+
});
|
|
1837
|
+
h({
|
|
1838
|
+
get: () => e.modelValue,
|
|
1839
|
+
set: (u) => t("update:modelValue", u)
|
|
1840
|
+
});
|
|
1841
|
+
function d() {
|
|
1842
|
+
const u = {
|
|
1843
|
+
class: "td-colors-expansion",
|
|
1844
|
+
"data-cy": "td-colors-expansion",
|
|
1845
|
+
modelValue: r.value,
|
|
1846
|
+
"onUpdate:modelValue": (g) => r.value = g,
|
|
1847
|
+
label: i.value,
|
|
1848
|
+
selected: l.value,
|
|
1849
|
+
icon: "f_grid"
|
|
1850
|
+
};
|
|
1851
|
+
return m(rt, u, () => m($t));
|
|
1852
|
+
}
|
|
1853
|
+
return () => d();
|
|
1854
|
+
}
|
|
1855
|
+
}), It = Z({
|
|
1856
|
+
name: "TdLightsSection",
|
|
1857
|
+
props: {
|
|
1858
|
+
modelValue: { type: Number, default: 0 },
|
|
1859
|
+
"onUpdate:modelValue": [Function, Array],
|
|
1860
|
+
label: { type: String, required: !1 }
|
|
1861
|
+
},
|
|
1862
|
+
emits: ["click", "update:modelValue"],
|
|
1863
|
+
setup(e, { slots: o, emit: t }) {
|
|
1864
|
+
const { lang: s } = ee(), n = Me(), r = b(), l = nt(), { active: i } = $(r), d = h({
|
|
1865
|
+
get: () => n.advancedMode,
|
|
1866
|
+
set: (p) => n.setAdvanced(p)
|
|
1867
|
+
}), u = h({
|
|
1868
|
+
get: () => n.move,
|
|
1869
|
+
set: (p) => n.setMove(p)
|
|
1870
|
+
}), g = h(
|
|
1871
|
+
() => {
|
|
1872
|
+
var p, K;
|
|
1873
|
+
return n.advancedMode ? ((p = s.value.td) == null ? void 0 : p.components.lights.toggles.advanced.off) || "" : ((K = s.value.td) == null ? void 0 : K.components.lights.toggles.advanced.on) || "";
|
|
1874
|
+
}
|
|
1875
|
+
), v = h(() => ({
|
|
1876
|
+
modelValue: d.value,
|
|
1877
|
+
"onUpdate:modelValue": (p) => d.value = p,
|
|
1878
|
+
label: g.value
|
|
1879
|
+
})), f = h(
|
|
1880
|
+
() => {
|
|
1881
|
+
var p, K;
|
|
1882
|
+
return n.move ? ((p = s.value.td) == null ? void 0 : p.components.lights.toggles.position.off) || "" : ((K = s.value.td) == null ? void 0 : K.components.lights.toggles.position.on) || "";
|
|
1883
|
+
}
|
|
1884
|
+
), A = h(() => ({
|
|
1885
|
+
modelValue: u.value,
|
|
1886
|
+
"onUpdate:modelValue": (p) => u.value = p,
|
|
1887
|
+
label: f.value
|
|
1888
|
+
})), C = h(
|
|
1889
|
+
() => {
|
|
1890
|
+
var p;
|
|
1891
|
+
return ((p = s.value.td) == null ? void 0 : p.components.lights.color) || "";
|
|
1892
|
+
}
|
|
1893
|
+
), y = te(!1), B = h(() => ({
|
|
1894
|
+
key: C.value,
|
|
1895
|
+
label: C.value,
|
|
1896
|
+
type: "none",
|
|
1897
|
+
icon: "f_bulb_light",
|
|
1898
|
+
size: "sm",
|
|
1899
|
+
color: n.colorHex("key"),
|
|
1900
|
+
onClick: () => y.value = !0
|
|
1901
|
+
})), M = h(
|
|
1902
|
+
() => {
|
|
1903
|
+
var p;
|
|
1904
|
+
return ((p = s.value.td) == null ? void 0 : p.components.lights.labels.key) || "";
|
|
1905
|
+
}
|
|
1906
|
+
), z = te(!1), H = h({
|
|
1907
|
+
get: () => n.colorHex("key"),
|
|
1908
|
+
set: (p) => n.setColorHex("key", p)
|
|
1909
|
+
}), Q = h(() => ({
|
|
1910
|
+
key: M.value,
|
|
1911
|
+
label: M.value,
|
|
1912
|
+
type: "none",
|
|
1913
|
+
icon: "f_bulb_key",
|
|
1914
|
+
size: "sm",
|
|
1915
|
+
color: H.value,
|
|
1916
|
+
onClick: () => z.value = !0
|
|
1917
|
+
})), R = h(
|
|
1918
|
+
() => {
|
|
1919
|
+
var p;
|
|
1920
|
+
return ((p = s.value.td) == null ? void 0 : p.components.lights.labels.back) || "";
|
|
1921
|
+
}
|
|
1922
|
+
), I = te(!1), N = h({
|
|
1923
|
+
get: () => n.colorHex("back"),
|
|
1924
|
+
set: (p) => n.setColorHex("back", p)
|
|
1925
|
+
}), W = h(() => ({
|
|
1926
|
+
key: R.value,
|
|
1927
|
+
label: R.value,
|
|
1928
|
+
type: "none",
|
|
1929
|
+
icon: "f_bulb_back",
|
|
1930
|
+
size: "sm",
|
|
1931
|
+
color: N.value,
|
|
1932
|
+
onClick: () => I.value = !0,
|
|
1933
|
+
disable: !V.value
|
|
1934
|
+
})), x = h(
|
|
1935
|
+
() => {
|
|
1936
|
+
var p, K;
|
|
1937
|
+
return V.value ? ((p = s.value.td) == null ? void 0 : p.components.lights.toggles.back.off) || "" : ((K = s.value.td) == null ? void 0 : K.components.lights.toggles.back.on) || "";
|
|
1938
|
+
}
|
|
1939
|
+
), V = h({
|
|
1940
|
+
get: () => n.property("back", "visible", !0),
|
|
1941
|
+
set: (p) => n.setProperty("back", "visible", p)
|
|
1942
|
+
}), k = h(() => ({
|
|
1943
|
+
modelValue: V.value,
|
|
1944
|
+
"onUpdate:modelValue": (p) => V.value = p,
|
|
1945
|
+
label: x.value
|
|
1946
|
+
})), P = h(
|
|
1947
|
+
() => {
|
|
1948
|
+
var p;
|
|
1949
|
+
return ((p = s.value.td) == null ? void 0 : p.components.lights.labels.fill) || "";
|
|
1950
|
+
}
|
|
1951
|
+
), c = te(!1), a = h({
|
|
1952
|
+
get: () => n.colorHex("fill"),
|
|
1953
|
+
set: (p) => n.setColorHex("fill", p)
|
|
1954
|
+
}), w = h(() => ({
|
|
1955
|
+
key: P.value,
|
|
1956
|
+
label: P.value,
|
|
1957
|
+
type: "none",
|
|
1958
|
+
icon: "f_bulb_fill",
|
|
1959
|
+
size: "sm",
|
|
1960
|
+
color: a.value,
|
|
1961
|
+
onClick: () => c.value = !0,
|
|
1962
|
+
disable: !L.value
|
|
1963
|
+
})), E = h(
|
|
1964
|
+
() => {
|
|
1965
|
+
var p, K;
|
|
1966
|
+
return L.value ? ((p = s.value.td) == null ? void 0 : p.components.lights.toggles.fill.off) || "" : ((K = s.value.td) == null ? void 0 : K.components.lights.toggles.fill.on) || "";
|
|
1967
|
+
}
|
|
1968
|
+
), L = h({
|
|
1969
|
+
get: () => n.property("fill", "visible", !0),
|
|
1970
|
+
set: (p) => n.setProperty("fill", "visible", p)
|
|
1971
|
+
}), j = h(() => ({
|
|
1972
|
+
modelValue: L.value,
|
|
1973
|
+
"onUpdate:modelValue": (p) => L.value = p,
|
|
1974
|
+
label: E.value
|
|
1975
|
+
})), D = h({
|
|
1976
|
+
get: () => y.value || z.value || c.value || I.value,
|
|
1977
|
+
set: (p) => y.value = z.value = c.value = I.value = !1
|
|
1978
|
+
}), F = h({
|
|
1979
|
+
get: () => y.value || z.value ? n.colorHex("key") : c.value ? n.colorHex("fill") : n.colorHex("back"),
|
|
1980
|
+
set: (p) => {
|
|
1981
|
+
if (y.value || z.value) {
|
|
1982
|
+
n.setColorHex("key", p);
|
|
1983
|
+
return;
|
|
1984
|
+
}
|
|
1985
|
+
if (c.value) {
|
|
1986
|
+
n.setColorHex("fill", p);
|
|
1987
|
+
return;
|
|
1988
|
+
}
|
|
1989
|
+
n.setColorHex("back", p);
|
|
1990
|
+
}
|
|
1991
|
+
}), _ = h(() => ({
|
|
1992
|
+
modelValue: F.value,
|
|
1993
|
+
"onUpdate:modelValue": (p) => F.value = p,
|
|
1994
|
+
show: D.value,
|
|
1995
|
+
"onUpdate:show": (p) => D.value = p,
|
|
1996
|
+
label: G.value
|
|
1997
|
+
})), G = h(() => y.value ? C.value : z.value ? M.value : c.value ? P.value : R.value), X = h(() => ({
|
|
1998
|
+
label: "Reset Lights",
|
|
1999
|
+
disable: !n.changed,
|
|
2000
|
+
onClick: () => {
|
|
2001
|
+
n.reset(), l.applyFromStore();
|
|
2002
|
+
}
|
|
2003
|
+
}));
|
|
2004
|
+
U(d, (p) => {
|
|
2005
|
+
p || (L.value = !0, V.value = !0);
|
|
2006
|
+
}), U(i, (p) => {
|
|
2007
|
+
p !== ge && (D.value = !1, u.value = !1);
|
|
2008
|
+
});
|
|
2009
|
+
function J() {
|
|
2010
|
+
const p = {
|
|
2011
|
+
class: "td-lights-tool"
|
|
2012
|
+
};
|
|
2013
|
+
let K = [];
|
|
2014
|
+
if (D.value)
|
|
2015
|
+
K = [m(Ot, _.value)];
|
|
2016
|
+
else {
|
|
2017
|
+
const le = {
|
|
2018
|
+
class: "td-colors-tool q-pa-xs row justify-center items-center q-gutter-md"
|
|
2019
|
+
}, ue = [];
|
|
2020
|
+
d.value ? (ue.push(m(re, Q.value)), ue.push(m(re, w.value)), ue.push(m(re, W.value))) : ue.push(m(re, B.value));
|
|
2021
|
+
const Le = [];
|
|
2022
|
+
Le.push(m(Ze, A.value)), d.value && (Le.push(m(Ze, j.value)), Le.push(m(Ze, k.value))), Le.push(m(Ze, v.value)), K = [m("div", le, ue), ...Le], K.push(m(kt, X.value));
|
|
2023
|
+
}
|
|
2024
|
+
return m("div", p, K);
|
|
2025
|
+
}
|
|
2026
|
+
return () => J();
|
|
2027
|
+
}
|
|
2028
|
+
}), Do = Z({
|
|
2029
|
+
name: "TdLightExpansion",
|
|
2030
|
+
props: {
|
|
2031
|
+
modelValue: { type: Number, default: 0 },
|
|
2032
|
+
"onUpdate:modelValue": [Function, Array],
|
|
2033
|
+
label: { type: String, required: !1 }
|
|
2034
|
+
},
|
|
2035
|
+
emits: ["click", "update:modelValue"],
|
|
2036
|
+
setup(e, { slots: o, emit: t }) {
|
|
2037
|
+
const { lang: s } = ee(), n = Me(), { expanded: r, selected: l } = be({
|
|
2038
|
+
store: n,
|
|
2039
|
+
options: ge,
|
|
2040
|
+
tab: ge
|
|
2041
|
+
}), i = h(() => {
|
|
2042
|
+
var u;
|
|
2043
|
+
return (u = s.value.td) == null ? void 0 : u.components.lights.title;
|
|
2044
|
+
});
|
|
2045
|
+
h({
|
|
2046
|
+
get: () => e.modelValue,
|
|
2047
|
+
set: (u) => t("update:modelValue", u)
|
|
2048
|
+
});
|
|
2049
|
+
function d() {
|
|
2050
|
+
const u = {
|
|
2051
|
+
class: "td-lights-expansion",
|
|
2052
|
+
"data-cy": "td-lights-expansion",
|
|
2053
|
+
modelValue: r.value,
|
|
2054
|
+
"onUpdate:modelValue": (g) => r.value = g,
|
|
2055
|
+
label: i.value,
|
|
2056
|
+
selected: l.value,
|
|
2057
|
+
icon: "f_bulb_light"
|
|
2058
|
+
};
|
|
2059
|
+
return m(rt, u, () => m(It));
|
|
2060
|
+
}
|
|
2061
|
+
return () => d();
|
|
2062
|
+
}
|
|
2063
|
+
}), Nt = Z({
|
|
2064
|
+
name: "TdRelatedSection",
|
|
2065
|
+
setup(e, { slots: o, emit: t }) {
|
|
2066
|
+
const s = Symbol.for("RelatedThreeDSection"), n = Wt(s), r = b(), l = de(), { poseId: i } = $(l);
|
|
2067
|
+
function d() {
|
|
2068
|
+
const u = {
|
|
2069
|
+
class: "td-related-section q-mx-lg q-my-sm"
|
|
2070
|
+
}, g = [];
|
|
2071
|
+
return n && i.value && g.push(
|
|
2072
|
+
m(n, {
|
|
2073
|
+
id: i.value,
|
|
2074
|
+
fbxId: r.selected
|
|
2075
|
+
})
|
|
2076
|
+
), m("div", u, g);
|
|
2077
|
+
}
|
|
2078
|
+
return () => d();
|
|
2079
|
+
}
|
|
2080
|
+
}), zo = Z({
|
|
2081
|
+
name: "TdRelatedExpansion",
|
|
2082
|
+
setup(e, { slots: o, emit: t }) {
|
|
2083
|
+
const { expanded: s } = be({
|
|
2084
|
+
options: xe,
|
|
2085
|
+
tab: xe
|
|
2086
|
+
}), n = h(() => "Related");
|
|
2087
|
+
function r() {
|
|
2088
|
+
const l = {
|
|
2089
|
+
class: "td-related-expansion",
|
|
2090
|
+
modelValue: s.value,
|
|
2091
|
+
"onUpdate:modelValue": (i) => s.value = i,
|
|
2092
|
+
label: n.value,
|
|
2093
|
+
icon: "f_related"
|
|
2094
|
+
};
|
|
2095
|
+
return m(rt, l, () => m(Nt));
|
|
2096
|
+
}
|
|
2097
|
+
return () => r();
|
|
2098
|
+
}
|
|
2099
|
+
}), Xt = Z({
|
|
2100
|
+
name: "TdButtons",
|
|
2101
|
+
props: {
|
|
2102
|
+
modelValue: { type: Number, default: 0 },
|
|
2103
|
+
"onUpdate:modelValue": [Function, Array],
|
|
2104
|
+
label: { type: String, required: !1 },
|
|
2105
|
+
fixed: {
|
|
2106
|
+
type: Boolean,
|
|
2107
|
+
default: !0
|
|
2108
|
+
}
|
|
2109
|
+
},
|
|
2110
|
+
emits: ["click", "update:modelValue"],
|
|
2111
|
+
setup(e, { slots: o, emit: t }) {
|
|
2112
|
+
const s = wt(), n = Mt(), r = Ct(), l = Ve(), i = Me(), d = lt(), u = de(), { changed: g } = $(r), { changed: v } = $(l), { changed: f } = $(i), { changed: A } = $(d), { changed: C } = $(u), y = h(() => !(g.value || v.value || f.value || A.value || C.value));
|
|
2113
|
+
function B() {
|
|
2114
|
+
r.reset(), l.reset(), i.reset(), d.reset(), u.resetColor(), s.applyFromStore(), n.applyFromStore();
|
|
2115
|
+
}
|
|
2116
|
+
const M = (H) => H.preventDefault();
|
|
2117
|
+
function z() {
|
|
2118
|
+
const Q = {
|
|
2119
|
+
style: h(() => e.fixed ? "position: fixed;bottom: 0; left: 0; right: 0;border-top: 1px solid var(--grey-300)" : ""),
|
|
2120
|
+
class: "row justify-center items-center q-pa-md"
|
|
2121
|
+
}, R = {
|
|
2122
|
+
class: "td-reset-button",
|
|
2123
|
+
label: "Reset All",
|
|
2124
|
+
onClick: B,
|
|
2125
|
+
onKeyup: M,
|
|
2126
|
+
rounded: !0,
|
|
2127
|
+
unelevated: !0,
|
|
2128
|
+
outline: !0,
|
|
2129
|
+
disable: y.value
|
|
2130
|
+
};
|
|
2131
|
+
return m("div", Q, [m(qt, R)]);
|
|
2132
|
+
}
|
|
2133
|
+
return () => z();
|
|
2134
|
+
}
|
|
2135
|
+
}), Eo = Z({
|
|
2136
|
+
name: "TdExpansions",
|
|
2137
|
+
setup(e, { slots: o, emit: t }) {
|
|
2138
|
+
function s() {
|
|
2139
|
+
return m("div", {
|
|
2140
|
+
class: "td-expansions",
|
|
2141
|
+
onClick: (r) => r.stopPropagation(),
|
|
2142
|
+
style: "padding-bottom: 60px; position: relative "
|
|
2143
|
+
}, [
|
|
2144
|
+
// h(TsPoseButtonsSection),
|
|
2145
|
+
m(je),
|
|
2146
|
+
m(ko),
|
|
2147
|
+
m(je),
|
|
2148
|
+
m(Bo),
|
|
2149
|
+
m(je),
|
|
2150
|
+
m(Do),
|
|
2151
|
+
m(je),
|
|
2152
|
+
// h(TsGridExpansion),
|
|
2153
|
+
// h(QSeparator),
|
|
2154
|
+
// h(TsAdjustmentExpansion),
|
|
2155
|
+
m(zo),
|
|
2156
|
+
m(je),
|
|
2157
|
+
// h('div', {}, store.loading.percent),
|
|
2158
|
+
m(Xt)
|
|
2159
|
+
]);
|
|
2160
|
+
}
|
|
2161
|
+
return () => s();
|
|
2162
|
+
}
|
|
2163
|
+
}), To = Z({
|
|
2164
|
+
name: "TdColorsButton",
|
|
2165
|
+
props: { size: String },
|
|
2166
|
+
setup(e, {}) {
|
|
2167
|
+
const o = ke(), t = b(), s = h(() => (t == null ? void 0 : t.hasAccess("grd")) || !1), { lang: n } = ee(), r = h(() => {
|
|
2168
|
+
var g;
|
|
2169
|
+
return (g = n.value.td) == null ? void 0 : g.controls.colors.iconTitle;
|
|
2170
|
+
}), { click: l, selected: i } = be({
|
|
2171
|
+
store: o,
|
|
2172
|
+
options: se,
|
|
2173
|
+
tab: se
|
|
2174
|
+
});
|
|
2175
|
+
function d(g) {
|
|
2176
|
+
return t.block(g);
|
|
2177
|
+
}
|
|
2178
|
+
function u() {
|
|
2179
|
+
const g = {
|
|
2180
|
+
hasAccess: s.value,
|
|
2181
|
+
selected: i.value,
|
|
2182
|
+
onClick: l,
|
|
2183
|
+
onBlockAccess: d,
|
|
2184
|
+
size: e.size,
|
|
2185
|
+
"data-id": se,
|
|
2186
|
+
name: "colors",
|
|
2187
|
+
type: "none",
|
|
2188
|
+
icon: "f_palette",
|
|
2189
|
+
label: r.value
|
|
2190
|
+
};
|
|
2191
|
+
return m(re, g, () => []);
|
|
2192
|
+
}
|
|
2193
|
+
return () => u();
|
|
2194
|
+
}
|
|
2195
|
+
}), Ao = Z({
|
|
2196
|
+
name: "TdGridButton",
|
|
2197
|
+
props: { size: String },
|
|
2198
|
+
setup(e, {}) {
|
|
2199
|
+
const o = ke(), t = b(), s = h(() => (t == null ? void 0 : t.hasAccess("grd")) || !1), { lang: n } = ee(), r = h(() => {
|
|
2200
|
+
var g;
|
|
2201
|
+
return (g = n.value.td) == null ? void 0 : g.controls.grid.iconTitle;
|
|
2202
|
+
}), { click: l, selected: i } = be({
|
|
2203
|
+
store: o,
|
|
2204
|
+
options: Se,
|
|
2205
|
+
tab: Se
|
|
2206
|
+
});
|
|
2207
|
+
function d(g) {
|
|
2208
|
+
return t.block(g);
|
|
2209
|
+
}
|
|
2210
|
+
function u() {
|
|
2211
|
+
const g = {
|
|
2212
|
+
hasAccess: s.value,
|
|
2213
|
+
selected: i.value,
|
|
2214
|
+
onClick: l,
|
|
2215
|
+
onBlockAccess: d,
|
|
2216
|
+
size: e.size,
|
|
2217
|
+
"data-id": Se,
|
|
2218
|
+
name: "grid",
|
|
2219
|
+
type: "none",
|
|
2220
|
+
icon: "f_grid",
|
|
2221
|
+
label: r.value
|
|
2222
|
+
};
|
|
2223
|
+
return m(re, g, () => []);
|
|
2224
|
+
}
|
|
2225
|
+
return () => u();
|
|
2226
|
+
}
|
|
2227
|
+
}), Vo = Z({
|
|
2228
|
+
name: "TdLightsButton",
|
|
2229
|
+
props: { size: String },
|
|
2230
|
+
setup(e, {}) {
|
|
2231
|
+
const o = ke(), t = b(), s = h(() => (t == null ? void 0 : t.hasAccess("grd")) || !1), { lang: n } = ee(), r = h(() => {
|
|
2232
|
+
var g;
|
|
2233
|
+
return (g = n.value.td) == null ? void 0 : g.controls.lights.iconTitle;
|
|
2234
|
+
}), { click: l, selected: i } = be({
|
|
2235
|
+
store: o,
|
|
2236
|
+
options: ge,
|
|
2237
|
+
tab: ge
|
|
2238
|
+
});
|
|
2239
|
+
function d(g) {
|
|
2240
|
+
return t.block(g);
|
|
2241
|
+
}
|
|
2242
|
+
function u() {
|
|
2243
|
+
const g = {
|
|
2244
|
+
hasAccess: s.value,
|
|
2245
|
+
selected: i.value,
|
|
2246
|
+
onClick: l,
|
|
2247
|
+
onBlockAccess: d,
|
|
2248
|
+
size: e.size,
|
|
2249
|
+
"data-id": ge,
|
|
2250
|
+
name: "lights",
|
|
2251
|
+
type: "none",
|
|
2252
|
+
icon: "f_bulb_light",
|
|
2253
|
+
label: r.value
|
|
2254
|
+
};
|
|
2255
|
+
return m(re, g, () => []);
|
|
2256
|
+
}
|
|
2257
|
+
return () => u();
|
|
2258
|
+
}
|
|
2259
|
+
}), Lo = Z({
|
|
2260
|
+
name: "TsAdjustmentsButton",
|
|
2261
|
+
props: { size: String },
|
|
2262
|
+
setup(e, {}) {
|
|
2263
|
+
const o = b(), { lang: t } = ee(), s = h(() => {
|
|
2264
|
+
var d;
|
|
2265
|
+
return (d = t.value.td) == null ? void 0 : d.controls.related.iconTitle;
|
|
2266
|
+
}), { click: n, selected: r } = be({
|
|
2267
|
+
options: xe,
|
|
2268
|
+
tab: xe
|
|
2269
|
+
});
|
|
2270
|
+
function l(d) {
|
|
2271
|
+
return o.block(d);
|
|
2272
|
+
}
|
|
2273
|
+
function i() {
|
|
2274
|
+
const d = {
|
|
2275
|
+
hasAccess: !0,
|
|
2276
|
+
selected: r.value,
|
|
2277
|
+
onClick: n,
|
|
2278
|
+
onBlockAccess: l,
|
|
2279
|
+
"data-id": xe,
|
|
2280
|
+
size: e.size,
|
|
2281
|
+
name: "related",
|
|
2282
|
+
icon: "f_related",
|
|
2283
|
+
type: "none",
|
|
2284
|
+
label: s.value
|
|
2285
|
+
};
|
|
2286
|
+
return m(re, d, () => []);
|
|
2287
|
+
}
|
|
2288
|
+
return () => i();
|
|
2289
|
+
}
|
|
2290
|
+
}), jo = Z({
|
|
2291
|
+
name: "TsDefaultDrawer",
|
|
2292
|
+
props: {},
|
|
2293
|
+
emits: ["click"],
|
|
2294
|
+
setup(e, { slots: o, emit: t }) {
|
|
2295
|
+
const s = b(), n = "q-ma-xs";
|
|
2296
|
+
function r(l) {
|
|
2297
|
+
return {
|
|
2298
|
+
class: n,
|
|
2299
|
+
size: "sm",
|
|
2300
|
+
onClick: () => s.setActive(l)
|
|
2301
|
+
};
|
|
2302
|
+
}
|
|
2303
|
+
return () => m(
|
|
2304
|
+
Qe,
|
|
2305
|
+
{ name: ot },
|
|
2306
|
+
{
|
|
2307
|
+
default: () => m(no, {}, () => [
|
|
2308
|
+
m(To, r(se)),
|
|
2309
|
+
m(Ao, r(Se)),
|
|
2310
|
+
m(Vo, r(ge)),
|
|
2311
|
+
m(Lo, r(xe))
|
|
2312
|
+
]),
|
|
2313
|
+
secondary: () => m(Xt, { fixed: !1 })
|
|
2314
|
+
}
|
|
2315
|
+
);
|
|
2316
|
+
}
|
|
2317
|
+
}), Fo = Z({
|
|
2318
|
+
name: "TdGridDrawer",
|
|
2319
|
+
setup(e, { slots: o, emit: t }) {
|
|
2320
|
+
const { lang: s } = ee(), n = h(() => {
|
|
2321
|
+
var l;
|
|
2322
|
+
return (l = s.value.td) == null ? void 0 : l.controls.grid.title;
|
|
2323
|
+
});
|
|
2324
|
+
function r() {
|
|
2325
|
+
const l = {
|
|
2326
|
+
class: "td-grid-drawer",
|
|
2327
|
+
name: Se,
|
|
2328
|
+
label: n.value
|
|
2329
|
+
};
|
|
2330
|
+
return m(Qe, l, () => m($t));
|
|
2331
|
+
}
|
|
2332
|
+
return () => r();
|
|
2333
|
+
}
|
|
2334
|
+
}), Po = Z({
|
|
2335
|
+
name: "TdRelatedDrawer",
|
|
2336
|
+
setup(e, { slots: o, emit: t }) {
|
|
2337
|
+
const { lang: s } = ee(), n = h(() => {
|
|
2338
|
+
var l;
|
|
2339
|
+
return (l = s.value.td) == null ? void 0 : l.controls.related.title;
|
|
2340
|
+
});
|
|
2341
|
+
function r() {
|
|
2342
|
+
const l = {
|
|
2343
|
+
class: "td-related-drawer",
|
|
2344
|
+
name: xe,
|
|
2345
|
+
label: n.value
|
|
2346
|
+
};
|
|
2347
|
+
return m(Qe, l, () => m(Nt));
|
|
2348
|
+
}
|
|
2349
|
+
return () => r();
|
|
2350
|
+
}
|
|
2351
|
+
}), Go = Z({
|
|
2352
|
+
name: "TdLightsDrawer",
|
|
2353
|
+
setup(e, { slots: o, emit: t }) {
|
|
2354
|
+
const { lang: s } = ee(), n = h(() => {
|
|
2355
|
+
var l;
|
|
2356
|
+
return (l = s.value.td) == null ? void 0 : l.controls.lights.title;
|
|
2357
|
+
});
|
|
2358
|
+
function r() {
|
|
2359
|
+
const l = {
|
|
2360
|
+
class: "td-lights-drawer",
|
|
2361
|
+
name: ge,
|
|
2362
|
+
label: n.value
|
|
2363
|
+
};
|
|
2364
|
+
return m(Qe, l, () => m(It));
|
|
2365
|
+
}
|
|
2366
|
+
return () => r();
|
|
2367
|
+
}
|
|
2368
|
+
}), Ho = Z({
|
|
2369
|
+
name: "TdLightsDrawer",
|
|
2370
|
+
setup(e, { slots: o, emit: t }) {
|
|
2371
|
+
const { lang: s } = ee(), n = h(() => {
|
|
2372
|
+
var l;
|
|
2373
|
+
return (l = s.value.td) == null ? void 0 : l.controls.colors.title;
|
|
2374
|
+
});
|
|
2375
|
+
function r() {
|
|
2376
|
+
const l = {
|
|
2377
|
+
class: "td-colors-drawer",
|
|
2378
|
+
name: se,
|
|
2379
|
+
label: n.value
|
|
2380
|
+
};
|
|
2381
|
+
return m(Qe, l, () => m(_t));
|
|
2382
|
+
}
|
|
2383
|
+
return () => r();
|
|
2384
|
+
}
|
|
2385
|
+
}), Ro = Z({
|
|
2386
|
+
name: "TsDrawers",
|
|
2387
|
+
setup(e, { slots: o, emit: t }) {
|
|
2388
|
+
const s = b(), n = h({
|
|
2389
|
+
get: () => s.active,
|
|
2390
|
+
set: (l) => s.setActive(l)
|
|
2391
|
+
});
|
|
2392
|
+
function r() {
|
|
2393
|
+
const l = {
|
|
2394
|
+
modelValue: n.value,
|
|
2395
|
+
"onUpdate:modelValue": (i) => n.value = i
|
|
2396
|
+
};
|
|
2397
|
+
return m(ro, l, () => [
|
|
2398
|
+
m(jo),
|
|
2399
|
+
m(Go),
|
|
2400
|
+
m(Ho),
|
|
2401
|
+
m(Fo),
|
|
2402
|
+
m(Po)
|
|
2403
|
+
]);
|
|
2404
|
+
}
|
|
2405
|
+
return () => r();
|
|
2406
|
+
}
|
|
2407
|
+
}), Qo = /* @__PURE__ */ Object.assign({
|
|
2408
|
+
name: "TdPage",
|
|
2409
|
+
slug: "td-page",
|
|
2410
|
+
inheritAttrs: !1
|
|
2411
|
+
}, {
|
|
2412
|
+
__name: "TdPage",
|
|
2413
|
+
props: /* @__PURE__ */ oo({
|
|
2414
|
+
id: Number
|
|
2415
|
+
}, {
|
|
2416
|
+
miniState: { type: Boolean },
|
|
2417
|
+
miniStateModifiers: {}
|
|
2418
|
+
}),
|
|
2419
|
+
emits: ["update:miniState"],
|
|
2420
|
+
setup(e) {
|
|
2421
|
+
const o = e, t = b(), s = h(() => Number(o.id)), n = Jt(e, "miniState");
|
|
2422
|
+
return eo(() => {
|
|
2423
|
+
t.setActive(ft.is.mobile ? ot : se);
|
|
2424
|
+
}), (r, l) => (Je(), at(it(lo), {
|
|
2425
|
+
class: "three-dimension-page",
|
|
2426
|
+
miniState: n.value,
|
|
2427
|
+
"onUpdate:miniState": l[0] || (l[0] = (i) => n.value = i),
|
|
2428
|
+
"no-drawer-padding": !0,
|
|
2429
|
+
title: "3D Viewer"
|
|
2430
|
+
}, {
|
|
2431
|
+
toolDrawer: ct(() => [
|
|
2432
|
+
r.$q.platform.is.mobile ? gt("", !0) : (Je(), at(it(Eo), { key: 0 }))
|
|
2433
|
+
]),
|
|
2434
|
+
bottomDrawer: ct(() => [
|
|
2435
|
+
r.$q.platform.is.mobile ? (Je(), at(it(Ro), { key: 0 })) : gt("", !0)
|
|
2436
|
+
]),
|
|
2437
|
+
default: ct(() => [
|
|
2438
|
+
to(Mo, { id: s.value }, null, 8, ["id"])
|
|
2439
|
+
]),
|
|
2440
|
+
_: 1
|
|
2441
|
+
}, 8, ["miniState"]));
|
|
2442
|
+
}
|
|
2443
|
+
});
|
|
2444
|
+
export {
|
|
2445
|
+
Qo as TdPage,
|
|
2446
|
+
b as use3dStore,
|
|
2447
|
+
Ut as useColorsStore,
|
|
2448
|
+
Ct as useControlsStore,
|
|
2449
|
+
de as useFBXStore,
|
|
2450
|
+
ke as useGridStore,
|
|
2451
|
+
Ve as useGroundStore,
|
|
2452
|
+
Me as useLightsStore,
|
|
2453
|
+
lt as useSceneStore
|
|
2454
|
+
};
|