@cristiancosano/pallet-builder 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/primitives/Box/Box.d.ts +1 -1
- package/dist/core/entities/Box.d.ts +2 -0
- package/dist/core/packing/MaterialGroupingStrategy.d.ts +28 -0
- package/dist/core/packing/index.d.ts +1 -0
- package/dist/examples/store/useExampleStore.d.ts +10 -10
- package/dist/pallet-builder.js +1877 -1299
- package/dist/pallet-builder.js.map +1 -1
- package/package.json +1 -1
package/dist/pallet-builder.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Html as ke, OrbitControls as
|
|
3
|
-
import * as
|
|
1
|
+
import Le, { createContext as Ge, useContext as Ve, useMemo as k, useCallback as q, memo as V, useRef as _e, useEffect as fe, useState as ae } from "react";
|
|
2
|
+
import { Edges as Xe, Html as ke, OrbitControls as Ze } from "@react-three/drei";
|
|
3
|
+
import * as B from "three";
|
|
4
4
|
import { useThree as Ae, Canvas as pe } from "@react-three/fiber";
|
|
5
|
-
const
|
|
5
|
+
const N = {
|
|
6
6
|
WOOD: "WOOD",
|
|
7
7
|
PLASTIC: "PLASTIC",
|
|
8
8
|
METAL: "METAL",
|
|
@@ -21,7 +21,7 @@ const L = {
|
|
|
21
21
|
/** Palet EUR/EPAL — Estándar europeo (1200×800×144mm, ISO 6780) */
|
|
22
22
|
EUR: {
|
|
23
23
|
dimensions: { width: 1200, height: 144, depth: 800 },
|
|
24
|
-
material:
|
|
24
|
+
material: N.WOOD,
|
|
25
25
|
maxWeight: 1e3,
|
|
26
26
|
maxStackHeight: 2200,
|
|
27
27
|
weight: 25
|
|
@@ -29,7 +29,7 @@ const L = {
|
|
|
29
29
|
/** Palet GMA/Americano — Estándar norteamericano (1219×1016×145mm, 48"×40") */
|
|
30
30
|
GMA: {
|
|
31
31
|
dimensions: { width: 1219, height: 145, depth: 1016 },
|
|
32
|
-
material:
|
|
32
|
+
material: N.WOOD,
|
|
33
33
|
maxWeight: 1200,
|
|
34
34
|
maxStackHeight: 2200,
|
|
35
35
|
weight: 30
|
|
@@ -37,7 +37,7 @@ const L = {
|
|
|
37
37
|
/** Palet UK Standard — Reino Unido (1200×1000×150mm) */
|
|
38
38
|
UK: {
|
|
39
39
|
dimensions: { width: 1200, height: 150, depth: 1e3 },
|
|
40
|
-
material:
|
|
40
|
+
material: N.WOOD,
|
|
41
41
|
maxWeight: 1e3,
|
|
42
42
|
maxStackHeight: 2200,
|
|
43
43
|
weight: 28
|
|
@@ -45,7 +45,7 @@ const L = {
|
|
|
45
45
|
/** Palet asiático estándar — Asia Pallet (1100×1100×150mm, ISO 6780) */
|
|
46
46
|
ASIA: {
|
|
47
47
|
dimensions: { width: 1100, height: 150, depth: 1100 },
|
|
48
|
-
material:
|
|
48
|
+
material: N.WOOD,
|
|
49
49
|
maxWeight: 1e3,
|
|
50
50
|
maxStackHeight: 2200,
|
|
51
51
|
weight: 28
|
|
@@ -53,7 +53,7 @@ const L = {
|
|
|
53
53
|
/** Palet australiano estándar — Australia (1165×1165×150mm) */
|
|
54
54
|
AUSTRALIAN: {
|
|
55
55
|
dimensions: { width: 1165, height: 150, depth: 1165 },
|
|
56
|
-
material:
|
|
56
|
+
material: N.WOOD,
|
|
57
57
|
maxWeight: 1e3,
|
|
58
58
|
maxStackHeight: 2200,
|
|
59
59
|
weight: 29
|
|
@@ -61,7 +61,7 @@ const L = {
|
|
|
61
61
|
/** Medio palet EUR — Half European Pallet (800×600×144mm) */
|
|
62
62
|
HALF_EUR: {
|
|
63
63
|
dimensions: { width: 800, height: 144, depth: 600 },
|
|
64
|
-
material:
|
|
64
|
+
material: N.WOOD,
|
|
65
65
|
maxWeight: 500,
|
|
66
66
|
maxStackHeight: 2200,
|
|
67
67
|
weight: 12
|
|
@@ -69,7 +69,7 @@ const L = {
|
|
|
69
69
|
/** Cuarto de palet EUR — Quarter European Pallet (600×400×144mm) */
|
|
70
70
|
QUARTER_EUR: {
|
|
71
71
|
dimensions: { width: 600, height: 144, depth: 400 },
|
|
72
|
-
material:
|
|
72
|
+
material: N.WOOD,
|
|
73
73
|
maxWeight: 250,
|
|
74
74
|
maxStackHeight: 2200,
|
|
75
75
|
weight: 6
|
|
@@ -77,7 +77,7 @@ const L = {
|
|
|
77
77
|
/** Palet ISO 1 — ISO 6780 (1200×1000×150mm) */
|
|
78
78
|
ISO_1: {
|
|
79
79
|
dimensions: { width: 1200, height: 150, depth: 1e3 },
|
|
80
|
-
material:
|
|
80
|
+
material: N.WOOD,
|
|
81
81
|
maxWeight: 1e3,
|
|
82
82
|
maxStackHeight: 2200,
|
|
83
83
|
weight: 28
|
|
@@ -85,14 +85,14 @@ const L = {
|
|
|
85
85
|
/** Palet ISO 2 — ISO 6780 (1200×800×144mm, equivalente a EUR) */
|
|
86
86
|
ISO_2: {
|
|
87
87
|
dimensions: { width: 1200, height: 144, depth: 800 },
|
|
88
|
-
material:
|
|
88
|
+
material: N.WOOD,
|
|
89
89
|
maxWeight: 1e3,
|
|
90
90
|
maxStackHeight: 2200,
|
|
91
91
|
weight: 25
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
ue.GMA;
|
|
95
|
-
const
|
|
95
|
+
const De = {
|
|
96
96
|
[ie.BOX]: {
|
|
97
97
|
dimensions: { width: 2480, height: 2700, depth: 13600 },
|
|
98
98
|
maxWeight: 24e3
|
|
@@ -109,15 +109,15 @@ const Ze = {
|
|
|
109
109
|
dimensions: { width: 2480, height: 2700, depth: 13600 },
|
|
110
110
|
maxWeight: 24e3
|
|
111
111
|
}
|
|
112
|
-
},
|
|
112
|
+
}, Ot = {
|
|
113
113
|
thickness: 10,
|
|
114
114
|
// mm
|
|
115
115
|
weight: 2
|
|
116
116
|
// kg
|
|
117
|
-
},
|
|
117
|
+
}, U = {
|
|
118
118
|
MM_TO_M: 1e-3,
|
|
119
119
|
M_TO_MM: 1e3
|
|
120
|
-
}, Ne = 1,
|
|
120
|
+
}, Ne = 1, ze = 0.6, Ie = 0.9, Ue = {
|
|
121
121
|
id: "unstyled",
|
|
122
122
|
name: "Sin estilo",
|
|
123
123
|
box: {
|
|
@@ -162,7 +162,7 @@ const Ze = {
|
|
|
162
162
|
chassisColor: "#2a2a2a",
|
|
163
163
|
wheelColor: "#1a1a1a"
|
|
164
164
|
}
|
|
165
|
-
},
|
|
165
|
+
}, Oe = {
|
|
166
166
|
id: "industrial",
|
|
167
167
|
name: "Industrial",
|
|
168
168
|
box: {
|
|
@@ -207,195 +207,195 @@ const Ze = {
|
|
|
207
207
|
chassisColor: "#1e1e1e",
|
|
208
208
|
wheelColor: "#111111"
|
|
209
209
|
}
|
|
210
|
-
},
|
|
211
|
-
unstyled:
|
|
212
|
-
industrial:
|
|
213
|
-
}, xe =
|
|
214
|
-
var re = { exports: {} },
|
|
215
|
-
var
|
|
216
|
-
function
|
|
217
|
-
if (
|
|
218
|
-
|
|
219
|
-
var
|
|
220
|
-
function t(
|
|
210
|
+
}, He = {
|
|
211
|
+
unstyled: Ue,
|
|
212
|
+
industrial: Oe
|
|
213
|
+
}, xe = Oe;
|
|
214
|
+
var re = { exports: {} }, te = {};
|
|
215
|
+
var Ce;
|
|
216
|
+
function Ye() {
|
|
217
|
+
if (Ce) return te;
|
|
218
|
+
Ce = 1;
|
|
219
|
+
var i = /* @__PURE__ */ Symbol.for("react.transitional.element"), e = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
220
|
+
function t(o, s, n) {
|
|
221
221
|
var a = null;
|
|
222
|
-
if (
|
|
223
|
-
|
|
224
|
-
for (var
|
|
225
|
-
|
|
226
|
-
} else
|
|
227
|
-
return
|
|
228
|
-
$$typeof:
|
|
229
|
-
type:
|
|
222
|
+
if (n !== void 0 && (a = "" + n), s.key !== void 0 && (a = "" + s.key), "key" in s) {
|
|
223
|
+
n = {};
|
|
224
|
+
for (var c in s)
|
|
225
|
+
c !== "key" && (n[c] = s[c]);
|
|
226
|
+
} else n = s;
|
|
227
|
+
return s = n.ref, {
|
|
228
|
+
$$typeof: i,
|
|
229
|
+
type: o,
|
|
230
230
|
key: a,
|
|
231
|
-
ref:
|
|
232
|
-
props:
|
|
231
|
+
ref: s !== void 0 ? s : null,
|
|
232
|
+
props: n
|
|
233
233
|
};
|
|
234
234
|
}
|
|
235
|
-
return
|
|
235
|
+
return te.Fragment = e, te.jsx = t, te.jsxs = t, te;
|
|
236
236
|
}
|
|
237
|
-
var
|
|
238
|
-
var
|
|
237
|
+
var oe = {};
|
|
238
|
+
var Pe;
|
|
239
239
|
function Fe() {
|
|
240
|
-
return
|
|
241
|
-
function
|
|
242
|
-
if (
|
|
243
|
-
if (typeof
|
|
244
|
-
return
|
|
245
|
-
if (typeof
|
|
246
|
-
switch (
|
|
247
|
-
case
|
|
240
|
+
return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
241
|
+
function i(p) {
|
|
242
|
+
if (p == null) return null;
|
|
243
|
+
if (typeof p == "function")
|
|
244
|
+
return p.$$typeof === T ? null : p.displayName || p.name || null;
|
|
245
|
+
if (typeof p == "string") return p;
|
|
246
|
+
switch (p) {
|
|
247
|
+
case d:
|
|
248
248
|
return "Fragment";
|
|
249
|
-
case T:
|
|
250
|
-
return "Profiler";
|
|
251
249
|
case j:
|
|
250
|
+
return "Profiler";
|
|
251
|
+
case b:
|
|
252
252
|
return "StrictMode";
|
|
253
|
-
case
|
|
253
|
+
case z:
|
|
254
254
|
return "Suspense";
|
|
255
255
|
case y:
|
|
256
256
|
return "SuspenseList";
|
|
257
|
-
case
|
|
257
|
+
case _:
|
|
258
258
|
return "Activity";
|
|
259
259
|
}
|
|
260
|
-
if (typeof
|
|
261
|
-
switch (typeof
|
|
260
|
+
if (typeof p == "object")
|
|
261
|
+
switch (typeof p.tag == "number" && console.error(
|
|
262
262
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
263
|
-
),
|
|
264
|
-
case
|
|
263
|
+
), p.$$typeof) {
|
|
264
|
+
case u:
|
|
265
265
|
return "Portal";
|
|
266
|
-
case b:
|
|
267
|
-
return m.displayName || "Context";
|
|
268
|
-
case z:
|
|
269
|
-
return (m._context.displayName || "Context") + ".Consumer";
|
|
270
|
-
case M:
|
|
271
|
-
var C = m.render;
|
|
272
|
-
return m = m.displayName, m || (m = C.displayName || C.name || "", m = m !== "" ? "ForwardRef(" + m + ")" : "ForwardRef"), m;
|
|
273
|
-
case w:
|
|
274
|
-
return C = m.displayName || null, C !== null ? C : o(m.type) || "Memo";
|
|
275
266
|
case S:
|
|
276
|
-
|
|
267
|
+
return p.displayName || "Context";
|
|
268
|
+
case E:
|
|
269
|
+
return (p._context.displayName || "Context") + ".Consumer";
|
|
270
|
+
case C:
|
|
271
|
+
var P = p.render;
|
|
272
|
+
return p = p.displayName, p || (p = P.displayName || P.name || "", p = p !== "" ? "ForwardRef(" + p + ")" : "ForwardRef"), p;
|
|
273
|
+
case v:
|
|
274
|
+
return P = p.displayName || null, P !== null ? P : i(p.type) || "Memo";
|
|
275
|
+
case M:
|
|
276
|
+
P = p._payload, p = p._init;
|
|
277
277
|
try {
|
|
278
|
-
return
|
|
278
|
+
return i(p(P));
|
|
279
279
|
} catch {
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
return null;
|
|
283
283
|
}
|
|
284
|
-
function e(
|
|
285
|
-
return "" +
|
|
284
|
+
function e(p) {
|
|
285
|
+
return "" + p;
|
|
286
286
|
}
|
|
287
|
-
function t(
|
|
287
|
+
function t(p) {
|
|
288
288
|
try {
|
|
289
|
-
e(
|
|
290
|
-
var
|
|
289
|
+
e(p);
|
|
290
|
+
var P = !1;
|
|
291
291
|
} catch {
|
|
292
|
-
|
|
292
|
+
P = !0;
|
|
293
293
|
}
|
|
294
|
-
if (
|
|
295
|
-
|
|
296
|
-
var
|
|
297
|
-
return
|
|
298
|
-
|
|
294
|
+
if (P) {
|
|
295
|
+
P = console;
|
|
296
|
+
var O = P.error, W = typeof Symbol == "function" && Symbol.toStringTag && p[Symbol.toStringTag] || p.constructor.name || "Object";
|
|
297
|
+
return O.call(
|
|
298
|
+
P,
|
|
299
299
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
300
300
|
W
|
|
301
|
-
), e(
|
|
301
|
+
), e(p);
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
function
|
|
305
|
-
if (
|
|
306
|
-
if (typeof
|
|
304
|
+
function o(p) {
|
|
305
|
+
if (p === d) return "<>";
|
|
306
|
+
if (typeof p == "object" && p !== null && p.$$typeof === M)
|
|
307
307
|
return "<...>";
|
|
308
308
|
try {
|
|
309
|
-
var
|
|
310
|
-
return
|
|
309
|
+
var P = i(p);
|
|
310
|
+
return P ? "<" + P + ">" : "<...>";
|
|
311
311
|
} catch {
|
|
312
312
|
return "<...>";
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
var
|
|
317
|
-
return
|
|
315
|
+
function s() {
|
|
316
|
+
var p = I.A;
|
|
317
|
+
return p === null ? null : p.getOwner();
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function n() {
|
|
320
320
|
return Error("react-stack-top-frame");
|
|
321
321
|
}
|
|
322
|
-
function a(
|
|
323
|
-
if (
|
|
324
|
-
var
|
|
325
|
-
if (
|
|
322
|
+
function a(p) {
|
|
323
|
+
if (R.call(p, "key")) {
|
|
324
|
+
var P = Object.getOwnPropertyDescriptor(p, "key").get;
|
|
325
|
+
if (P && P.isReactWarning) return !1;
|
|
326
326
|
}
|
|
327
|
-
return
|
|
327
|
+
return p.key !== void 0;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
330
|
-
function
|
|
331
|
-
|
|
329
|
+
function c(p, P) {
|
|
330
|
+
function O() {
|
|
331
|
+
D || (D = !0, console.error(
|
|
332
332
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
333
|
-
|
|
333
|
+
P
|
|
334
334
|
));
|
|
335
335
|
}
|
|
336
|
-
|
|
337
|
-
get:
|
|
336
|
+
O.isReactWarning = !0, Object.defineProperty(p, "key", {
|
|
337
|
+
get: O,
|
|
338
338
|
configurable: !0
|
|
339
339
|
});
|
|
340
340
|
}
|
|
341
|
-
function
|
|
342
|
-
var
|
|
343
|
-
return
|
|
341
|
+
function l() {
|
|
342
|
+
var p = i(this.type);
|
|
343
|
+
return H[p] || (H[p] = !0, console.error(
|
|
344
344
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
345
|
-
)),
|
|
345
|
+
)), p = this.props.ref, p !== void 0 ? p : null;
|
|
346
346
|
}
|
|
347
|
-
function
|
|
348
|
-
var
|
|
349
|
-
return
|
|
350
|
-
$$typeof:
|
|
351
|
-
type:
|
|
352
|
-
key:
|
|
353
|
-
props:
|
|
347
|
+
function f(p, P, O, W, ne, de) {
|
|
348
|
+
var $ = O.ref;
|
|
349
|
+
return p = {
|
|
350
|
+
$$typeof: x,
|
|
351
|
+
type: p,
|
|
352
|
+
key: P,
|
|
353
|
+
props: O,
|
|
354
354
|
_owner: W
|
|
355
|
-
}, (
|
|
355
|
+
}, ($ !== void 0 ? $ : null) !== null ? Object.defineProperty(p, "ref", {
|
|
356
356
|
enumerable: !1,
|
|
357
|
-
get:
|
|
358
|
-
}) : Object.defineProperty(
|
|
357
|
+
get: l
|
|
358
|
+
}) : Object.defineProperty(p, "ref", { enumerable: !1, value: null }), p._store = {}, Object.defineProperty(p._store, "validated", {
|
|
359
359
|
configurable: !1,
|
|
360
360
|
enumerable: !1,
|
|
361
361
|
writable: !0,
|
|
362
362
|
value: 0
|
|
363
|
-
}), Object.defineProperty(
|
|
363
|
+
}), Object.defineProperty(p, "_debugInfo", {
|
|
364
364
|
configurable: !1,
|
|
365
365
|
enumerable: !1,
|
|
366
366
|
writable: !0,
|
|
367
367
|
value: null
|
|
368
|
-
}), Object.defineProperty(
|
|
368
|
+
}), Object.defineProperty(p, "_debugStack", {
|
|
369
369
|
configurable: !1,
|
|
370
370
|
enumerable: !1,
|
|
371
371
|
writable: !0,
|
|
372
372
|
value: ne
|
|
373
|
-
}), Object.defineProperty(
|
|
373
|
+
}), Object.defineProperty(p, "_debugTask", {
|
|
374
374
|
configurable: !1,
|
|
375
375
|
enumerable: !1,
|
|
376
376
|
writable: !0,
|
|
377
377
|
value: de
|
|
378
|
-
}), Object.freeze && (Object.freeze(
|
|
378
|
+
}), Object.freeze && (Object.freeze(p.props), Object.freeze(p)), p;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
var
|
|
382
|
-
if (
|
|
380
|
+
function h(p, P, O, W, ne, de) {
|
|
381
|
+
var $ = P.children;
|
|
382
|
+
if ($ !== void 0)
|
|
383
383
|
if (W)
|
|
384
|
-
if (A(
|
|
385
|
-
for (W = 0; W <
|
|
386
|
-
|
|
387
|
-
Object.freeze && Object.freeze(
|
|
384
|
+
if (A($)) {
|
|
385
|
+
for (W = 0; W < $.length; W++)
|
|
386
|
+
g($[W]);
|
|
387
|
+
Object.freeze && Object.freeze($);
|
|
388
388
|
} else
|
|
389
389
|
console.error(
|
|
390
390
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
391
391
|
);
|
|
392
|
-
else
|
|
393
|
-
if (
|
|
394
|
-
|
|
395
|
-
var Q = Object.keys(
|
|
396
|
-
return
|
|
392
|
+
else g($);
|
|
393
|
+
if (R.call(P, "key")) {
|
|
394
|
+
$ = i(p);
|
|
395
|
+
var Q = Object.keys(P).filter(function($e) {
|
|
396
|
+
return $e !== "key";
|
|
397
397
|
});
|
|
398
|
-
W = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", J[
|
|
398
|
+
W = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", J[$ + W] || (Q = 0 < Q.length ? "{" + Q.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
399
399
|
`A props object containing a "key" prop is being spread into JSX:
|
|
400
400
|
let props = %s;
|
|
401
401
|
<%s {...props} />
|
|
@@ -403,568 +403,568 @@ React keys must be passed directly to JSX without using spread:
|
|
|
403
403
|
let props = %s;
|
|
404
404
|
<%s key={someKey} {...props} />`,
|
|
405
405
|
W,
|
|
406
|
-
|
|
406
|
+
$,
|
|
407
407
|
Q,
|
|
408
|
-
|
|
409
|
-
), J[
|
|
408
|
+
$
|
|
409
|
+
), J[$ + W] = !0);
|
|
410
410
|
}
|
|
411
|
-
if (
|
|
412
|
-
|
|
413
|
-
for (var he in
|
|
414
|
-
he !== "key" && (
|
|
415
|
-
} else
|
|
416
|
-
return
|
|
417
|
-
|
|
418
|
-
typeof
|
|
419
|
-
),
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
411
|
+
if ($ = null, O !== void 0 && (t(O), $ = "" + O), a(P) && (t(P.key), $ = "" + P.key), "key" in P) {
|
|
412
|
+
O = {};
|
|
413
|
+
for (var he in P)
|
|
414
|
+
he !== "key" && (O[he] = P[he]);
|
|
415
|
+
} else O = P;
|
|
416
|
+
return $ && c(
|
|
417
|
+
O,
|
|
418
|
+
typeof p == "function" ? p.displayName || p.name || "Unknown" : p
|
|
419
|
+
), f(
|
|
420
|
+
p,
|
|
421
|
+
$,
|
|
422
|
+
O,
|
|
423
|
+
s(),
|
|
424
424
|
ne,
|
|
425
425
|
de
|
|
426
426
|
);
|
|
427
427
|
}
|
|
428
|
-
function
|
|
429
|
-
p
|
|
428
|
+
function g(p) {
|
|
429
|
+
w(p) ? p._store && (p._store.validated = 1) : typeof p == "object" && p !== null && p.$$typeof === M && (p._payload.status === "fulfilled" ? w(p._payload.value) && p._payload.value._store && (p._payload.value._store.validated = 1) : p._store && (p._store.validated = 1));
|
|
430
430
|
}
|
|
431
|
-
function p
|
|
432
|
-
return typeof
|
|
431
|
+
function w(p) {
|
|
432
|
+
return typeof p == "object" && p !== null && p.$$typeof === x;
|
|
433
433
|
}
|
|
434
|
-
var
|
|
434
|
+
var m = Le, x = /* @__PURE__ */ Symbol.for("react.transitional.element"), u = /* @__PURE__ */ Symbol.for("react.portal"), d = /* @__PURE__ */ Symbol.for("react.fragment"), b = /* @__PURE__ */ Symbol.for("react.strict_mode"), j = /* @__PURE__ */ Symbol.for("react.profiler"), E = /* @__PURE__ */ Symbol.for("react.consumer"), S = /* @__PURE__ */ Symbol.for("react.context"), C = /* @__PURE__ */ Symbol.for("react.forward_ref"), z = /* @__PURE__ */ Symbol.for("react.suspense"), y = /* @__PURE__ */ Symbol.for("react.suspense_list"), v = /* @__PURE__ */ Symbol.for("react.memo"), M = /* @__PURE__ */ Symbol.for("react.lazy"), _ = /* @__PURE__ */ Symbol.for("react.activity"), T = /* @__PURE__ */ Symbol.for("react.client.reference"), I = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, R = Object.prototype.hasOwnProperty, A = Array.isArray, G = console.createTask ? console.createTask : function() {
|
|
435
435
|
return null;
|
|
436
436
|
};
|
|
437
|
-
|
|
438
|
-
react_stack_bottom_frame: function(
|
|
439
|
-
return
|
|
437
|
+
m = {
|
|
438
|
+
react_stack_bottom_frame: function(p) {
|
|
439
|
+
return p();
|
|
440
440
|
}
|
|
441
441
|
};
|
|
442
|
-
var
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
)(), X = G(
|
|
446
|
-
|
|
447
|
-
var W = 1e4 >
|
|
448
|
-
return
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
442
|
+
var D, H = {}, F = m.react_stack_bottom_frame.bind(
|
|
443
|
+
m,
|
|
444
|
+
n
|
|
445
|
+
)(), X = G(o(n)), J = {};
|
|
446
|
+
oe.Fragment = d, oe.jsx = function(p, P, O) {
|
|
447
|
+
var W = 1e4 > I.recentlyCreatedOwnerStacks++;
|
|
448
|
+
return h(
|
|
449
|
+
p,
|
|
450
|
+
P,
|
|
451
|
+
O,
|
|
452
452
|
!1,
|
|
453
453
|
W ? Error("react-stack-top-frame") : F,
|
|
454
|
-
W ? G(
|
|
454
|
+
W ? G(o(p)) : X
|
|
455
455
|
);
|
|
456
|
-
},
|
|
457
|
-
var W = 1e4 >
|
|
458
|
-
return
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
456
|
+
}, oe.jsxs = function(p, P, O) {
|
|
457
|
+
var W = 1e4 > I.recentlyCreatedOwnerStacks++;
|
|
458
|
+
return h(
|
|
459
|
+
p,
|
|
460
|
+
P,
|
|
461
|
+
O,
|
|
462
462
|
!0,
|
|
463
463
|
W ? Error("react-stack-top-frame") : F,
|
|
464
|
-
W ? G(
|
|
464
|
+
W ? G(o(p)) : X
|
|
465
465
|
);
|
|
466
466
|
};
|
|
467
|
-
})()),
|
|
467
|
+
})()), oe;
|
|
468
468
|
}
|
|
469
|
-
var
|
|
470
|
-
function
|
|
471
|
-
return
|
|
469
|
+
var Re;
|
|
470
|
+
function qe() {
|
|
471
|
+
return Re || (Re = 1, process.env.NODE_ENV === "production" ? re.exports = Ye() : re.exports = Fe()), re.exports;
|
|
472
472
|
}
|
|
473
|
-
var
|
|
474
|
-
const
|
|
475
|
-
function
|
|
476
|
-
const t = k(() =>
|
|
477
|
-
return /* @__PURE__ */
|
|
473
|
+
var r = qe();
|
|
474
|
+
const Be = Ge(xe);
|
|
475
|
+
function we({ preset: i, children: e }) {
|
|
476
|
+
const t = k(() => i ? typeof i == "string" ? He[i] ?? xe : i : xe, [i]);
|
|
477
|
+
return /* @__PURE__ */ r.jsx(Be.Provider, { value: t, children: e });
|
|
478
478
|
}
|
|
479
479
|
function ce() {
|
|
480
|
-
return Ve(
|
|
480
|
+
return Ve(Be);
|
|
481
481
|
}
|
|
482
|
-
function le(
|
|
482
|
+
function le(i) {
|
|
483
483
|
let e = 0;
|
|
484
|
-
for (const t of
|
|
484
|
+
for (const t of i.floors) {
|
|
485
485
|
e += t.pallet.dimensions.height;
|
|
486
|
-
const
|
|
487
|
-
const a =
|
|
488
|
-
return Math.max(
|
|
486
|
+
const o = t.boxes.reduce((s, n) => {
|
|
487
|
+
const a = n.position.y + n.box.dimensions.height;
|
|
488
|
+
return Math.max(s, a);
|
|
489
489
|
}, 0);
|
|
490
|
-
e +=
|
|
490
|
+
e += o, t.separatorAbove && (e += t.separatorAbove.dimensions.height);
|
|
491
491
|
}
|
|
492
492
|
return e;
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function ye(i) {
|
|
495
495
|
let e = 0;
|
|
496
|
-
for (const t of
|
|
497
|
-
e += t.pallet.weight, e += t.boxes.reduce((
|
|
496
|
+
for (const t of i.floors)
|
|
497
|
+
e += t.pallet.weight, e += t.boxes.reduce((o, s) => o + s.box.weight, 0), t.separatorAbove && (e += t.separatorAbove.weight);
|
|
498
498
|
return e;
|
|
499
499
|
}
|
|
500
|
-
function
|
|
501
|
-
const t = e ||
|
|
502
|
-
const a =
|
|
503
|
-
const
|
|
504
|
-
const
|
|
505
|
-
return
|
|
500
|
+
function Je(i, e) {
|
|
501
|
+
const t = e || i.id, o = i.floors.map((s, n) => {
|
|
502
|
+
const a = s.boxes.map((c, l) => {
|
|
503
|
+
const f = `${t}:f${n}:b${l}`, h = (g) => g.map((w) => {
|
|
504
|
+
const m = s.boxes.findIndex((x) => x.id === w);
|
|
505
|
+
return m >= 0 ? `${t}:f${n}:b${m}` : w;
|
|
506
506
|
});
|
|
507
507
|
return {
|
|
508
|
-
...
|
|
509
|
-
id:
|
|
510
|
-
supportedBy:
|
|
511
|
-
supporting:
|
|
508
|
+
...c,
|
|
509
|
+
id: f,
|
|
510
|
+
supportedBy: h(c.supportedBy),
|
|
511
|
+
supporting: h(c.supporting)
|
|
512
512
|
};
|
|
513
513
|
});
|
|
514
514
|
return {
|
|
515
|
-
...
|
|
515
|
+
...s,
|
|
516
516
|
boxes: a
|
|
517
517
|
};
|
|
518
518
|
});
|
|
519
519
|
return {
|
|
520
|
-
...
|
|
521
|
-
floors:
|
|
520
|
+
...i,
|
|
521
|
+
floors: o
|
|
522
522
|
};
|
|
523
523
|
}
|
|
524
|
-
function
|
|
525
|
-
let e =
|
|
526
|
-
const
|
|
527
|
-
return (
|
|
528
|
-
minX:
|
|
529
|
-
maxX:
|
|
530
|
-
minY:
|
|
531
|
-
maxY:
|
|
532
|
-
minZ:
|
|
533
|
-
maxZ:
|
|
524
|
+
function L(i) {
|
|
525
|
+
let e = i.box.dimensions.width, t = i.box.dimensions.depth;
|
|
526
|
+
const o = i.box.dimensions.height;
|
|
527
|
+
return (i.rotation.y === 90 || i.rotation.y === 270) && ([e, t] = [t, e]), {
|
|
528
|
+
minX: i.position.x,
|
|
529
|
+
maxX: i.position.x + e,
|
|
530
|
+
minY: i.position.y,
|
|
531
|
+
maxY: i.position.y + o,
|
|
532
|
+
minZ: i.position.z,
|
|
533
|
+
maxZ: i.position.z + t
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
|
-
function
|
|
537
|
-
const e =
|
|
536
|
+
function se(i) {
|
|
537
|
+
const e = i.stackedPallet, t = e.floors[0].pallet, o = t.dimensions.width, s = t.dimensions.depth, n = le(e), a = i.yRotation * Math.PI / 180, c = Math.cos(a), l = Math.sin(a), h = [
|
|
538
538
|
{ x: 0, z: 0 },
|
|
539
|
-
{ x:
|
|
540
|
-
{ x:
|
|
541
|
-
{ x: 0, z:
|
|
542
|
-
].map((
|
|
543
|
-
x:
|
|
544
|
-
z:
|
|
545
|
-
})),
|
|
539
|
+
{ x: o, z: 0 },
|
|
540
|
+
{ x: o, z: s },
|
|
541
|
+
{ x: 0, z: s }
|
|
542
|
+
].map((u) => ({
|
|
543
|
+
x: i.position.x + u.x * c + u.z * l,
|
|
544
|
+
z: i.position.z - u.x * l + u.z * c
|
|
545
|
+
})), g = Math.min(...h.map((u) => u.x)), w = Math.max(...h.map((u) => u.x)), m = Math.min(...h.map((u) => u.z)), x = Math.max(...h.map((u) => u.z));
|
|
546
546
|
return {
|
|
547
|
-
minX:
|
|
548
|
-
maxX:
|
|
549
|
-
minY:
|
|
550
|
-
maxY:
|
|
551
|
-
minZ:
|
|
552
|
-
maxZ:
|
|
547
|
+
minX: g,
|
|
548
|
+
maxX: w,
|
|
549
|
+
minY: i.position.y,
|
|
550
|
+
maxY: i.position.y + n,
|
|
551
|
+
minZ: m,
|
|
552
|
+
maxZ: x
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
|
-
function
|
|
556
|
-
return
|
|
555
|
+
function ve(i, e, t = Ne) {
|
|
556
|
+
return i.minX < e.maxX - t && i.maxX > e.minX + t && i.minY < e.maxY - t && i.maxY > e.minY + t && i.minZ < e.maxZ - t && i.maxZ > e.minZ + t;
|
|
557
557
|
}
|
|
558
|
-
function
|
|
558
|
+
function Qe(i) {
|
|
559
559
|
const e = [];
|
|
560
|
-
for (let t = 0; t <
|
|
561
|
-
for (let
|
|
562
|
-
const
|
|
563
|
-
|
|
560
|
+
for (let t = 0; t < i.length; t++)
|
|
561
|
+
for (let o = t + 1; o < i.length; o++) {
|
|
562
|
+
const s = L(i[t]), n = L(i[o]);
|
|
563
|
+
ve(s, n) && e.push({
|
|
564
564
|
code: "BR-002",
|
|
565
565
|
severity: "error",
|
|
566
|
-
message: `Colisión entre cajas ${
|
|
567
|
-
involvedIds: [
|
|
566
|
+
message: `Colisión entre cajas ${i[t].id} y ${i[o].id}`,
|
|
567
|
+
involvedIds: [i[t].id, i[o].id]
|
|
568
568
|
});
|
|
569
569
|
}
|
|
570
570
|
return { isValid: e.length === 0, violations: e };
|
|
571
571
|
}
|
|
572
|
-
function
|
|
572
|
+
function Ke(i) {
|
|
573
573
|
const e = [];
|
|
574
|
-
for (let t = 0; t <
|
|
575
|
-
for (let
|
|
576
|
-
const
|
|
577
|
-
|
|
574
|
+
for (let t = 0; t < i.length; t++)
|
|
575
|
+
for (let o = t + 1; o < i.length; o++) {
|
|
576
|
+
const s = se(i[t]), n = se(i[o]);
|
|
577
|
+
ve(s, n) && e.push({
|
|
578
578
|
code: "BR-003",
|
|
579
579
|
severity: "error",
|
|
580
|
-
message: `Colisión entre palets ${
|
|
581
|
-
involvedIds: [
|
|
580
|
+
message: `Colisión entre palets ${i[t].id} y ${i[o].id}`,
|
|
581
|
+
involvedIds: [i[t].id, i[o].id]
|
|
582
582
|
});
|
|
583
583
|
}
|
|
584
584
|
return { isValid: e.length === 0, violations: e };
|
|
585
585
|
}
|
|
586
|
-
function
|
|
587
|
-
const t = [],
|
|
588
|
-
return (
|
|
586
|
+
function et(i, e) {
|
|
587
|
+
const t = [], o = L(i);
|
|
588
|
+
return (o.minX < 0 || o.maxX > e.dimensions.width) && t.push({
|
|
589
589
|
code: "BR-001",
|
|
590
590
|
severity: "error",
|
|
591
|
-
message: `Caja ${
|
|
592
|
-
involvedIds: [
|
|
593
|
-
}), (
|
|
591
|
+
message: `Caja ${i.id} sobresale por el eje X del palet`,
|
|
592
|
+
involvedIds: [i.id, e.id]
|
|
593
|
+
}), (o.minZ < 0 || o.maxZ > e.dimensions.depth) && t.push({
|
|
594
594
|
code: "BR-001",
|
|
595
595
|
severity: "error",
|
|
596
|
-
message: `Caja ${
|
|
597
|
-
involvedIds: [
|
|
598
|
-
}),
|
|
596
|
+
message: `Caja ${i.id} sobresale por el eje Z del palet`,
|
|
597
|
+
involvedIds: [i.id, e.id]
|
|
598
|
+
}), o.maxY > e.maxStackHeight && t.push({
|
|
599
599
|
code: "BR-001",
|
|
600
600
|
severity: "error",
|
|
601
|
-
message: `Caja ${
|
|
602
|
-
involvedIds: [
|
|
601
|
+
message: `Caja ${i.id} excede la altura máxima de apilamiento del palet`,
|
|
602
|
+
involvedIds: [i.id, e.id]
|
|
603
603
|
}), { isValid: t.length === 0, violations: t };
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function tt(i, e) {
|
|
606
606
|
const t = [];
|
|
607
|
-
for (const
|
|
608
|
-
const
|
|
609
|
-
t.push(...
|
|
607
|
+
for (const o of i) {
|
|
608
|
+
const s = et(o, e);
|
|
609
|
+
t.push(...s.violations);
|
|
610
610
|
}
|
|
611
611
|
return { isValid: t.length === 0, violations: t };
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
const t = [],
|
|
615
|
-
return (
|
|
613
|
+
function ot(i, e) {
|
|
614
|
+
const t = [], o = se(i), s = e.dimensions;
|
|
615
|
+
return (o.minX < 0 || o.maxX > s.width) && t.push({
|
|
616
616
|
code: "BR-402",
|
|
617
617
|
severity: "error",
|
|
618
|
-
message: `Palet ${
|
|
619
|
-
involvedIds: [
|
|
620
|
-
}), (
|
|
618
|
+
message: `Palet ${i.id} sobresale por el ancho del camión`,
|
|
619
|
+
involvedIds: [i.id, e.id]
|
|
620
|
+
}), (o.minZ < 0 || o.maxZ > s.depth) && t.push({
|
|
621
621
|
code: "BR-402",
|
|
622
622
|
severity: "error",
|
|
623
|
-
message: `Palet ${
|
|
624
|
-
involvedIds: [
|
|
625
|
-
}),
|
|
623
|
+
message: `Palet ${i.id} sobresale por la profundidad del camión`,
|
|
624
|
+
involvedIds: [i.id, e.id]
|
|
625
|
+
}), o.maxY > s.height && t.push({
|
|
626
626
|
code: "BR-404",
|
|
627
627
|
severity: "error",
|
|
628
|
-
message: `Palet ${
|
|
629
|
-
involvedIds: [
|
|
628
|
+
message: `Palet ${i.id} excede la altura del camión`,
|
|
629
|
+
involvedIds: [i.id, e.id]
|
|
630
630
|
}), { isValid: t.length === 0, violations: t };
|
|
631
631
|
}
|
|
632
|
-
function
|
|
633
|
-
const t = [],
|
|
634
|
-
return
|
|
632
|
+
function Bt(i, e) {
|
|
633
|
+
const t = [], o = se(i);
|
|
634
|
+
return o.maxY > e && t.push({
|
|
635
635
|
code: "BR-403",
|
|
636
636
|
severity: "error",
|
|
637
|
-
message: `Palet ${
|
|
638
|
-
involvedIds: [
|
|
637
|
+
message: `Palet ${i.id} excede el techo de la estancia (${o.maxY}mm > ${e}mm)`,
|
|
638
|
+
involvedIds: [i.id]
|
|
639
639
|
}), { isValid: t.length === 0, violations: t };
|
|
640
640
|
}
|
|
641
|
-
function it(
|
|
642
|
-
const e = [], t =
|
|
643
|
-
return t >
|
|
641
|
+
function it(i) {
|
|
642
|
+
const e = [], t = i.boxes.reduce((s, n) => s + n.box.weight, 0), o = i.pallet.maxWeight;
|
|
643
|
+
return t > o ? e.push({
|
|
644
644
|
code: "BR-101",
|
|
645
645
|
severity: "error",
|
|
646
|
-
message: `Peso de cajas (${t.toFixed(1)}kg) excede el máximo del palet (${
|
|
647
|
-
involvedIds: [
|
|
648
|
-
}) : t >
|
|
646
|
+
message: `Peso de cajas (${t.toFixed(1)}kg) excede el máximo del palet (${o}kg)`,
|
|
647
|
+
involvedIds: [i.pallet.id]
|
|
648
|
+
}) : t > o * Ie && e.push({
|
|
649
649
|
code: "BR-101",
|
|
650
650
|
severity: "warning",
|
|
651
|
-
message: `Peso de cajas (${t.toFixed(1)}kg) supera el 90% del máximo del palet (${
|
|
652
|
-
involvedIds: [
|
|
653
|
-
}), { isValid: e.filter((
|
|
651
|
+
message: `Peso de cajas (${t.toFixed(1)}kg) supera el 90% del máximo del palet (${o}kg)`,
|
|
652
|
+
involvedIds: [i.pallet.id]
|
|
653
|
+
}), { isValid: e.filter((s) => s.severity === "error").length === 0, violations: e };
|
|
654
654
|
}
|
|
655
|
-
function
|
|
656
|
-
const e = [], t =
|
|
657
|
-
(
|
|
655
|
+
function Wt(i) {
|
|
656
|
+
const e = [], t = i.pallets.reduce(
|
|
657
|
+
(o, s) => o + ye(s.stackedPallet),
|
|
658
658
|
0
|
|
659
659
|
);
|
|
660
|
-
return t >
|
|
660
|
+
return t > i.maxWeight ? e.push({
|
|
661
661
|
code: "BR-102",
|
|
662
662
|
severity: "error",
|
|
663
|
-
message: `Peso total (${t.toFixed(1)}kg) excede el máximo del camión (${
|
|
664
|
-
involvedIds: [
|
|
665
|
-
}) : t >
|
|
663
|
+
message: `Peso total (${t.toFixed(1)}kg) excede el máximo del camión (${i.maxWeight}kg)`,
|
|
664
|
+
involvedIds: [i.id]
|
|
665
|
+
}) : t > i.maxWeight * Ie && e.push({
|
|
666
666
|
code: "BR-102",
|
|
667
667
|
severity: "warning",
|
|
668
|
-
message: `Peso total (${t.toFixed(1)}kg) supera el 90% del máximo del camión (${
|
|
669
|
-
involvedIds: [
|
|
670
|
-
}), { isValid: e.filter((
|
|
668
|
+
message: `Peso total (${t.toFixed(1)}kg) supera el 90% del máximo del camión (${i.maxWeight}kg)`,
|
|
669
|
+
involvedIds: [i.id]
|
|
670
|
+
}), { isValid: e.filter((o) => o.severity === "error").length === 0, violations: e };
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function st(i) {
|
|
673
673
|
const e = [];
|
|
674
|
-
for (const t of
|
|
674
|
+
for (const t of i) {
|
|
675
675
|
if (!t.box.fragile) continue;
|
|
676
|
-
const
|
|
677
|
-
|
|
676
|
+
const o = t.box.fragilityMaxWeight ?? 0, s = nt(t, i);
|
|
677
|
+
s > o && e.push({
|
|
678
678
|
code: "BR-103",
|
|
679
679
|
severity: "error",
|
|
680
|
-
message: `Caja frágil ${t.id} soporta ${
|
|
680
|
+
message: `Caja frágil ${t.id} soporta ${s.toFixed(1)}kg (máx: ${o}kg)`,
|
|
681
681
|
involvedIds: [t.id]
|
|
682
682
|
});
|
|
683
683
|
}
|
|
684
684
|
return { isValid: e.length === 0, violations: e };
|
|
685
685
|
}
|
|
686
|
-
function
|
|
687
|
-
const t =
|
|
688
|
-
let
|
|
689
|
-
for (const
|
|
690
|
-
if (
|
|
691
|
-
const
|
|
692
|
-
|
|
693
|
-
}
|
|
694
|
-
return
|
|
686
|
+
function nt(i, e) {
|
|
687
|
+
const t = L(i);
|
|
688
|
+
let o = 0;
|
|
689
|
+
for (const s of e) {
|
|
690
|
+
if (s.id === i.id) continue;
|
|
691
|
+
const n = L(s);
|
|
692
|
+
n.minY >= t.maxY - 1 && n.minX < t.maxX && n.maxX > t.minX && n.minZ < t.maxZ && n.maxZ > t.minZ && (o += s.box.weight);
|
|
693
|
+
}
|
|
694
|
+
return o;
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function rt(i, e) {
|
|
697
697
|
const t = [];
|
|
698
698
|
if (e.length === 0) return { isValid: !0, violations: t };
|
|
699
|
-
const
|
|
700
|
-
if (
|
|
701
|
-
let
|
|
702
|
-
for (const
|
|
703
|
-
const
|
|
704
|
-
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
const a =
|
|
708
|
-
return (Math.abs(
|
|
699
|
+
const o = e.reduce((l, f) => l + f.box.weight, 0);
|
|
700
|
+
if (o === 0) return { isValid: !0, violations: t };
|
|
701
|
+
let s = 0, n = 0;
|
|
702
|
+
for (const l of e) {
|
|
703
|
+
const f = L(l), h = (f.minX + f.maxX) / 2, g = (f.minZ + f.maxZ) / 2;
|
|
704
|
+
s += h * l.box.weight, n += g * l.box.weight;
|
|
705
|
+
}
|
|
706
|
+
s /= o, n /= o;
|
|
707
|
+
const a = i.dimensions.width / 2, c = i.dimensions.depth / 2;
|
|
708
|
+
return (Math.abs(s - a) > i.dimensions.width / 6 || Math.abs(n - c) > i.dimensions.depth / 6) && t.push({
|
|
709
709
|
code: "BR-104",
|
|
710
710
|
severity: "warning",
|
|
711
|
-
message: `Centro de gravedad descentrado (${
|
|
712
|
-
involvedIds: [
|
|
711
|
+
message: `Centro de gravedad descentrado (${s.toFixed(0)}, ${n.toFixed(0)}) respecto al centro del palet`,
|
|
712
|
+
involvedIds: [i.id]
|
|
713
713
|
}), { isValid: !0, violations: t };
|
|
714
714
|
}
|
|
715
|
-
function
|
|
715
|
+
function at(i) {
|
|
716
716
|
const e = [];
|
|
717
|
-
for (const t of
|
|
717
|
+
for (const t of i) {
|
|
718
718
|
if (t.box.stackable) continue;
|
|
719
|
-
const
|
|
720
|
-
for (const
|
|
721
|
-
if (
|
|
722
|
-
const
|
|
723
|
-
|
|
719
|
+
const o = L(t);
|
|
720
|
+
for (const s of i) {
|
|
721
|
+
if (s.id === t.id) continue;
|
|
722
|
+
const n = L(s);
|
|
723
|
+
n.minY >= o.maxY - 1 && n.minX < o.maxX && n.maxX > o.minX && n.minZ < o.maxZ && n.maxZ > o.minZ && e.push({
|
|
724
724
|
code: "BR-201",
|
|
725
725
|
severity: "error",
|
|
726
|
-
message: `Caja ${
|
|
727
|
-
involvedIds: [t.id,
|
|
726
|
+
message: `Caja ${s.id} apilada sobre caja no apilable ${t.id}`,
|
|
727
|
+
involvedIds: [t.id, s.id]
|
|
728
728
|
});
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
731
|
return { isValid: e.length === 0, violations: e };
|
|
732
732
|
}
|
|
733
|
-
function
|
|
733
|
+
function ct(i) {
|
|
734
734
|
const e = [];
|
|
735
|
-
for (const t of
|
|
736
|
-
const
|
|
737
|
-
for (const
|
|
738
|
-
if (
|
|
739
|
-
const a =
|
|
740
|
-
if (a.minY <
|
|
741
|
-
const
|
|
742
|
-
|
|
735
|
+
for (const t of i) {
|
|
736
|
+
const o = L(t), s = (o.maxX - o.minX) * (o.maxZ - o.minZ);
|
|
737
|
+
for (const n of i) {
|
|
738
|
+
if (n.id === t.id) continue;
|
|
739
|
+
const a = L(n);
|
|
740
|
+
if (a.minY < o.maxY - 1 || a.minX >= o.maxX || a.maxX <= o.minX || a.minZ >= o.maxZ || a.maxZ <= o.minZ) continue;
|
|
741
|
+
const c = (a.maxX - a.minX) * (a.maxZ - a.minZ);
|
|
742
|
+
n.box.weight > t.box.weight * 1.5 && c > s * 1.2 && e.push({
|
|
743
743
|
code: "BR-203",
|
|
744
744
|
severity: "warning",
|
|
745
|
-
message: `Pirámide invertida: caja ${
|
|
746
|
-
involvedIds: [t.id,
|
|
745
|
+
message: `Pirámide invertida: caja ${n.id} (${n.box.weight}kg) sobre caja ${t.id} (${t.box.weight}kg)`,
|
|
746
|
+
involvedIds: [t.id, n.id]
|
|
747
747
|
});
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
750
|
return { isValid: !0, violations: e };
|
|
751
751
|
}
|
|
752
|
-
function $t(
|
|
752
|
+
function $t(i) {
|
|
753
753
|
const e = [];
|
|
754
|
-
if (
|
|
755
|
-
const t =
|
|
756
|
-
for (let
|
|
757
|
-
const
|
|
758
|
-
(
|
|
754
|
+
if (i.floors.length <= 1) return { isValid: !0, violations: e };
|
|
755
|
+
const t = i.floors[0].pallet;
|
|
756
|
+
for (let o = 1; o < i.floors.length; o++) {
|
|
757
|
+
const s = i.floors[o].pallet;
|
|
758
|
+
(s.dimensions.width !== t.dimensions.width || s.dimensions.depth !== t.dimensions.depth) && e.push({
|
|
759
759
|
code: "BR-301",
|
|
760
760
|
severity: "error",
|
|
761
|
-
message: `Piso ${
|
|
762
|
-
involvedIds: [t.id,
|
|
761
|
+
message: `Piso ${o}: dimensiones (${s.dimensions.width}×${s.dimensions.depth}) distintas a la base (${t.dimensions.width}×${t.dimensions.depth})`,
|
|
762
|
+
involvedIds: [t.id, s.id]
|
|
763
763
|
});
|
|
764
764
|
}
|
|
765
765
|
return { isValid: e.length === 0, violations: e };
|
|
766
766
|
}
|
|
767
|
-
function
|
|
767
|
+
function Lt(i) {
|
|
768
768
|
const e = [];
|
|
769
|
-
for (let t = 0; t <
|
|
770
|
-
|
|
769
|
+
for (let t = 0; t < i.floors.length - 1; t++)
|
|
770
|
+
i.floors[t].separatorAbove || e.push({
|
|
771
771
|
code: "BR-302",
|
|
772
772
|
severity: "error",
|
|
773
773
|
message: `Falta separador entre piso ${t} y piso ${t + 1}`,
|
|
774
|
-
involvedIds: [
|
|
774
|
+
involvedIds: [i.id]
|
|
775
775
|
});
|
|
776
776
|
return { isValid: e.length === 0, violations: e };
|
|
777
777
|
}
|
|
778
|
-
function
|
|
779
|
-
const t = [],
|
|
780
|
-
return
|
|
778
|
+
function Gt(i, e) {
|
|
779
|
+
const t = [], o = le(i);
|
|
780
|
+
return o > e && t.push({
|
|
781
781
|
code: "BR-303",
|
|
782
782
|
severity: "error",
|
|
783
|
-
message: `Altura del stack (${
|
|
784
|
-
involvedIds: [
|
|
783
|
+
message: `Altura del stack (${o}mm) excede la del contenedor (${e}mm)`,
|
|
784
|
+
involvedIds: [i.id]
|
|
785
785
|
}), { isValid: t.length === 0, violations: t };
|
|
786
786
|
}
|
|
787
|
-
function
|
|
788
|
-
const e = [], t =
|
|
789
|
-
return
|
|
787
|
+
function Vt(i) {
|
|
788
|
+
const e = [], t = ye(i), o = i.floors[0].pallet.maxWeight, s = t - i.floors[0].pallet.weight;
|
|
789
|
+
return s > o && e.push({
|
|
790
790
|
code: "BR-304",
|
|
791
791
|
severity: "error",
|
|
792
|
-
message: `Peso de carga del stack (${
|
|
793
|
-
involvedIds: [
|
|
792
|
+
message: `Peso de carga del stack (${s.toFixed(1)}kg) excede la capacidad del palet base (${o}kg)`,
|
|
793
|
+
involvedIds: [i.id]
|
|
794
794
|
}), { isValid: e.length === 0, violations: e };
|
|
795
795
|
}
|
|
796
|
-
function
|
|
796
|
+
function lt(i) {
|
|
797
797
|
const e = [];
|
|
798
|
-
for (const t of
|
|
799
|
-
const
|
|
800
|
-
if (
|
|
801
|
-
const
|
|
802
|
-
let
|
|
803
|
-
for (const a of
|
|
798
|
+
for (const t of i) {
|
|
799
|
+
const o = L(t);
|
|
800
|
+
if (o.minY <= 1) continue;
|
|
801
|
+
const s = (o.maxX - o.minX) * (o.maxZ - o.minZ);
|
|
802
|
+
let n = 0;
|
|
803
|
+
for (const a of i) {
|
|
804
804
|
if (a.id === t.id) continue;
|
|
805
|
-
const
|
|
806
|
-
if (Math.abs(
|
|
807
|
-
const
|
|
808
|
-
|
|
805
|
+
const c = L(a);
|
|
806
|
+
if (Math.abs(c.maxY - o.minY) > 2) continue;
|
|
807
|
+
const l = Math.max(0, Math.min(o.maxX, c.maxX) - Math.max(o.minX, c.minX)), f = Math.max(0, Math.min(o.maxZ, c.maxZ) - Math.max(o.minZ, c.minZ));
|
|
808
|
+
n += l * f;
|
|
809
809
|
}
|
|
810
|
-
|
|
810
|
+
s > 0 && n / s < ze && e.push({
|
|
811
811
|
code: "BR-004",
|
|
812
812
|
severity: "error",
|
|
813
|
-
message: `Caja ${t.id} sin soporte suficiente (${(
|
|
813
|
+
message: `Caja ${t.id} sin soporte suficiente (${(n / s * 100).toFixed(0)}% < ${ze * 100}%)`,
|
|
814
814
|
involvedIds: [t.id]
|
|
815
815
|
});
|
|
816
816
|
}
|
|
817
817
|
return { isValid: e.length === 0, violations: e };
|
|
818
818
|
}
|
|
819
|
-
function
|
|
820
|
-
if (
|
|
821
|
-
let e = 0, t = 0,
|
|
822
|
-
for (const
|
|
823
|
-
const a =
|
|
824
|
-
t +=
|
|
819
|
+
function Y(i) {
|
|
820
|
+
if (i.length === 0) return { x: 0, y: 0, z: 0 };
|
|
821
|
+
let e = 0, t = 0, o = 0, s = 0;
|
|
822
|
+
for (const n of i) {
|
|
823
|
+
const a = L(n), c = (a.minX + a.maxX) / 2, l = (a.minY + a.maxY) / 2, f = (a.minZ + a.maxZ) / 2, h = n.box.weight;
|
|
824
|
+
t += c * h, o += l * h, s += f * h, e += h;
|
|
825
825
|
}
|
|
826
826
|
return e === 0 ? { x: 0, y: 0, z: 0 } : {
|
|
827
827
|
x: t / e,
|
|
828
|
-
y:
|
|
829
|
-
z:
|
|
828
|
+
y: o / e,
|
|
829
|
+
z: s / e
|
|
830
830
|
};
|
|
831
831
|
}
|
|
832
|
-
function
|
|
832
|
+
function ee(i, e) {
|
|
833
833
|
if (e.length === 0) return 100;
|
|
834
|
-
const t =
|
|
835
|
-
const
|
|
836
|
-
return Math.max(
|
|
837
|
-
}, 0),
|
|
838
|
-
return Math.round(
|
|
834
|
+
const t = Y(e), o = i.dimensions.width / 2, s = i.dimensions.depth / 2, n = Math.abs(t.x - o) / (i.dimensions.width / 2), a = Math.abs(t.z - s) / (i.dimensions.depth / 2), c = Math.max(0, 100 - (n + a) * 50), l = e.reduce((g, w) => {
|
|
835
|
+
const m = L(w);
|
|
836
|
+
return Math.max(g, m.maxY);
|
|
837
|
+
}, 0), f = l > 0 ? t.y / l : 0, h = Math.max(0, 100 - Math.max(0, f - 0.5) * 100);
|
|
838
|
+
return Math.round(c * 0.7 + h * 0.3);
|
|
839
839
|
}
|
|
840
|
-
function
|
|
840
|
+
function dt(i, e) {
|
|
841
841
|
const t = [];
|
|
842
842
|
if (e.length === 0) return { isValid: !0, violations: t };
|
|
843
|
-
const
|
|
844
|
-
return (
|
|
843
|
+
const o = Y(e);
|
|
844
|
+
return (o.x < 0 || o.x > i.dimensions.width || o.z < 0 || o.z > i.dimensions.depth) && t.push({
|
|
845
845
|
code: "BR-502",
|
|
846
846
|
severity: "error",
|
|
847
|
-
message: `Centro de gravedad (${
|
|
848
|
-
involvedIds: [
|
|
847
|
+
message: `Centro de gravedad (${o.x.toFixed(0)}, ${o.z.toFixed(0)}) fuera del palet`,
|
|
848
|
+
involvedIds: [i.id]
|
|
849
849
|
}), { isValid: t.length === 0, violations: t };
|
|
850
850
|
}
|
|
851
|
-
function
|
|
851
|
+
function ht(i, e) {
|
|
852
852
|
const t = [];
|
|
853
853
|
if (e.length === 0) return { isValid: !0, violations: t };
|
|
854
|
-
const
|
|
855
|
-
|
|
854
|
+
const o = ee(i, e);
|
|
855
|
+
o < 50 ? t.push({
|
|
856
856
|
code: "BR-501",
|
|
857
857
|
severity: "error",
|
|
858
|
-
message: `Score de estabilidad bajo (${
|
|
859
|
-
involvedIds: [
|
|
860
|
-
}) :
|
|
858
|
+
message: `Score de estabilidad bajo (${o}/100, mínimo: 50)`,
|
|
859
|
+
involvedIds: [i.id]
|
|
860
|
+
}) : o < 70 && t.push({
|
|
861
861
|
code: "BR-501",
|
|
862
862
|
severity: "warning",
|
|
863
|
-
message: `Score de estabilidad mejorable (${
|
|
864
|
-
involvedIds: [
|
|
863
|
+
message: `Score de estabilidad mejorable (${o}/100, recomendado: ≥70)`,
|
|
864
|
+
involvedIds: [i.id]
|
|
865
865
|
});
|
|
866
|
-
const
|
|
867
|
-
return
|
|
866
|
+
const s = Y(e), n = e.reduce((a, c) => Math.max(a, L(c).maxY), 0);
|
|
867
|
+
return n > 0 && s.y > n * 0.6 && t.push({
|
|
868
868
|
code: "BR-503",
|
|
869
869
|
severity: "warning",
|
|
870
|
-
message: `Centro de gravedad alto (${
|
|
871
|
-
involvedIds: [
|
|
870
|
+
message: `Centro de gravedad alto (${s.y.toFixed(0)}mm, ${(s.y / n * 100).toFixed(0)}% de la altura)`,
|
|
871
|
+
involvedIds: [i.id]
|
|
872
872
|
}), { isValid: t.filter((a) => a.severity === "error").length === 0, violations: t };
|
|
873
873
|
}
|
|
874
|
-
function
|
|
874
|
+
function mt(i, e) {
|
|
875
875
|
let t = !1;
|
|
876
|
-
const
|
|
877
|
-
for (let
|
|
878
|
-
const a = e[
|
|
879
|
-
|
|
876
|
+
const o = e.length;
|
|
877
|
+
for (let s = 0, n = o - 1; s < o; n = s++) {
|
|
878
|
+
const a = e[s].x, c = e[s].z, l = e[n].x, f = e[n].z;
|
|
879
|
+
c > i.z != f > i.z && i.x < (l - a) * (i.z - c) / (f - c) + a && (t = !t);
|
|
880
880
|
}
|
|
881
881
|
return t;
|
|
882
882
|
}
|
|
883
|
-
function We(
|
|
884
|
-
const t = [],
|
|
885
|
-
{ x:
|
|
886
|
-
{ x:
|
|
887
|
-
{ x:
|
|
888
|
-
{ x:
|
|
883
|
+
function We(i, e) {
|
|
884
|
+
const t = [], o = se(i), s = [
|
|
885
|
+
{ x: o.minX, z: o.minZ },
|
|
886
|
+
{ x: o.maxX, z: o.minZ },
|
|
887
|
+
{ x: o.maxX, z: o.maxZ },
|
|
888
|
+
{ x: o.minX, z: o.maxZ }
|
|
889
889
|
];
|
|
890
|
-
for (const
|
|
891
|
-
if (!
|
|
890
|
+
for (const n of s)
|
|
891
|
+
if (!mt(n, e.floorPolygon)) {
|
|
892
892
|
t.push({
|
|
893
893
|
code: "BR-401",
|
|
894
894
|
severity: "error",
|
|
895
|
-
message: `Palet ${
|
|
896
|
-
involvedIds: [
|
|
895
|
+
message: `Palet ${i.id} fuera de la estancia ${e.name} en (${n.x}, ${n.z})`,
|
|
896
|
+
involvedIds: [i.id, e.id]
|
|
897
897
|
});
|
|
898
898
|
break;
|
|
899
899
|
}
|
|
900
|
-
return
|
|
900
|
+
return o.maxY > e.ceilingHeight && t.push({
|
|
901
901
|
code: "BR-403",
|
|
902
902
|
severity: "error",
|
|
903
|
-
message: `Palet ${
|
|
904
|
-
involvedIds: [
|
|
903
|
+
message: `Palet ${i.id} excede el techo de la estancia ${e.name}`,
|
|
904
|
+
involvedIds: [i.id, e.id]
|
|
905
905
|
}), { isValid: t.length === 0, violations: t };
|
|
906
906
|
}
|
|
907
|
-
class
|
|
907
|
+
class ut {
|
|
908
908
|
id = "column";
|
|
909
909
|
name = "Columnas por tipo";
|
|
910
910
|
pack(e, t) {
|
|
911
|
-
const
|
|
912
|
-
for (const
|
|
913
|
-
const
|
|
914
|
-
|
|
911
|
+
const o = [], s = [], n = /* @__PURE__ */ new Map();
|
|
912
|
+
for (const m of e) {
|
|
913
|
+
const x = m.type ?? m.sku ?? "default";
|
|
914
|
+
n.has(x) || n.set(x, []), n.get(x).push(m);
|
|
915
915
|
}
|
|
916
|
-
let a = 0,
|
|
917
|
-
for (const [,
|
|
918
|
-
if (
|
|
919
|
-
const
|
|
920
|
-
if (a +
|
|
921
|
-
|
|
916
|
+
let a = 0, c = 0;
|
|
917
|
+
for (const [, m] of n) {
|
|
918
|
+
if (m.length === 0) continue;
|
|
919
|
+
const x = m[0], u = x.dimensions.width, d = x.dimensions.depth, b = x.dimensions.height;
|
|
920
|
+
if (a + u > t.dimensions.width) {
|
|
921
|
+
s.push(...m);
|
|
922
922
|
continue;
|
|
923
923
|
}
|
|
924
|
-
let
|
|
925
|
-
for (;
|
|
926
|
-
const
|
|
927
|
-
if (
|
|
928
|
-
if (
|
|
929
|
-
|
|
924
|
+
let j = 0, E = 0, S = 0;
|
|
925
|
+
for (; S < m.length; ) {
|
|
926
|
+
const C = m[S];
|
|
927
|
+
if (j + d > t.dimensions.depth) {
|
|
928
|
+
if (j = 0, E += b, E + b > t.maxStackHeight) {
|
|
929
|
+
s.push(...m.slice(S));
|
|
930
930
|
break;
|
|
931
931
|
}
|
|
932
932
|
continue;
|
|
933
933
|
}
|
|
934
|
-
|
|
935
|
-
id: `placed-${++
|
|
936
|
-
box:
|
|
937
|
-
position: { x: a, y:
|
|
934
|
+
o.push({
|
|
935
|
+
id: `placed-${++c}`,
|
|
936
|
+
box: C,
|
|
937
|
+
position: { x: a, y: E, z: j },
|
|
938
938
|
rotation: { x: 0, y: 0, z: 0 },
|
|
939
939
|
supportedBy: [],
|
|
940
940
|
supporting: []
|
|
941
|
-
}),
|
|
941
|
+
}), j += d, S++;
|
|
942
942
|
}
|
|
943
|
-
a +=
|
|
943
|
+
a += u;
|
|
944
944
|
}
|
|
945
|
-
const
|
|
946
|
-
const
|
|
947
|
-
return
|
|
948
|
-
}, 0),
|
|
945
|
+
const l = t.dimensions.width * t.maxStackHeight * t.dimensions.depth, f = o.reduce((m, x) => {
|
|
946
|
+
const u = x.box.dimensions;
|
|
947
|
+
return m + u.width * u.height * u.depth;
|
|
948
|
+
}, 0), h = o.reduce((m, x) => m + x.box.weight, 0), g = Y(o), w = ee(t, o);
|
|
949
949
|
return {
|
|
950
|
-
placements:
|
|
950
|
+
placements: o,
|
|
951
951
|
metrics: {
|
|
952
|
-
volumeUtilization:
|
|
953
|
-
weightUtilization: t.maxWeight > 0 ?
|
|
954
|
-
centerOfGravity:
|
|
955
|
-
stabilityScore:
|
|
952
|
+
volumeUtilization: l > 0 ? f / l : 0,
|
|
953
|
+
weightUtilization: t.maxWeight > 0 ? h / t.maxWeight : 0,
|
|
954
|
+
centerOfGravity: g,
|
|
955
|
+
stabilityScore: w
|
|
956
956
|
},
|
|
957
|
-
unplacedBoxes:
|
|
957
|
+
unplacedBoxes: s
|
|
958
958
|
};
|
|
959
959
|
}
|
|
960
960
|
}
|
|
961
|
-
class
|
|
961
|
+
class xt {
|
|
962
962
|
id = "bin-packing-3d";
|
|
963
963
|
name = "Bin Packing 3D (FFD Height)";
|
|
964
964
|
pack(e, t) {
|
|
965
|
-
const
|
|
966
|
-
const
|
|
967
|
-
return
|
|
965
|
+
const o = [], s = [], n = [...e].sort((g, w) => {
|
|
966
|
+
const m = g.dimensions.width * g.dimensions.height * g.dimensions.depth;
|
|
967
|
+
return w.dimensions.width * w.dimensions.height * w.dimensions.depth - m;
|
|
968
968
|
}), a = [
|
|
969
969
|
{
|
|
970
970
|
x: 0,
|
|
@@ -975,124 +975,646 @@ class ut {
|
|
|
975
975
|
depth: t.dimensions.depth
|
|
976
976
|
}
|
|
977
977
|
];
|
|
978
|
-
let
|
|
979
|
-
for (const
|
|
980
|
-
let
|
|
981
|
-
const
|
|
982
|
-
{ w:
|
|
983
|
-
{ w:
|
|
978
|
+
let c = 0;
|
|
979
|
+
for (const g of n) {
|
|
980
|
+
let w = !1;
|
|
981
|
+
const m = [
|
|
982
|
+
{ w: g.dimensions.width, h: g.dimensions.height, d: g.dimensions.depth, rot: 0 },
|
|
983
|
+
{ w: g.dimensions.depth, h: g.dimensions.height, d: g.dimensions.width, rot: 90 }
|
|
984
984
|
];
|
|
985
|
-
for (let
|
|
986
|
-
const
|
|
987
|
-
for (const
|
|
988
|
-
if (
|
|
989
|
-
const
|
|
990
|
-
id: `placed-${++
|
|
991
|
-
box:
|
|
992
|
-
position: { x:
|
|
993
|
-
rotation: { x: 0, y:
|
|
985
|
+
for (let x = 0; x < a.length && !w; x++) {
|
|
986
|
+
const u = a[x];
|
|
987
|
+
for (const d of m)
|
|
988
|
+
if (d.w <= u.width && d.h <= u.height && d.d <= u.depth) {
|
|
989
|
+
const b = {
|
|
990
|
+
id: `placed-${++c}`,
|
|
991
|
+
box: g,
|
|
992
|
+
position: { x: u.x, y: u.y, z: u.z },
|
|
993
|
+
rotation: { x: 0, y: d.rot, z: 0 },
|
|
994
994
|
supportedBy: [],
|
|
995
995
|
supporting: []
|
|
996
|
-
},
|
|
997
|
-
if (!
|
|
998
|
-
(
|
|
996
|
+
}, j = L(b);
|
|
997
|
+
if (!o.some(
|
|
998
|
+
(S) => ve(L(S), j)
|
|
999
999
|
)) {
|
|
1000
|
-
|
|
1001
|
-
x:
|
|
1002
|
-
y:
|
|
1003
|
-
z:
|
|
1004
|
-
width:
|
|
1005
|
-
height:
|
|
1006
|
-
depth:
|
|
1007
|
-
}),
|
|
1008
|
-
x:
|
|
1009
|
-
y:
|
|
1010
|
-
z:
|
|
1011
|
-
width:
|
|
1012
|
-
height:
|
|
1013
|
-
depth:
|
|
1014
|
-
}),
|
|
1015
|
-
x:
|
|
1016
|
-
y:
|
|
1017
|
-
z:
|
|
1018
|
-
width:
|
|
1019
|
-
height:
|
|
1020
|
-
depth:
|
|
1021
|
-
}), a.sort((
|
|
1000
|
+
o.push(b), w = !0, a.splice(x, 1), u.width - d.w > 0 && a.push({
|
|
1001
|
+
x: u.x + d.w,
|
|
1002
|
+
y: u.y,
|
|
1003
|
+
z: u.z,
|
|
1004
|
+
width: u.width - d.w,
|
|
1005
|
+
height: u.height,
|
|
1006
|
+
depth: u.depth
|
|
1007
|
+
}), u.height - d.h > 0 && a.push({
|
|
1008
|
+
x: u.x,
|
|
1009
|
+
y: u.y + d.h,
|
|
1010
|
+
z: u.z,
|
|
1011
|
+
width: d.w,
|
|
1012
|
+
height: u.height - d.h,
|
|
1013
|
+
depth: d.d
|
|
1014
|
+
}), u.depth - d.d > 0 && a.push({
|
|
1015
|
+
x: u.x,
|
|
1016
|
+
y: u.y,
|
|
1017
|
+
z: u.z + d.d,
|
|
1018
|
+
width: d.w,
|
|
1019
|
+
height: u.height,
|
|
1020
|
+
depth: u.depth - d.d
|
|
1021
|
+
}), a.sort((S, C) => S.y - C.y || S.x - C.x || S.z - C.z);
|
|
1022
1022
|
break;
|
|
1023
1023
|
}
|
|
1024
1024
|
}
|
|
1025
1025
|
}
|
|
1026
|
-
|
|
1026
|
+
w || s.push(g);
|
|
1027
1027
|
}
|
|
1028
|
-
const
|
|
1029
|
-
const
|
|
1030
|
-
return
|
|
1031
|
-
}, 0),
|
|
1028
|
+
const l = t.dimensions.width * t.maxStackHeight * t.dimensions.depth, f = o.reduce((g, w) => {
|
|
1029
|
+
const m = w.box.dimensions;
|
|
1030
|
+
return g + m.width * m.height * m.depth;
|
|
1031
|
+
}, 0), h = o.reduce((g, w) => g + w.box.weight, 0);
|
|
1032
1032
|
return {
|
|
1033
|
-
placements:
|
|
1033
|
+
placements: o,
|
|
1034
1034
|
metrics: {
|
|
1035
|
-
volumeUtilization:
|
|
1036
|
-
weightUtilization: t.maxWeight > 0 ?
|
|
1037
|
-
centerOfGravity:
|
|
1038
|
-
stabilityScore:
|
|
1035
|
+
volumeUtilization: l > 0 ? f / l : 0,
|
|
1036
|
+
weightUtilization: t.maxWeight > 0 ? h / t.maxWeight : 0,
|
|
1037
|
+
centerOfGravity: Y(o),
|
|
1038
|
+
stabilityScore: ee(t, o)
|
|
1039
1039
|
},
|
|
1040
|
-
unplacedBoxes:
|
|
1040
|
+
unplacedBoxes: s
|
|
1041
1041
|
};
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
|
-
class
|
|
1044
|
+
class gt {
|
|
1045
1045
|
id = "type-group";
|
|
1046
1046
|
name = "Agrupación por tipo";
|
|
1047
1047
|
pack(e, t) {
|
|
1048
|
-
const
|
|
1049
|
-
const
|
|
1050
|
-
return
|
|
1048
|
+
const o = [], s = [], n = [...e].sort((x, u) => {
|
|
1049
|
+
const d = x.type ?? x.sku ?? "z", b = u.type ?? u.sku ?? "z";
|
|
1050
|
+
return d !== b ? d.localeCompare(b) : x.fragile !== u.fragile ? x.fragile ? 1 : -1 : u.weight - x.weight;
|
|
1051
1051
|
});
|
|
1052
|
-
let a = 0,
|
|
1053
|
-
for (const
|
|
1054
|
-
const
|
|
1055
|
-
if (a +
|
|
1056
|
-
|
|
1052
|
+
let a = 0, c = 0, l = 0, f = 0, h = 0;
|
|
1053
|
+
for (const x of n) {
|
|
1054
|
+
const u = x.dimensions.width, d = x.dimensions.height, b = x.dimensions.depth;
|
|
1055
|
+
if (a + u > t.dimensions.width && (a = 0, c += f > 0 ? b : 0), c + b > t.dimensions.depth && (a = 0, c = 0, l += f, f = 0), l + d > t.maxStackHeight) {
|
|
1056
|
+
s.push(x);
|
|
1057
1057
|
continue;
|
|
1058
1058
|
}
|
|
1059
|
-
if (a +
|
|
1060
|
-
|
|
1059
|
+
if (a + u > t.dimensions.width) {
|
|
1060
|
+
s.push(x);
|
|
1061
1061
|
continue;
|
|
1062
1062
|
}
|
|
1063
|
-
if (
|
|
1064
|
-
|
|
1063
|
+
if (c + b > t.dimensions.depth) {
|
|
1064
|
+
s.push(x);
|
|
1065
1065
|
continue;
|
|
1066
1066
|
}
|
|
1067
|
-
|
|
1068
|
-
id: `placed-${++
|
|
1069
|
-
box:
|
|
1070
|
-
position: { x: a, y:
|
|
1067
|
+
o.push({
|
|
1068
|
+
id: `placed-${++h}`,
|
|
1069
|
+
box: x,
|
|
1070
|
+
position: { x: a, y: l, z: c },
|
|
1071
1071
|
rotation: { x: 0, y: 0, z: 0 },
|
|
1072
1072
|
supportedBy: [],
|
|
1073
1073
|
supporting: []
|
|
1074
|
-
}), a +=
|
|
1074
|
+
}), a += u, f = Math.max(f, d);
|
|
1075
1075
|
}
|
|
1076
|
-
const
|
|
1077
|
-
const
|
|
1078
|
-
return
|
|
1079
|
-
}, 0),
|
|
1076
|
+
const g = t.dimensions.width * t.maxStackHeight * t.dimensions.depth, w = o.reduce((x, u) => {
|
|
1077
|
+
const d = u.box.dimensions;
|
|
1078
|
+
return x + d.width * d.height * d.depth;
|
|
1079
|
+
}, 0), m = o.reduce((x, u) => x + u.box.weight, 0);
|
|
1080
1080
|
return {
|
|
1081
|
-
placements:
|
|
1081
|
+
placements: o,
|
|
1082
1082
|
metrics: {
|
|
1083
|
-
volumeUtilization:
|
|
1084
|
-
weightUtilization: t.maxWeight > 0 ?
|
|
1085
|
-
centerOfGravity:
|
|
1086
|
-
stabilityScore:
|
|
1083
|
+
volumeUtilization: g > 0 ? w / g : 0,
|
|
1084
|
+
weightUtilization: t.maxWeight > 0 ? m / t.maxWeight : 0,
|
|
1085
|
+
centerOfGravity: Y(o),
|
|
1086
|
+
stabilityScore: ee(t, o)
|
|
1087
1087
|
},
|
|
1088
|
-
unplacedBoxes:
|
|
1088
|
+
unplacedBoxes: s
|
|
1089
1089
|
};
|
|
1090
1090
|
}
|
|
1091
1091
|
}
|
|
1092
|
-
class
|
|
1092
|
+
class ft {
|
|
1093
|
+
id = "material-grouping";
|
|
1094
|
+
name = "Material & Product Grouping";
|
|
1095
|
+
/**
|
|
1096
|
+
* Packs boxes into a pallet using layer-based approach with material ordering
|
|
1097
|
+
*
|
|
1098
|
+
* @param boxes - Boxes to pack
|
|
1099
|
+
* @param pallet - Target pallet
|
|
1100
|
+
* @returns Packing result with placements and metrics
|
|
1101
|
+
*/
|
|
1102
|
+
pack(e, t) {
|
|
1103
|
+
if (e.length === 0)
|
|
1104
|
+
return this.emptyResult();
|
|
1105
|
+
const o = this.sortBoxes(e), s = this.groupByMaterialWeight(o), a = this.buildLayers(s, t).flatMap((f) => f.placements), c = e.filter(
|
|
1106
|
+
(f) => !a.some((h) => h.box.id === f.id)
|
|
1107
|
+
), l = this.calculateMetrics(a, t);
|
|
1108
|
+
return {
|
|
1109
|
+
placements: a,
|
|
1110
|
+
metrics: l,
|
|
1111
|
+
unplacedBoxes: c
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
// ─── Phase 1: Sorting ──────────────────────────────────────────────
|
|
1115
|
+
/**
|
|
1116
|
+
* Sorts boxes by multiple criteria:
|
|
1117
|
+
* 1. Material weight (descending) - more resistant boxes first
|
|
1118
|
+
* 2. Product (alphabetical) - group same products together
|
|
1119
|
+
* 3. Base area (descending) - larger boxes first for stable base
|
|
1120
|
+
* 4. Height (descending) - taller boxes first for better layer filling
|
|
1121
|
+
*
|
|
1122
|
+
* @param boxes - Boxes to sort
|
|
1123
|
+
* @returns Sorted boxes array
|
|
1124
|
+
*/
|
|
1125
|
+
sortBoxes(e) {
|
|
1126
|
+
return [...e].sort((t, o) => {
|
|
1127
|
+
const s = t.materialWeight ?? 5, n = o.materialWeight ?? 5;
|
|
1128
|
+
if (s !== n)
|
|
1129
|
+
return n - s;
|
|
1130
|
+
const a = t.product ?? "", c = o.product ?? "";
|
|
1131
|
+
if (a !== c)
|
|
1132
|
+
return a.localeCompare(c);
|
|
1133
|
+
const l = t.dimensions.width * t.dimensions.depth, f = o.dimensions.width * o.dimensions.depth;
|
|
1134
|
+
return l !== f ? f - l : o.dimensions.height - t.dimensions.height;
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
/**
|
|
1138
|
+
* Groups boxes by material weight for layer construction
|
|
1139
|
+
*
|
|
1140
|
+
* @param boxes - Sorted boxes
|
|
1141
|
+
* @returns Map of material weight → boxes with that weight
|
|
1142
|
+
*/
|
|
1143
|
+
groupByMaterialWeight(e) {
|
|
1144
|
+
const t = /* @__PURE__ */ new Map();
|
|
1145
|
+
for (const o of e) {
|
|
1146
|
+
const s = o.materialWeight ?? 5;
|
|
1147
|
+
t.has(s) || t.set(s, []), t.get(s).push(o);
|
|
1148
|
+
}
|
|
1149
|
+
return new Map([...t.entries()].sort((o, s) => s[0] - o[0]));
|
|
1150
|
+
}
|
|
1151
|
+
// ─── Phase 2: Layer Construction ──────────────────────────────────
|
|
1152
|
+
/**
|
|
1153
|
+
* Builds layers from bottom to top, processing each material weight group
|
|
1154
|
+
*
|
|
1155
|
+
* @param materialGroups - Boxes grouped by material weight
|
|
1156
|
+
* @param pallet - Target pallet
|
|
1157
|
+
* @returns Array of layers
|
|
1158
|
+
*/
|
|
1159
|
+
buildLayers(e, t) {
|
|
1160
|
+
const o = [], s = /* @__PURE__ */ new Map(), n = [];
|
|
1161
|
+
let a = 0;
|
|
1162
|
+
for (const [, c] of e) {
|
|
1163
|
+
let l = [...c];
|
|
1164
|
+
for (; l.length > 0; ) {
|
|
1165
|
+
const f = this.buildNextLayer(
|
|
1166
|
+
l,
|
|
1167
|
+
t,
|
|
1168
|
+
a,
|
|
1169
|
+
s,
|
|
1170
|
+
n
|
|
1171
|
+
);
|
|
1172
|
+
if (f.placements.length === 0)
|
|
1173
|
+
break;
|
|
1174
|
+
o.push(f), n.push(...f.placements), a += f.height;
|
|
1175
|
+
const h = new Set(f.placements.map((g) => g.box.id));
|
|
1176
|
+
if (l = l.filter((g) => !h.has(g.id)), a >= t.maxStackHeight)
|
|
1177
|
+
break;
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
return o;
|
|
1181
|
+
}
|
|
1182
|
+
/**
|
|
1183
|
+
* Builds the next layer using available boxes
|
|
1184
|
+
*
|
|
1185
|
+
* Strategy:
|
|
1186
|
+
* 1. Try uniform height layer with 100% coverage
|
|
1187
|
+
* 2. If not possible, try mixed height layer
|
|
1188
|
+
* 3. If still not possible, use partial coverage (last resort)
|
|
1189
|
+
*
|
|
1190
|
+
* @param availableBoxes - Boxes available for this layer
|
|
1191
|
+
* @param pallet - Target pallet
|
|
1192
|
+
* @param currentY - Current vertical position
|
|
1193
|
+
* @param occupiedColumns - Track which (x,z) positions have which product
|
|
1194
|
+
* @param allPreviousPlacements - All placements from previous layers (for support calculation)
|
|
1195
|
+
* @returns Constructed layer
|
|
1196
|
+
*/
|
|
1197
|
+
buildNextLayer(e, t, o, s, n) {
|
|
1198
|
+
const a = this.tryUniformHeightLayer(
|
|
1199
|
+
e,
|
|
1200
|
+
t,
|
|
1201
|
+
o,
|
|
1202
|
+
s,
|
|
1203
|
+
n
|
|
1204
|
+
);
|
|
1205
|
+
if (a && a.coverage >= 95)
|
|
1206
|
+
return a;
|
|
1207
|
+
const c = this.tryMixedHeightLayer(
|
|
1208
|
+
e,
|
|
1209
|
+
t,
|
|
1210
|
+
o,
|
|
1211
|
+
s,
|
|
1212
|
+
n
|
|
1213
|
+
);
|
|
1214
|
+
return c && c.coverage >= 95 ? c : ((a?.coverage ?? 0) > (c?.coverage ?? 0) ? a : c) ?? this.emptyLayer(o);
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* Attempts to create a layer with boxes of uniform height
|
|
1218
|
+
*
|
|
1219
|
+
* @param boxes - Available boxes
|
|
1220
|
+
* @param pallet - Target pallet
|
|
1221
|
+
* @param currentY - Current vertical position
|
|
1222
|
+
* @param occupiedColumns - Occupied column tracker
|
|
1223
|
+
* @param allPreviousPlacements - All placements from previous layers
|
|
1224
|
+
* @returns Layer or null if not possible
|
|
1225
|
+
*/
|
|
1226
|
+
tryUniformHeightLayer(e, t, o, s, n) {
|
|
1227
|
+
const a = /* @__PURE__ */ new Map();
|
|
1228
|
+
for (const l of e) {
|
|
1229
|
+
const f = l.dimensions.height;
|
|
1230
|
+
a.has(f) || a.set(f, []), a.get(f).push(l);
|
|
1231
|
+
}
|
|
1232
|
+
const c = [...a.entries()].sort(
|
|
1233
|
+
(l, f) => f[1].length - l[1].length
|
|
1234
|
+
);
|
|
1235
|
+
for (const [l, f] of c) {
|
|
1236
|
+
if (o + l > t.maxStackHeight)
|
|
1237
|
+
continue;
|
|
1238
|
+
const h = this.placeBoxesInLayer(
|
|
1239
|
+
f,
|
|
1240
|
+
t,
|
|
1241
|
+
o,
|
|
1242
|
+
l,
|
|
1243
|
+
s,
|
|
1244
|
+
n
|
|
1245
|
+
);
|
|
1246
|
+
if (h.coverage >= 95)
|
|
1247
|
+
return h;
|
|
1248
|
+
}
|
|
1249
|
+
return null;
|
|
1250
|
+
}
|
|
1251
|
+
/**
|
|
1252
|
+
* Attempts to create a layer with boxes of mixed heights
|
|
1253
|
+
*
|
|
1254
|
+
* @param boxes - Available boxes
|
|
1255
|
+
* @param pallet - Target pallet
|
|
1256
|
+
* @param currentY - Current vertical position
|
|
1257
|
+
* @param occupiedColumns - Occupied column tracker
|
|
1258
|
+
* @param allPreviousPlacements - All placements from previous layers
|
|
1259
|
+
* @returns Layer or null if not possible
|
|
1260
|
+
*/
|
|
1261
|
+
tryMixedHeightLayer(e, t, o, s, n) {
|
|
1262
|
+
return this.placeBoxesInLayer(
|
|
1263
|
+
e,
|
|
1264
|
+
t,
|
|
1265
|
+
o,
|
|
1266
|
+
null,
|
|
1267
|
+
s,
|
|
1268
|
+
n
|
|
1269
|
+
);
|
|
1270
|
+
}
|
|
1271
|
+
// ─── Phase 3: Maximal Rectangles 2D Packing ───────────────────────
|
|
1272
|
+
/**
|
|
1273
|
+
* Places boxes in a layer using Maximal Rectangles algorithm
|
|
1274
|
+
*
|
|
1275
|
+
* @param boxes - Boxes to place
|
|
1276
|
+
* @param pallet - Target pallet
|
|
1277
|
+
* @param currentY - Y coordinate of this layer
|
|
1278
|
+
* @param targetHeight - If specified, only use boxes of this height
|
|
1279
|
+
* @param occupiedColumns - Track product columns
|
|
1280
|
+
* @param allPreviousPlacements - All placements from previous layers (for support calculation)
|
|
1281
|
+
* @returns Constructed layer
|
|
1282
|
+
*/
|
|
1283
|
+
placeBoxesInLayer(e, t, o, s, n, a) {
|
|
1284
|
+
const c = [
|
|
1285
|
+
{
|
|
1286
|
+
x: 0,
|
|
1287
|
+
z: 0,
|
|
1288
|
+
width: t.dimensions.width,
|
|
1289
|
+
depth: t.dimensions.depth
|
|
1290
|
+
}
|
|
1291
|
+
], l = [], h = [...this.groupByProduct(e).entries()].sort(
|
|
1292
|
+
(u, d) => d[1].length - u[1].length
|
|
1293
|
+
);
|
|
1294
|
+
let g = 0;
|
|
1295
|
+
for (const [u, d] of h) {
|
|
1296
|
+
const b = s ? d.filter((j) => j.dimensions.height === s) : d;
|
|
1297
|
+
for (const j of b) {
|
|
1298
|
+
if (o + j.dimensions.height > t.maxStackHeight)
|
|
1299
|
+
continue;
|
|
1300
|
+
const E = [
|
|
1301
|
+
{
|
|
1302
|
+
width: j.dimensions.width,
|
|
1303
|
+
depth: j.dimensions.depth,
|
|
1304
|
+
rotation: 0
|
|
1305
|
+
},
|
|
1306
|
+
{
|
|
1307
|
+
width: j.dimensions.depth,
|
|
1308
|
+
depth: j.dimensions.width,
|
|
1309
|
+
rotation: 90
|
|
1310
|
+
}
|
|
1311
|
+
];
|
|
1312
|
+
for (const S of E) {
|
|
1313
|
+
const C = [
|
|
1314
|
+
...a,
|
|
1315
|
+
...l
|
|
1316
|
+
], z = this.findBestRectangle(
|
|
1317
|
+
S,
|
|
1318
|
+
c,
|
|
1319
|
+
n,
|
|
1320
|
+
u,
|
|
1321
|
+
o,
|
|
1322
|
+
C
|
|
1323
|
+
);
|
|
1324
|
+
if (z) {
|
|
1325
|
+
const y = {
|
|
1326
|
+
id: `placed-${++g}`,
|
|
1327
|
+
box: j,
|
|
1328
|
+
position: { x: z.x, y: o, z: z.z },
|
|
1329
|
+
rotation: { x: 0, y: S.rotation, z: 0 },
|
|
1330
|
+
supportedBy: [],
|
|
1331
|
+
supporting: []
|
|
1332
|
+
};
|
|
1333
|
+
l.push(y), this.updateOccupiedColumns(
|
|
1334
|
+
n,
|
|
1335
|
+
z.x,
|
|
1336
|
+
z.z,
|
|
1337
|
+
u
|
|
1338
|
+
), this.updateFreeRectangles(
|
|
1339
|
+
c,
|
|
1340
|
+
z,
|
|
1341
|
+
S.width,
|
|
1342
|
+
S.depth
|
|
1343
|
+
);
|
|
1344
|
+
break;
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
const w = t.dimensions.width * t.dimensions.depth, m = l.reduce((u, d) => {
|
|
1350
|
+
const b = d.rotation.y === 90 ? d.box.dimensions.depth : d.box.dimensions.width, j = d.rotation.y === 90 ? d.box.dimensions.width : d.box.dimensions.depth;
|
|
1351
|
+
return u + b * j;
|
|
1352
|
+
}, 0), x = l.length > 0 ? Math.max(...l.map((u) => u.box.dimensions.height)) : 0;
|
|
1353
|
+
return {
|
|
1354
|
+
y: o,
|
|
1355
|
+
height: x,
|
|
1356
|
+
placements: l,
|
|
1357
|
+
coverage: m / w * 100
|
|
1358
|
+
};
|
|
1359
|
+
}
|
|
1360
|
+
/**
|
|
1361
|
+
* Finds the best free rectangle for a box using scoring
|
|
1362
|
+
*
|
|
1363
|
+
* @param boxDims - Box dimensions (with rotation applied)
|
|
1364
|
+
* @param freeRectangles - Available free spaces
|
|
1365
|
+
* @param occupiedColumns - Product column tracker
|
|
1366
|
+
* @param product - Product identifier
|
|
1367
|
+
* @param currentY - Current layer Y position
|
|
1368
|
+
* @param existingPlacements - Already placed boxes in this layer and below
|
|
1369
|
+
* @param pallet - Pallet dimensions
|
|
1370
|
+
* @returns Best rectangle or null if none fit
|
|
1371
|
+
*/
|
|
1372
|
+
findBestRectangle(e, t, o, s, n, a) {
|
|
1373
|
+
let c = null, l = -1 / 0;
|
|
1374
|
+
for (const f of t)
|
|
1375
|
+
if (e.width <= f.width && e.depth <= f.depth) {
|
|
1376
|
+
const h = this.calculateSupportArea(
|
|
1377
|
+
f.x,
|
|
1378
|
+
f.z,
|
|
1379
|
+
e.width,
|
|
1380
|
+
e.depth,
|
|
1381
|
+
n,
|
|
1382
|
+
a
|
|
1383
|
+
), g = e.width * e.depth;
|
|
1384
|
+
if (h / g < 0.7 || this.boxExtendsBeyondLowerLayer(
|
|
1385
|
+
f.x,
|
|
1386
|
+
f.z,
|
|
1387
|
+
e.width,
|
|
1388
|
+
e.depth,
|
|
1389
|
+
n,
|
|
1390
|
+
a
|
|
1391
|
+
))
|
|
1392
|
+
continue;
|
|
1393
|
+
const m = this.scoreRectangle(
|
|
1394
|
+
f,
|
|
1395
|
+
e,
|
|
1396
|
+
o,
|
|
1397
|
+
s
|
|
1398
|
+
);
|
|
1399
|
+
m > l && (l = m, c = f);
|
|
1400
|
+
}
|
|
1401
|
+
return c;
|
|
1402
|
+
}
|
|
1403
|
+
/**
|
|
1404
|
+
* Calculates the area of support a box would have at a given position
|
|
1405
|
+
*
|
|
1406
|
+
* @param x - X position of box
|
|
1407
|
+
* @param z - Z position of box
|
|
1408
|
+
* @param width - Width of box
|
|
1409
|
+
* @param depth - Depth of box
|
|
1410
|
+
* @param currentY - Y position where box will be placed
|
|
1411
|
+
* @param existingPlacements - Boxes already placed in current and previous layers
|
|
1412
|
+
* @param pallet - Pallet dimensions
|
|
1413
|
+
* @returns Supported area in mm²
|
|
1414
|
+
*/
|
|
1415
|
+
calculateSupportArea(e, t, o, s, n, a) {
|
|
1416
|
+
let c = 0;
|
|
1417
|
+
if (n === 0)
|
|
1418
|
+
return o * s;
|
|
1419
|
+
for (const l of a) {
|
|
1420
|
+
const f = l.rotation.y === 90 ? l.box.dimensions.depth : l.box.dimensions.width, h = l.rotation.y === 90 ? l.box.dimensions.width : l.box.dimensions.depth, g = l.position.y + l.box.dimensions.height;
|
|
1421
|
+
if (Math.abs(g - n) > 1)
|
|
1422
|
+
continue;
|
|
1423
|
+
const m = this.calculateRectangleIntersection(
|
|
1424
|
+
e,
|
|
1425
|
+
t,
|
|
1426
|
+
o,
|
|
1427
|
+
s,
|
|
1428
|
+
l.position.x,
|
|
1429
|
+
l.position.z,
|
|
1430
|
+
f,
|
|
1431
|
+
h
|
|
1432
|
+
);
|
|
1433
|
+
c += m;
|
|
1434
|
+
}
|
|
1435
|
+
return c;
|
|
1436
|
+
}
|
|
1437
|
+
/**
|
|
1438
|
+
* Calculates intersection area between two rectangles
|
|
1439
|
+
*
|
|
1440
|
+
* @returns Intersection area in mm²
|
|
1441
|
+
*/
|
|
1442
|
+
calculateRectangleIntersection(e, t, o, s, n, a, c, l) {
|
|
1443
|
+
const f = Math.max(0, Math.min(e + o, n + c) - Math.max(e, n)), h = Math.max(0, Math.min(t + s, a + l) - Math.max(t, a));
|
|
1444
|
+
return f * h;
|
|
1445
|
+
}
|
|
1446
|
+
/**
|
|
1447
|
+
* Checks if a box would extend beyond the footprint of boxes in the layer directly below
|
|
1448
|
+
*
|
|
1449
|
+
* This ensures that boxes in upper layers are always stacked on top of lower boxes,
|
|
1450
|
+
* preventing boxes from "hanging" over edges when there's available space in the lower layer.
|
|
1451
|
+
*
|
|
1452
|
+
* @param x - X position of box
|
|
1453
|
+
* @param z - Z position of box
|
|
1454
|
+
* @param width - Width of box
|
|
1455
|
+
* @param depth - Depth of box
|
|
1456
|
+
* @param currentY - Y position where box will be placed
|
|
1457
|
+
* @param existingPlacements - Boxes already placed in current and previous layers
|
|
1458
|
+
* @returns true if box extends beyond lower layer footprint
|
|
1459
|
+
*/
|
|
1460
|
+
boxExtendsBeyondLowerLayer(e, t, o, s, n, a) {
|
|
1461
|
+
if (n === 0)
|
|
1462
|
+
return !1;
|
|
1463
|
+
const c = a.filter((d) => {
|
|
1464
|
+
const b = d.position.y + d.box.dimensions.height;
|
|
1465
|
+
return Math.abs(b - n) <= 1;
|
|
1466
|
+
});
|
|
1467
|
+
if (c.length === 0)
|
|
1468
|
+
return !0;
|
|
1469
|
+
let l = 1 / 0, f = -1 / 0, h = 1 / 0, g = -1 / 0;
|
|
1470
|
+
for (const d of c) {
|
|
1471
|
+
const b = d.rotation.y === 90 ? d.box.dimensions.depth : d.box.dimensions.width, j = d.rotation.y === 90 ? d.box.dimensions.width : d.box.dimensions.depth;
|
|
1472
|
+
l = Math.min(l, d.position.x), f = Math.max(f, d.position.x + b), h = Math.min(h, d.position.z), g = Math.max(g, d.position.z + j);
|
|
1473
|
+
}
|
|
1474
|
+
const w = e + o, m = t + s, x = 1;
|
|
1475
|
+
return e < l - x || w > f + x || t < h - x || m > g + x;
|
|
1476
|
+
}
|
|
1477
|
+
/**
|
|
1478
|
+
* Scores a rectangle position based on multiple criteria
|
|
1479
|
+
*
|
|
1480
|
+
* Higher score = better position
|
|
1481
|
+
*
|
|
1482
|
+
* @param rect - Free rectangle
|
|
1483
|
+
* @param boxDims - Box dimensions
|
|
1484
|
+
* @param occupiedColumns - Product column tracker
|
|
1485
|
+
* @param product - Product identifier
|
|
1486
|
+
* @returns Score value
|
|
1487
|
+
*/
|
|
1488
|
+
scoreRectangle(e, t, o, s) {
|
|
1489
|
+
let n = 0;
|
|
1490
|
+
const a = `${e.x},${e.z}`;
|
|
1491
|
+
o.get(a) === s && (n += 100), o.has(a) && o.get(a) !== s && (n -= 50);
|
|
1492
|
+
const c = e.width * e.depth - t.width * t.depth;
|
|
1493
|
+
return n += 50 / (1 + c / 1e4), n += 30 / (1 + e.x / 1e3 + e.z / 1e3), n;
|
|
1494
|
+
}
|
|
1495
|
+
/**
|
|
1496
|
+
* Updates free rectangles after placing a box (Maximal Rectangles algorithm)
|
|
1497
|
+
*
|
|
1498
|
+
* @param freeRects - Current free rectangles
|
|
1499
|
+
* @param usedRect - Rectangle being used by the new box
|
|
1500
|
+
* @param boxWidth - Width of placed box
|
|
1501
|
+
* @param boxDepth - Depth of placed box
|
|
1502
|
+
*/
|
|
1503
|
+
updateFreeRectangles(e, t, o, s) {
|
|
1504
|
+
const n = [];
|
|
1505
|
+
for (let a = e.length - 1; a >= 0; a--) {
|
|
1506
|
+
const c = e[a];
|
|
1507
|
+
this.rectanglesIntersect(c, t, o, s) && (e.splice(a, 1), t.x > c.x && n.push({
|
|
1508
|
+
x: c.x,
|
|
1509
|
+
z: c.z,
|
|
1510
|
+
width: t.x - c.x,
|
|
1511
|
+
depth: c.depth
|
|
1512
|
+
}), t.x + o < c.x + c.width && n.push({
|
|
1513
|
+
x: t.x + o,
|
|
1514
|
+
z: c.z,
|
|
1515
|
+
width: c.x + c.width - (t.x + o),
|
|
1516
|
+
depth: c.depth
|
|
1517
|
+
}), t.z > c.z && n.push({
|
|
1518
|
+
x: c.x,
|
|
1519
|
+
z: c.z,
|
|
1520
|
+
width: c.width,
|
|
1521
|
+
depth: t.z - c.z
|
|
1522
|
+
}), t.z + s < c.z + c.depth && n.push({
|
|
1523
|
+
x: c.x,
|
|
1524
|
+
z: t.z + s,
|
|
1525
|
+
width: c.width,
|
|
1526
|
+
depth: c.z + c.depth - (t.z + s)
|
|
1527
|
+
}));
|
|
1528
|
+
}
|
|
1529
|
+
e.push(...n), this.removeContainedRectangles(e);
|
|
1530
|
+
}
|
|
1531
|
+
/**
|
|
1532
|
+
* Checks if two rectangles intersect
|
|
1533
|
+
*/
|
|
1534
|
+
rectanglesIntersect(e, t, o, s) {
|
|
1535
|
+
return !(t.x + o <= e.x || t.x >= e.x + e.width || t.z + s <= e.z || t.z >= e.z + e.depth);
|
|
1536
|
+
}
|
|
1537
|
+
/**
|
|
1538
|
+
* Removes rectangles that are fully contained within other rectangles
|
|
1539
|
+
*/
|
|
1540
|
+
removeContainedRectangles(e) {
|
|
1541
|
+
for (let t = e.length - 1; t >= 0; t--) {
|
|
1542
|
+
const o = e[t];
|
|
1543
|
+
for (let s = 0; s < e.length; s++) {
|
|
1544
|
+
if (t === s) continue;
|
|
1545
|
+
const n = e[s];
|
|
1546
|
+
if (o.x >= n.x && o.z >= n.z && o.x + o.width <= n.x + n.width && o.z + o.depth <= n.z + n.depth) {
|
|
1547
|
+
e.splice(t, 1);
|
|
1548
|
+
break;
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
/**
|
|
1554
|
+
* Updates the occupied columns map after placing a box
|
|
1555
|
+
*/
|
|
1556
|
+
updateOccupiedColumns(e, t, o, s) {
|
|
1557
|
+
const n = `${t},${o}`;
|
|
1558
|
+
e.has(n) || e.set(n, s);
|
|
1559
|
+
}
|
|
1560
|
+
// ─── Utility Methods ───────────────────────────────────────────────
|
|
1561
|
+
/**
|
|
1562
|
+
* Groups boxes by product identifier
|
|
1563
|
+
*/
|
|
1564
|
+
groupByProduct(e) {
|
|
1565
|
+
const t = /* @__PURE__ */ new Map();
|
|
1566
|
+
for (const o of e) {
|
|
1567
|
+
const s = o.product ?? "default";
|
|
1568
|
+
t.has(s) || t.set(s, []), t.get(s).push(o);
|
|
1569
|
+
}
|
|
1570
|
+
return t;
|
|
1571
|
+
}
|
|
1572
|
+
/**
|
|
1573
|
+
* Creates an empty layer
|
|
1574
|
+
*/
|
|
1575
|
+
emptyLayer(e) {
|
|
1576
|
+
return {
|
|
1577
|
+
y: e,
|
|
1578
|
+
height: 0,
|
|
1579
|
+
placements: [],
|
|
1580
|
+
coverage: 0
|
|
1581
|
+
};
|
|
1582
|
+
}
|
|
1583
|
+
/**
|
|
1584
|
+
* Creates an empty packing result
|
|
1585
|
+
*/
|
|
1586
|
+
emptyResult() {
|
|
1587
|
+
return {
|
|
1588
|
+
placements: [],
|
|
1589
|
+
metrics: {
|
|
1590
|
+
volumeUtilization: 0,
|
|
1591
|
+
weightUtilization: 0,
|
|
1592
|
+
centerOfGravity: { x: 0, y: 0, z: 0 },
|
|
1593
|
+
stabilityScore: 100
|
|
1594
|
+
},
|
|
1595
|
+
unplacedBoxes: []
|
|
1596
|
+
};
|
|
1597
|
+
}
|
|
1598
|
+
/**
|
|
1599
|
+
* Calculates packing metrics
|
|
1600
|
+
*/
|
|
1601
|
+
calculateMetrics(e, t) {
|
|
1602
|
+
const o = t.dimensions.width * t.maxStackHeight * t.dimensions.depth, s = e.reduce((a, c) => {
|
|
1603
|
+
const l = c.box.dimensions;
|
|
1604
|
+
return a + l.width * l.height * l.depth;
|
|
1605
|
+
}, 0), n = e.reduce((a, c) => a + c.box.weight, 0);
|
|
1606
|
+
return {
|
|
1607
|
+
volumeUtilization: o > 0 ? s / o : 0,
|
|
1608
|
+
weightUtilization: t.maxWeight > 0 ? n / t.maxWeight : 0,
|
|
1609
|
+
centerOfGravity: Y(e),
|
|
1610
|
+
stabilityScore: ee(t, e)
|
|
1611
|
+
};
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
class pt {
|
|
1093
1615
|
strategies = /* @__PURE__ */ new Map();
|
|
1094
1616
|
constructor() {
|
|
1095
|
-
this.register(new
|
|
1617
|
+
this.register(new ut()), this.register(new xt()), this.register(new gt()), this.register(new ft());
|
|
1096
1618
|
}
|
|
1097
1619
|
register(e) {
|
|
1098
1620
|
this.strategies.set(e.id, e);
|
|
@@ -1113,10 +1635,10 @@ class gt {
|
|
|
1113
1635
|
return this.strategies.has(e);
|
|
1114
1636
|
}
|
|
1115
1637
|
}
|
|
1116
|
-
const
|
|
1117
|
-
let
|
|
1638
|
+
const wt = new pt();
|
|
1639
|
+
let yt = 0;
|
|
1118
1640
|
function Te() {
|
|
1119
|
-
return `pallet-${++
|
|
1641
|
+
return `pallet-${++yt}`;
|
|
1120
1642
|
}
|
|
1121
1643
|
class Z {
|
|
1122
1644
|
// ═══ Palets estándar internacionales ═══════════════════════════
|
|
@@ -1167,16 +1689,16 @@ class Z {
|
|
|
1167
1689
|
* @param overrides - Propiedades a sobrescribir
|
|
1168
1690
|
*/
|
|
1169
1691
|
static fromPreset(e, t) {
|
|
1170
|
-
const
|
|
1171
|
-
if (!
|
|
1692
|
+
const o = ue[e];
|
|
1693
|
+
if (!o)
|
|
1172
1694
|
throw new Error(`Unknown pallet preset: ${e}`);
|
|
1173
1695
|
return {
|
|
1174
1696
|
id: Te(),
|
|
1175
|
-
dimensions: { ...
|
|
1176
|
-
material:
|
|
1177
|
-
maxWeight:
|
|
1178
|
-
maxStackHeight:
|
|
1179
|
-
weight:
|
|
1697
|
+
dimensions: { ...o.dimensions },
|
|
1698
|
+
material: o.material,
|
|
1699
|
+
maxWeight: o.maxWeight,
|
|
1700
|
+
maxStackHeight: o.maxStackHeight,
|
|
1701
|
+
weight: o.weight,
|
|
1180
1702
|
metadata: { preset: e },
|
|
1181
1703
|
...t
|
|
1182
1704
|
};
|
|
@@ -1187,7 +1709,7 @@ class Z {
|
|
|
1187
1709
|
return {
|
|
1188
1710
|
id: Te(),
|
|
1189
1711
|
dimensions: { ...e },
|
|
1190
|
-
material:
|
|
1712
|
+
material: N.WOOD,
|
|
1191
1713
|
maxWeight: 1e3,
|
|
1192
1714
|
maxStackHeight: 2200,
|
|
1193
1715
|
weight: 25,
|
|
@@ -1209,107 +1731,153 @@ class Z {
|
|
|
1209
1731
|
}
|
|
1210
1732
|
}
|
|
1211
1733
|
let vt = 0;
|
|
1212
|
-
function
|
|
1734
|
+
function Ee() {
|
|
1213
1735
|
return `truck-${++vt}`;
|
|
1214
1736
|
}
|
|
1215
|
-
class
|
|
1737
|
+
class Xt {
|
|
1216
1738
|
/** Crea un camión a partir de un preset de tipo */
|
|
1217
1739
|
static fromPreset(e, t) {
|
|
1218
|
-
const
|
|
1740
|
+
const o = De[e];
|
|
1219
1741
|
return {
|
|
1220
|
-
id:
|
|
1742
|
+
id: Ee(),
|
|
1221
1743
|
name: `Camión ${e}`,
|
|
1222
1744
|
truckType: e,
|
|
1223
|
-
dimensions: { ...
|
|
1224
|
-
maxWeight:
|
|
1745
|
+
dimensions: { ...o.dimensions },
|
|
1746
|
+
maxWeight: o.maxWeight,
|
|
1225
1747
|
pallets: [],
|
|
1226
1748
|
metadata: {},
|
|
1227
1749
|
...t
|
|
1228
1750
|
};
|
|
1229
1751
|
}
|
|
1230
1752
|
/** Crea un camión custom con dimensiones y peso arbitrarios */
|
|
1231
|
-
static custom(e, t,
|
|
1753
|
+
static custom(e, t, o) {
|
|
1232
1754
|
return {
|
|
1233
|
-
id:
|
|
1755
|
+
id: Ee(),
|
|
1234
1756
|
name: "Camión Custom",
|
|
1235
1757
|
truckType: ie.CUSTOM,
|
|
1236
1758
|
dimensions: { ...e },
|
|
1237
1759
|
maxWeight: t,
|
|
1238
1760
|
pallets: [],
|
|
1239
1761
|
metadata: {},
|
|
1240
|
-
...
|
|
1762
|
+
...o
|
|
1241
1763
|
};
|
|
1242
1764
|
}
|
|
1243
1765
|
}
|
|
1244
|
-
let
|
|
1245
|
-
function
|
|
1246
|
-
return `box-${++
|
|
1766
|
+
let bt = 0;
|
|
1767
|
+
function St() {
|
|
1768
|
+
return `box-${++bt}`;
|
|
1247
1769
|
}
|
|
1248
1770
|
class ge {
|
|
1249
|
-
/**
|
|
1771
|
+
/**
|
|
1772
|
+
* Creates a box with default values
|
|
1773
|
+
*
|
|
1774
|
+
* @param dims - Box dimensions in millimeters
|
|
1775
|
+
* @param opts - Optional overrides for any Box property
|
|
1776
|
+
* @returns A new Box instance with defaults applied
|
|
1777
|
+
*
|
|
1778
|
+
* @example
|
|
1779
|
+
* const box = BoxFactory.create(
|
|
1780
|
+
* { width: 600, height: 400, depth: 400 },
|
|
1781
|
+
* { product: 'PROD-A', materialWeight: 6 }
|
|
1782
|
+
* )
|
|
1783
|
+
*/
|
|
1250
1784
|
static create(e, t) {
|
|
1251
1785
|
return {
|
|
1252
|
-
id:
|
|
1786
|
+
id: St(),
|
|
1253
1787
|
dimensions: { ...e },
|
|
1254
1788
|
weight: 5,
|
|
1789
|
+
materialWeight: 5,
|
|
1790
|
+
// Default: medium resistance
|
|
1255
1791
|
fragile: !1,
|
|
1256
1792
|
stackable: !0,
|
|
1257
1793
|
metadata: {},
|
|
1258
1794
|
...t
|
|
1259
1795
|
};
|
|
1260
1796
|
}
|
|
1261
|
-
/**
|
|
1262
|
-
|
|
1797
|
+
/**
|
|
1798
|
+
* Creates a fragile box with maximum weight limit
|
|
1799
|
+
*
|
|
1800
|
+
* @param dims - Box dimensions in millimeters
|
|
1801
|
+
* @param fragilityMaxWeight - Maximum weight (kg) this box can support on top
|
|
1802
|
+
* @param opts - Optional overrides
|
|
1803
|
+
* @returns A fragile Box instance
|
|
1804
|
+
*
|
|
1805
|
+
* @example
|
|
1806
|
+
* const fragileBox = BoxFactory.fragile(
|
|
1807
|
+
* { width: 400, height: 300, depth: 300 },
|
|
1808
|
+
* 10, // Can support max 10kg on top
|
|
1809
|
+
* { materialWeight: 0, product: 'PROD-FRAGILE' }
|
|
1810
|
+
* )
|
|
1811
|
+
*/
|
|
1812
|
+
static fragile(e, t, o) {
|
|
1263
1813
|
return ge.create(e, {
|
|
1264
1814
|
fragile: !0,
|
|
1265
1815
|
fragilityMaxWeight: t,
|
|
1266
|
-
|
|
1816
|
+
materialWeight: 0,
|
|
1817
|
+
// Fragile boxes go on top
|
|
1818
|
+
...o
|
|
1267
1819
|
});
|
|
1268
1820
|
}
|
|
1269
|
-
/**
|
|
1270
|
-
|
|
1821
|
+
/**
|
|
1822
|
+
* Creates a heavy, non-stackable box
|
|
1823
|
+
*
|
|
1824
|
+
* @param dims - Box dimensions in millimeters
|
|
1825
|
+
* @param weight - Box weight in kilograms
|
|
1826
|
+
* @param opts - Optional overrides
|
|
1827
|
+
* @returns A heavy Box instance
|
|
1828
|
+
*
|
|
1829
|
+
* @example
|
|
1830
|
+
* const heavyBox = BoxFactory.heavy(
|
|
1831
|
+
* { width: 800, height: 600, depth: 600 },
|
|
1832
|
+
* 50, // 50kg
|
|
1833
|
+
* { materialWeight: 8, product: 'PROD-HEAVY' }
|
|
1834
|
+
* )
|
|
1835
|
+
*/
|
|
1836
|
+
static heavy(e, t, o) {
|
|
1271
1837
|
return ge.create(e, {
|
|
1272
1838
|
weight: t,
|
|
1273
1839
|
stackable: !1,
|
|
1274
|
-
|
|
1840
|
+
materialWeight: 8,
|
|
1841
|
+
// Heavy boxes have high resistance
|
|
1842
|
+
...o
|
|
1275
1843
|
});
|
|
1276
1844
|
}
|
|
1277
1845
|
}
|
|
1278
|
-
function
|
|
1846
|
+
function Zt(i, e) {
|
|
1279
1847
|
return k(() => {
|
|
1280
|
-
const t =
|
|
1848
|
+
const t = Qe(i), o = tt(i, e), n = it({ pallet: e, boxes: i }), a = lt(i), c = at(i), l = ct(i), f = ht(e, i), h = dt(e, i), g = st(i), w = rt(e, i), m = [...c.violations, ...l.violations], x = [...f.violations, ...h.violations], u = [
|
|
1281
1849
|
...t.violations,
|
|
1282
|
-
...
|
|
1283
|
-
...
|
|
1850
|
+
...o.violations,
|
|
1851
|
+
...n.violations,
|
|
1284
1852
|
...a.violations,
|
|
1285
|
-
...
|
|
1286
|
-
...
|
|
1287
|
-
...
|
|
1288
|
-
...
|
|
1853
|
+
...m,
|
|
1854
|
+
...x,
|
|
1855
|
+
...g.violations,
|
|
1856
|
+
...w.violations
|
|
1289
1857
|
];
|
|
1290
1858
|
return {
|
|
1291
|
-
isValid:
|
|
1292
|
-
violations:
|
|
1859
|
+
isValid: u.filter((d) => d.severity === "error").length === 0,
|
|
1860
|
+
violations: u,
|
|
1293
1861
|
collisions: t,
|
|
1294
|
-
bounds:
|
|
1295
|
-
weight:
|
|
1862
|
+
bounds: o,
|
|
1863
|
+
weight: n,
|
|
1296
1864
|
gravity: a,
|
|
1297
1865
|
stacking: {
|
|
1298
|
-
isValid:
|
|
1299
|
-
violations:
|
|
1866
|
+
isValid: c.isValid,
|
|
1867
|
+
violations: m
|
|
1300
1868
|
},
|
|
1301
1869
|
stability: {
|
|
1302
|
-
isValid:
|
|
1303
|
-
violations:
|
|
1870
|
+
isValid: f.isValid && h.isValid,
|
|
1871
|
+
violations: x
|
|
1304
1872
|
},
|
|
1305
|
-
fragile:
|
|
1306
|
-
distribution:
|
|
1873
|
+
fragile: g,
|
|
1874
|
+
distribution: w
|
|
1307
1875
|
};
|
|
1308
|
-
}, [
|
|
1876
|
+
}, [i, e]);
|
|
1309
1877
|
}
|
|
1310
|
-
function
|
|
1878
|
+
function Dt(i) {
|
|
1311
1879
|
return k(() => {
|
|
1312
|
-
if (!
|
|
1880
|
+
if (!i || i.floors.length === 0)
|
|
1313
1881
|
return {
|
|
1314
1882
|
volumeUtilization: 0,
|
|
1315
1883
|
weightUtilization: 0,
|
|
@@ -1320,140 +1888,150 @@ function Xt(o) {
|
|
|
1320
1888
|
boxCount: 0,
|
|
1321
1889
|
floorCount: 0
|
|
1322
1890
|
};
|
|
1323
|
-
const e = le(
|
|
1324
|
-
const
|
|
1325
|
-
return
|
|
1326
|
-
}, 0),
|
|
1891
|
+
const e = le(i), t = ye(i), o = i.floors[0].pallet, s = i.floors.flatMap((g) => g.boxes), n = s.length, a = i.floors.length, c = o.dimensions.width * o.maxStackHeight * o.dimensions.depth, l = s.reduce((g, w) => {
|
|
1892
|
+
const m = w.box.dimensions;
|
|
1893
|
+
return g + m.width * m.height * m.depth;
|
|
1894
|
+
}, 0), f = Y(s), h = ee(o, s);
|
|
1327
1895
|
return {
|
|
1328
|
-
volumeUtilization:
|
|
1329
|
-
weightUtilization:
|
|
1330
|
-
centerOfGravity:
|
|
1331
|
-
stabilityScore:
|
|
1896
|
+
volumeUtilization: c > 0 ? l / c : 0,
|
|
1897
|
+
weightUtilization: o.maxWeight > 0 ? t / o.maxWeight : 0,
|
|
1898
|
+
centerOfGravity: f,
|
|
1899
|
+
stabilityScore: h,
|
|
1332
1900
|
totalHeight: e,
|
|
1333
1901
|
totalWeight: t,
|
|
1334
|
-
boxCount:
|
|
1902
|
+
boxCount: n,
|
|
1335
1903
|
floorCount: a
|
|
1336
1904
|
};
|
|
1337
|
-
}, [
|
|
1905
|
+
}, [i]);
|
|
1338
1906
|
}
|
|
1339
|
-
function
|
|
1907
|
+
function Nt(i, e = wt) {
|
|
1340
1908
|
const t = k(
|
|
1341
|
-
() => e.list().map((
|
|
1909
|
+
() => e.list().map((s) => ({ id: s.id, name: s.name })),
|
|
1342
1910
|
[e]
|
|
1343
|
-
),
|
|
1344
|
-
(
|
|
1345
|
-
[
|
|
1911
|
+
), o = q(
|
|
1912
|
+
(s, n) => e.get(i).pack(s, n),
|
|
1913
|
+
[i, e]
|
|
1346
1914
|
);
|
|
1347
|
-
return { availableStrategies: t, pack:
|
|
1915
|
+
return { availableStrategies: t, pack: o };
|
|
1348
1916
|
}
|
|
1349
|
-
function
|
|
1917
|
+
function Ut(i) {
|
|
1350
1918
|
return k(() => {
|
|
1351
1919
|
const e = [];
|
|
1352
|
-
for (const
|
|
1353
|
-
const
|
|
1354
|
-
e.push(...
|
|
1920
|
+
for (const s of i.pallets) {
|
|
1921
|
+
const n = We(s, i);
|
|
1922
|
+
e.push(...n.violations);
|
|
1355
1923
|
}
|
|
1356
|
-
const t =
|
|
1924
|
+
const t = Ke(i.pallets), o = [
|
|
1357
1925
|
...e,
|
|
1358
1926
|
...t.violations
|
|
1359
1927
|
];
|
|
1360
1928
|
return {
|
|
1361
|
-
isValid:
|
|
1362
|
-
violations:
|
|
1929
|
+
isValid: o.filter((s) => s.severity === "error").length === 0,
|
|
1930
|
+
violations: o,
|
|
1363
1931
|
palletInRoom: {
|
|
1364
1932
|
isValid: e.length === 0,
|
|
1365
1933
|
violations: e
|
|
1366
1934
|
},
|
|
1367
1935
|
palletCollisions: t
|
|
1368
1936
|
};
|
|
1369
|
-
}, [
|
|
1937
|
+
}, [i]);
|
|
1370
1938
|
}
|
|
1371
|
-
const
|
|
1939
|
+
const jt = V(function({
|
|
1372
1940
|
placedBox: e,
|
|
1373
1941
|
selected: t = !1,
|
|
1374
|
-
highlighted:
|
|
1375
|
-
showLabel:
|
|
1376
|
-
color:
|
|
1942
|
+
highlighted: o = !1,
|
|
1943
|
+
showLabel: s = !1,
|
|
1944
|
+
color: n,
|
|
1377
1945
|
opacity: a,
|
|
1378
|
-
selectedColor:
|
|
1379
|
-
highlightedColor:
|
|
1380
|
-
onClick:
|
|
1381
|
-
onHover:
|
|
1946
|
+
selectedColor: c,
|
|
1947
|
+
highlightedColor: l,
|
|
1948
|
+
onClick: f,
|
|
1949
|
+
onHover: h
|
|
1382
1950
|
}) {
|
|
1383
|
-
const
|
|
1384
|
-
let
|
|
1385
|
-
(
|
|
1951
|
+
const g = _e(null), w = ce(), { box: m, position: x, rotation: u } = e, d = U.MM_TO_M, b = n ?? m.color ?? w.box.color, j = a ?? w.box.opacity, E = c ?? w.selection.selectedColor, S = l ?? w.selection.highlightedColor;
|
|
1952
|
+
let C = m.dimensions.width, z = m.dimensions.depth;
|
|
1953
|
+
(u.y === 90 || u.y === 270) && ([C, z] = [z, C]);
|
|
1386
1954
|
const y = k(
|
|
1387
|
-
() => [
|
|
1388
|
-
[
|
|
1389
|
-
),
|
|
1390
|
-
() => new
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1955
|
+
() => [C * d, m.dimensions.height * d, z * d],
|
|
1956
|
+
[C, z, m.dimensions.height, d]
|
|
1957
|
+
), v = k(
|
|
1958
|
+
() => new B.Vector3(
|
|
1959
|
+
x.x * d + y[0] / 2,
|
|
1960
|
+
x.y * d + y[1] / 2,
|
|
1961
|
+
x.z * d + y[2] / 2
|
|
1394
1962
|
),
|
|
1395
|
-
[
|
|
1396
|
-
),
|
|
1397
|
-
(
|
|
1398
|
-
|
|
1963
|
+
[x, y, d]
|
|
1964
|
+
), M = t ? E : o ? S : null, _ = q(
|
|
1965
|
+
(R) => {
|
|
1966
|
+
R.stopPropagation(), f?.(e.id);
|
|
1399
1967
|
},
|
|
1400
|
-
[
|
|
1401
|
-
),
|
|
1402
|
-
(
|
|
1403
|
-
|
|
1968
|
+
[f, e.id]
|
|
1969
|
+
), T = q(
|
|
1970
|
+
(R) => {
|
|
1971
|
+
R.stopPropagation(), h?.(e.id);
|
|
1404
1972
|
},
|
|
1405
|
-
[
|
|
1406
|
-
),
|
|
1407
|
-
|
|
1408
|
-
}, [
|
|
1409
|
-
return /* @__PURE__ */
|
|
1410
|
-
/* @__PURE__ */
|
|
1973
|
+
[h, e.id]
|
|
1974
|
+
), I = q(() => {
|
|
1975
|
+
h?.(null);
|
|
1976
|
+
}, [h]);
|
|
1977
|
+
return /* @__PURE__ */ r.jsxs("group", { children: [
|
|
1978
|
+
/* @__PURE__ */ r.jsxs(
|
|
1411
1979
|
"mesh",
|
|
1412
1980
|
{
|
|
1413
|
-
ref:
|
|
1414
|
-
position:
|
|
1415
|
-
onClick:
|
|
1416
|
-
onPointerOver:
|
|
1417
|
-
onPointerOut:
|
|
1981
|
+
ref: g,
|
|
1982
|
+
position: v,
|
|
1983
|
+
onClick: _,
|
|
1984
|
+
onPointerOver: T,
|
|
1985
|
+
onPointerOut: I,
|
|
1418
1986
|
castShadow: !0,
|
|
1419
1987
|
receiveShadow: !0,
|
|
1420
1988
|
children: [
|
|
1421
|
-
/* @__PURE__ */
|
|
1422
|
-
/* @__PURE__ */
|
|
1989
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: y }),
|
|
1990
|
+
/* @__PURE__ */ r.jsx(
|
|
1423
1991
|
"meshStandardMaterial",
|
|
1424
1992
|
{
|
|
1425
|
-
color:
|
|
1426
|
-
transparent:
|
|
1427
|
-
opacity:
|
|
1428
|
-
roughness:
|
|
1429
|
-
metalness:
|
|
1993
|
+
color: b,
|
|
1994
|
+
transparent: j < 1,
|
|
1995
|
+
opacity: j,
|
|
1996
|
+
roughness: w.box.roughness,
|
|
1997
|
+
metalness: w.box.metalness,
|
|
1998
|
+
polygonOffset: !0,
|
|
1999
|
+
polygonOffsetFactor: 1,
|
|
2000
|
+
polygonOffsetUnits: 1
|
|
2001
|
+
}
|
|
2002
|
+
),
|
|
2003
|
+
/* @__PURE__ */ r.jsx(
|
|
2004
|
+
Xe,
|
|
2005
|
+
{
|
|
2006
|
+
linewidth: 2,
|
|
2007
|
+
scale: 1.001,
|
|
2008
|
+
threshold: 15,
|
|
2009
|
+
color: M ?? "#000000",
|
|
2010
|
+
opacity: M ? 1 : 0.6,
|
|
2011
|
+
transparent: !0
|
|
1430
2012
|
}
|
|
1431
2013
|
)
|
|
1432
2014
|
]
|
|
1433
2015
|
}
|
|
1434
2016
|
),
|
|
1435
|
-
|
|
1436
|
-
/* @__PURE__ */
|
|
1437
|
-
/* @__PURE__ */
|
|
2017
|
+
M && /* @__PURE__ */ r.jsxs("mesh", { position: v, children: [
|
|
2018
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: y }),
|
|
2019
|
+
/* @__PURE__ */ r.jsx(
|
|
1438
2020
|
"meshBasicMaterial",
|
|
1439
2021
|
{
|
|
1440
|
-
color:
|
|
2022
|
+
color: M,
|
|
1441
2023
|
wireframe: !0,
|
|
1442
|
-
wireframeLinewidth:
|
|
2024
|
+
wireframeLinewidth: 2,
|
|
1443
2025
|
transparent: !0,
|
|
1444
2026
|
opacity: 0.9,
|
|
1445
2027
|
depthTest: !1
|
|
1446
2028
|
}
|
|
1447
2029
|
)
|
|
1448
2030
|
] }),
|
|
1449
|
-
|
|
1450
|
-
/* @__PURE__ */ s.jsx("edgesGeometry", { args: [new $.BoxGeometry(...y)] }),
|
|
1451
|
-
/* @__PURE__ */ s.jsx("lineBasicMaterial", { color: S })
|
|
1452
|
-
] }),
|
|
1453
|
-
n && /* @__PURE__ */ s.jsx(
|
|
2031
|
+
s && /* @__PURE__ */ r.jsx(
|
|
1454
2032
|
ke,
|
|
1455
2033
|
{
|
|
1456
|
-
position: [
|
|
2034
|
+
position: [v.x, v.y + y[1] / 2 + 0.05, v.z],
|
|
1457
2035
|
center: !0,
|
|
1458
2036
|
style: {
|
|
1459
2037
|
background: "rgba(0,0,0,0.75)",
|
|
@@ -1464,38 +2042,38 @@ const bt = V(function({
|
|
|
1464
2042
|
whiteSpace: "nowrap",
|
|
1465
2043
|
pointerEvents: "none"
|
|
1466
2044
|
},
|
|
1467
|
-
children:
|
|
2045
|
+
children: m.sku ?? m.type ?? m.id
|
|
1468
2046
|
}
|
|
1469
2047
|
)
|
|
1470
2048
|
] });
|
|
1471
|
-
}),
|
|
2049
|
+
}), Mt = V(function({
|
|
1472
2050
|
pallet: e,
|
|
1473
2051
|
position: t = { x: 0, y: 0, z: 0 },
|
|
1474
|
-
color:
|
|
1475
|
-
edgeColor:
|
|
2052
|
+
color: o,
|
|
2053
|
+
edgeColor: s
|
|
1476
2054
|
}) {
|
|
1477
|
-
const
|
|
1478
|
-
() => [
|
|
1479
|
-
[
|
|
1480
|
-
),
|
|
1481
|
-
() => new
|
|
1482
|
-
t.x *
|
|
1483
|
-
t.y *
|
|
1484
|
-
t.z *
|
|
2055
|
+
const n = ce(), a = o ?? n.pallet.color, c = s ?? n.pallet.edgeColor, l = U.MM_TO_M, f = e.dimensions, h = k(
|
|
2056
|
+
() => [f.width * l, f.height * l, f.depth * l],
|
|
2057
|
+
[f, l]
|
|
2058
|
+
), g = k(
|
|
2059
|
+
() => new B.Vector3(
|
|
2060
|
+
t.x * l + h[0] / 2,
|
|
2061
|
+
t.y * l + h[1] / 2,
|
|
2062
|
+
t.z * l + h[2] / 2
|
|
1485
2063
|
),
|
|
1486
|
-
[t,
|
|
2064
|
+
[t, h, l]
|
|
1487
2065
|
);
|
|
1488
|
-
return /* @__PURE__ */
|
|
1489
|
-
/* @__PURE__ */
|
|
1490
|
-
/* @__PURE__ */
|
|
1491
|
-
/* @__PURE__ */
|
|
2066
|
+
return /* @__PURE__ */ r.jsxs("group", { children: [
|
|
2067
|
+
/* @__PURE__ */ r.jsxs("mesh", { position: g, castShadow: !0, receiveShadow: !0, children: [
|
|
2068
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: h }),
|
|
2069
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: a, roughness: n.pallet.roughness, metalness: n.pallet.metalness })
|
|
1492
2070
|
] }),
|
|
1493
|
-
/* @__PURE__ */
|
|
1494
|
-
/* @__PURE__ */
|
|
1495
|
-
/* @__PURE__ */
|
|
2071
|
+
/* @__PURE__ */ r.jsxs("lineSegments", { position: g, children: [
|
|
2072
|
+
/* @__PURE__ */ r.jsx("edgesGeometry", { args: [new B.BoxGeometry(...h)] }),
|
|
2073
|
+
/* @__PURE__ */ r.jsx("lineBasicMaterial", { color: c })
|
|
1496
2074
|
] })
|
|
1497
2075
|
] });
|
|
1498
|
-
}),
|
|
2076
|
+
}), zt = {
|
|
1499
2077
|
[me.CARDBOARD]: "#b5926b",
|
|
1500
2078
|
[me.WOOD]: "#c4a26e",
|
|
1501
2079
|
[me.PLASTIC]: "#90a4ae"
|
|
@@ -1503,23 +2081,23 @@ const bt = V(function({
|
|
|
1503
2081
|
separator: e,
|
|
1504
2082
|
position: t = { x: 0, y: 0, z: 0 }
|
|
1505
2083
|
}) {
|
|
1506
|
-
const
|
|
1507
|
-
() => [
|
|
1508
|
-
[
|
|
2084
|
+
const o = U.MM_TO_M, s = e.dimensions, n = k(
|
|
2085
|
+
() => [s.width * o, s.height * o, s.depth * o],
|
|
2086
|
+
[s, o]
|
|
1509
2087
|
), a = k(
|
|
1510
|
-
() => new
|
|
1511
|
-
t.x *
|
|
1512
|
-
t.y *
|
|
1513
|
-
t.z *
|
|
2088
|
+
() => new B.Vector3(
|
|
2089
|
+
t.x * o + n[0] / 2,
|
|
2090
|
+
t.y * o + n[1] / 2,
|
|
2091
|
+
t.z * o + n[2] / 2
|
|
1514
2092
|
),
|
|
1515
|
-
[t,
|
|
1516
|
-
),
|
|
1517
|
-
return /* @__PURE__ */
|
|
1518
|
-
/* @__PURE__ */
|
|
1519
|
-
/* @__PURE__ */
|
|
2093
|
+
[t, n, o]
|
|
2094
|
+
), c = zt[e.material];
|
|
2095
|
+
return /* @__PURE__ */ r.jsxs("mesh", { position: a, receiveShadow: !0, children: [
|
|
2096
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: n }),
|
|
2097
|
+
/* @__PURE__ */ r.jsx(
|
|
1520
2098
|
"meshStandardMaterial",
|
|
1521
2099
|
{
|
|
1522
|
-
color:
|
|
2100
|
+
color: c,
|
|
1523
2101
|
roughness: 0.9,
|
|
1524
2102
|
metalness: 0,
|
|
1525
2103
|
transparent: !0,
|
|
@@ -1531,108 +2109,108 @@ const bt = V(function({
|
|
|
1531
2109
|
function({
|
|
1532
2110
|
stackedPallet: e,
|
|
1533
2111
|
position: t = { x: 0, y: 0, z: 0 },
|
|
1534
|
-
yRotation:
|
|
1535
|
-
palletId:
|
|
1536
|
-
selectedBoxId:
|
|
2112
|
+
yRotation: o = 0,
|
|
2113
|
+
palletId: s,
|
|
2114
|
+
selectedBoxId: n,
|
|
1537
2115
|
highlightedBoxId: a,
|
|
1538
|
-
selectedColor:
|
|
1539
|
-
highlightedColor:
|
|
1540
|
-
showLabels:
|
|
1541
|
-
onBoxClick:
|
|
1542
|
-
onBoxHover:
|
|
2116
|
+
selectedColor: c,
|
|
2117
|
+
highlightedColor: l,
|
|
2118
|
+
showLabels: f = !1,
|
|
2119
|
+
onBoxClick: h,
|
|
2120
|
+
onBoxHover: g
|
|
1543
2121
|
}) {
|
|
1544
|
-
const
|
|
1545
|
-
() =>
|
|
1546
|
-
[e,
|
|
1547
|
-
),
|
|
1548
|
-
const
|
|
1549
|
-
let
|
|
1550
|
-
for (const
|
|
1551
|
-
|
|
1552
|
-
const
|
|
1553
|
-
(
|
|
2122
|
+
const w = k(
|
|
2123
|
+
() => Je(e, s),
|
|
2124
|
+
[e, s]
|
|
2125
|
+
), m = U.MM_TO_M, x = k(() => o * Math.PI / 180, [o]), u = k(() => {
|
|
2126
|
+
const d = [];
|
|
2127
|
+
let b = 0;
|
|
2128
|
+
for (const j of w.floors) {
|
|
2129
|
+
d.push(b), b += j.pallet.dimensions.height;
|
|
2130
|
+
const E = j.boxes.reduce(
|
|
2131
|
+
(S, C) => Math.max(S, C.position.y + C.box.dimensions.height),
|
|
1554
2132
|
0
|
|
1555
2133
|
);
|
|
1556
|
-
|
|
2134
|
+
b += E, j.separatorAbove && (b += j.separatorAbove.dimensions.height);
|
|
1557
2135
|
}
|
|
1558
|
-
return
|
|
1559
|
-
}, [
|
|
1560
|
-
return /* @__PURE__ */
|
|
2136
|
+
return d;
|
|
2137
|
+
}, [w]);
|
|
2138
|
+
return /* @__PURE__ */ r.jsx(
|
|
1561
2139
|
"group",
|
|
1562
2140
|
{
|
|
1563
|
-
position: [t.x *
|
|
1564
|
-
rotation: [0,
|
|
1565
|
-
children:
|
|
1566
|
-
const
|
|
1567
|
-
return /* @__PURE__ */
|
|
1568
|
-
/* @__PURE__ */
|
|
1569
|
-
|
|
2141
|
+
position: [t.x * m, t.y * m, t.z * m],
|
|
2142
|
+
rotation: [0, x, 0],
|
|
2143
|
+
children: w.floors.map((d, b) => {
|
|
2144
|
+
const j = u[b], E = j + d.pallet.dimensions.height;
|
|
2145
|
+
return /* @__PURE__ */ r.jsxs("group", { children: [
|
|
2146
|
+
/* @__PURE__ */ r.jsx(
|
|
2147
|
+
Mt,
|
|
1570
2148
|
{
|
|
1571
|
-
pallet:
|
|
1572
|
-
position: { x: 0, y:
|
|
2149
|
+
pallet: d.pallet,
|
|
2150
|
+
position: { x: 0, y: j, z: 0 }
|
|
1573
2151
|
}
|
|
1574
2152
|
),
|
|
1575
|
-
|
|
1576
|
-
|
|
2153
|
+
d.boxes.map((S) => /* @__PURE__ */ r.jsx(
|
|
2154
|
+
jt,
|
|
1577
2155
|
{
|
|
1578
2156
|
placedBox: {
|
|
1579
|
-
...
|
|
2157
|
+
...S,
|
|
1580
2158
|
position: {
|
|
1581
|
-
x:
|
|
1582
|
-
y:
|
|
1583
|
-
z:
|
|
2159
|
+
x: S.position.x,
|
|
2160
|
+
y: S.position.y + E,
|
|
2161
|
+
z: S.position.z
|
|
1584
2162
|
}
|
|
1585
2163
|
},
|
|
1586
|
-
selected:
|
|
1587
|
-
highlighted: a ===
|
|
1588
|
-
selectedColor:
|
|
1589
|
-
highlightedColor:
|
|
1590
|
-
showLabel:
|
|
1591
|
-
onClick:
|
|
1592
|
-
onHover:
|
|
2164
|
+
selected: n === S.id,
|
|
2165
|
+
highlighted: a === S.id,
|
|
2166
|
+
selectedColor: c,
|
|
2167
|
+
highlightedColor: l,
|
|
2168
|
+
showLabel: f,
|
|
2169
|
+
onClick: h,
|
|
2170
|
+
onHover: g
|
|
1593
2171
|
},
|
|
1594
|
-
|
|
2172
|
+
S.id
|
|
1595
2173
|
)),
|
|
1596
|
-
|
|
2174
|
+
d.separatorAbove && /* @__PURE__ */ r.jsx(
|
|
1597
2175
|
Ct,
|
|
1598
2176
|
{
|
|
1599
|
-
separator:
|
|
2177
|
+
separator: d.separatorAbove,
|
|
1600
2178
|
position: {
|
|
1601
2179
|
x: 0,
|
|
1602
|
-
y:
|
|
1603
|
-
(
|
|
2180
|
+
y: E + d.boxes.reduce(
|
|
2181
|
+
(S, C) => Math.max(S, C.position.y + C.box.dimensions.height),
|
|
1604
2182
|
0
|
|
1605
2183
|
),
|
|
1606
2184
|
z: 0
|
|
1607
2185
|
}
|
|
1608
2186
|
}
|
|
1609
2187
|
)
|
|
1610
|
-
] }, `floor-${
|
|
2188
|
+
] }, `floor-${b}`);
|
|
1611
2189
|
})
|
|
1612
2190
|
}
|
|
1613
2191
|
);
|
|
1614
2192
|
}
|
|
1615
|
-
),
|
|
2193
|
+
), Ht = V(function({
|
|
1616
2194
|
text: e,
|
|
1617
2195
|
position: t,
|
|
1618
|
-
visible:
|
|
1619
|
-
fontSize:
|
|
1620
|
-
color:
|
|
2196
|
+
visible: o = !0,
|
|
2197
|
+
fontSize: s = 12,
|
|
2198
|
+
color: n = "white",
|
|
1621
2199
|
background: a = "rgba(0,0,0,0.75)"
|
|
1622
2200
|
}) {
|
|
1623
|
-
if (!
|
|
1624
|
-
const
|
|
1625
|
-
return /* @__PURE__ */
|
|
2201
|
+
if (!o) return null;
|
|
2202
|
+
const c = U.MM_TO_M;
|
|
2203
|
+
return /* @__PURE__ */ r.jsx(
|
|
1626
2204
|
ke,
|
|
1627
2205
|
{
|
|
1628
|
-
position: [t.x *
|
|
2206
|
+
position: [t.x * c, t.y * c, t.z * c],
|
|
1629
2207
|
center: !0,
|
|
1630
2208
|
style: {
|
|
1631
2209
|
background: a,
|
|
1632
|
-
color:
|
|
2210
|
+
color: n,
|
|
1633
2211
|
padding: "2px 8px",
|
|
1634
2212
|
borderRadius: "4px",
|
|
1635
|
-
fontSize: `${
|
|
2213
|
+
fontSize: `${s}px`,
|
|
1636
2214
|
whiteSpace: "nowrap",
|
|
1637
2215
|
pointerEvents: "none",
|
|
1638
2216
|
userSelect: "none"
|
|
@@ -1640,42 +2218,42 @@ const bt = V(function({
|
|
|
1640
2218
|
children: e
|
|
1641
2219
|
}
|
|
1642
2220
|
);
|
|
1643
|
-
}),
|
|
2221
|
+
}), Pt = V(
|
|
1644
2222
|
function({
|
|
1645
2223
|
room: e,
|
|
1646
2224
|
floorColor: t,
|
|
1647
|
-
wallColor:
|
|
1648
|
-
showGrid:
|
|
1649
|
-
children:
|
|
2225
|
+
wallColor: o,
|
|
2226
|
+
showGrid: s,
|
|
2227
|
+
children: n
|
|
1650
2228
|
}) {
|
|
1651
|
-
const a = ce(),
|
|
2229
|
+
const a = ce(), c = t ?? a.warehouse.floorColor, l = o ?? a.warehouse.wallColor, f = s ?? a.warehouse.showGrid, h = U.MM_TO_M, g = e.ceilingHeight * h, { shape: w, minX: m, maxX: x, minZ: u, maxZ: d } = k(() => {
|
|
1652
2230
|
const y = e.floorPolygon;
|
|
1653
|
-
let
|
|
1654
|
-
for (const
|
|
1655
|
-
|
|
1656
|
-
const
|
|
1657
|
-
|
|
1658
|
-
for (let
|
|
1659
|
-
|
|
1660
|
-
return
|
|
1661
|
-
}, [e.floorPolygon,
|
|
1662
|
-
const y = e.floorPolygon,
|
|
1663
|
-
for (let
|
|
1664
|
-
const
|
|
1665
|
-
|
|
1666
|
-
|
|
2231
|
+
let v = 1 / 0, M = -1 / 0, _ = 1 / 0, T = -1 / 0;
|
|
2232
|
+
for (const R of y)
|
|
2233
|
+
v = Math.min(v, R.x * h), M = Math.max(M, R.x * h), _ = Math.min(_, R.z * h), T = Math.max(T, R.z * h);
|
|
2234
|
+
const I = new B.Shape();
|
|
2235
|
+
I.moveTo(y[0].x * h, -y[0].z * h);
|
|
2236
|
+
for (let R = 1; R < y.length; R++)
|
|
2237
|
+
I.lineTo(y[R].x * h, -y[R].z * h);
|
|
2238
|
+
return I.closePath(), { shape: I, minX: v, maxX: M, minZ: _, maxZ: T };
|
|
2239
|
+
}, [e.floorPolygon, h]), b = k(() => {
|
|
2240
|
+
const y = e.floorPolygon, v = [], M = [];
|
|
2241
|
+
for (let T = 0; T < y.length; T++) {
|
|
2242
|
+
const I = y[T], R = y[(T + 1) % y.length], A = T * 4;
|
|
2243
|
+
v.push(
|
|
2244
|
+
I.x * h,
|
|
1667
2245
|
0,
|
|
1668
|
-
|
|
1669
|
-
|
|
2246
|
+
I.z * h,
|
|
2247
|
+
R.x * h,
|
|
1670
2248
|
0,
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
),
|
|
2249
|
+
R.z * h,
|
|
2250
|
+
R.x * h,
|
|
2251
|
+
g,
|
|
2252
|
+
R.z * h,
|
|
2253
|
+
I.x * h,
|
|
2254
|
+
g,
|
|
2255
|
+
I.z * h
|
|
2256
|
+
), M.push(
|
|
1679
2257
|
A,
|
|
1680
2258
|
A + 1,
|
|
1681
2259
|
A + 2,
|
|
@@ -1684,41 +2262,41 @@ const bt = V(function({
|
|
|
1684
2262
|
A + 3
|
|
1685
2263
|
);
|
|
1686
2264
|
}
|
|
1687
|
-
const
|
|
1688
|
-
return
|
|
1689
|
-
}, [e.floorPolygon,
|
|
1690
|
-
if (!
|
|
1691
|
-
const y = 0.5,
|
|
1692
|
-
for (let
|
|
1693
|
-
|
|
1694
|
-
for (let
|
|
1695
|
-
|
|
1696
|
-
const
|
|
1697
|
-
return
|
|
1698
|
-
}, [
|
|
1699
|
-
return /* @__PURE__ */
|
|
1700
|
-
/* @__PURE__ */
|
|
1701
|
-
/* @__PURE__ */
|
|
1702
|
-
/* @__PURE__ */
|
|
2265
|
+
const _ = new B.BufferGeometry();
|
|
2266
|
+
return _.setAttribute("position", new B.Float32BufferAttribute(v, 3)), _.setIndex(M), _.computeVertexNormals(), _;
|
|
2267
|
+
}, [e.floorPolygon, g, h]), j = x - m, E = d - u, S = (m + x) / 2, C = (u + d) / 2, z = k(() => {
|
|
2268
|
+
if (!f) return null;
|
|
2269
|
+
const y = 0.5, v = 0.01, M = [];
|
|
2270
|
+
for (let T = m; T <= x; T += y)
|
|
2271
|
+
M.push(T, v, u, T, v, d);
|
|
2272
|
+
for (let T = u; T <= d; T += y)
|
|
2273
|
+
M.push(m, v, T, x, v, T);
|
|
2274
|
+
const _ = new B.BufferGeometry();
|
|
2275
|
+
return _.setAttribute("position", new B.Float32BufferAttribute(M, 3)), _;
|
|
2276
|
+
}, [f, m, x, u, d]);
|
|
2277
|
+
return /* @__PURE__ */ r.jsxs("group", { children: [
|
|
2278
|
+
/* @__PURE__ */ r.jsxs("mesh", { rotation: [-Math.PI / 2, 0, 0], position: [0, -5e-3, 0], receiveShadow: !0, children: [
|
|
2279
|
+
/* @__PURE__ */ r.jsx("shapeGeometry", { args: [w] }),
|
|
2280
|
+
/* @__PURE__ */ r.jsx(
|
|
1703
2281
|
"meshStandardMaterial",
|
|
1704
2282
|
{
|
|
1705
|
-
color:
|
|
1706
|
-
side:
|
|
2283
|
+
color: c,
|
|
2284
|
+
side: B.DoubleSide,
|
|
1707
2285
|
roughness: a.warehouse.floorRoughness
|
|
1708
2286
|
}
|
|
1709
2287
|
)
|
|
1710
2288
|
] }),
|
|
1711
|
-
/* @__PURE__ */
|
|
2289
|
+
/* @__PURE__ */ r.jsx("mesh", { geometry: b, position: [0, 0, 0], receiveShadow: !0, children: /* @__PURE__ */ r.jsx(
|
|
1712
2290
|
"meshStandardMaterial",
|
|
1713
2291
|
{
|
|
1714
|
-
color:
|
|
1715
|
-
side:
|
|
2292
|
+
color: l,
|
|
2293
|
+
side: B.DoubleSide,
|
|
1716
2294
|
roughness: 0.7,
|
|
1717
2295
|
transparent: !0,
|
|
1718
2296
|
opacity: a.warehouse.wallOpacity
|
|
1719
2297
|
}
|
|
1720
2298
|
) }),
|
|
1721
|
-
|
|
2299
|
+
f && z && /* @__PURE__ */ r.jsx("lineSegments", { geometry: z, children: /* @__PURE__ */ r.jsx(
|
|
1722
2300
|
"lineBasicMaterial",
|
|
1723
2301
|
{
|
|
1724
2302
|
color: a.warehouse.gridColor,
|
|
@@ -1727,144 +2305,144 @@ const bt = V(function({
|
|
|
1727
2305
|
depthWrite: !1
|
|
1728
2306
|
}
|
|
1729
2307
|
) }),
|
|
1730
|
-
/* @__PURE__ */
|
|
1731
|
-
/* @__PURE__ */
|
|
2308
|
+
/* @__PURE__ */ r.jsx("ambientLight", { intensity: a.warehouse.ambientIntensity }),
|
|
2309
|
+
/* @__PURE__ */ r.jsx(
|
|
1732
2310
|
"directionalLight",
|
|
1733
2311
|
{
|
|
1734
|
-
position: [
|
|
2312
|
+
position: [S + j, g * 0.8, C + E],
|
|
1735
2313
|
intensity: a.warehouse.directionalIntensity,
|
|
1736
2314
|
castShadow: !0,
|
|
1737
2315
|
"shadow-mapSize-width": 1024,
|
|
1738
2316
|
"shadow-mapSize-height": 1024
|
|
1739
2317
|
}
|
|
1740
2318
|
),
|
|
1741
|
-
/* @__PURE__ */
|
|
2319
|
+
/* @__PURE__ */ r.jsx(
|
|
1742
2320
|
"pointLight",
|
|
1743
2321
|
{
|
|
1744
|
-
position: [
|
|
2322
|
+
position: [S, g * 0.9, C],
|
|
1745
2323
|
intensity: 0.5,
|
|
1746
|
-
distance: Math.max(
|
|
2324
|
+
distance: Math.max(j, E) * 2
|
|
1747
2325
|
}
|
|
1748
2326
|
),
|
|
1749
|
-
|
|
2327
|
+
n
|
|
1750
2328
|
] });
|
|
1751
2329
|
}
|
|
1752
|
-
), K = V(function({ position: e, radius: t, width:
|
|
1753
|
-
return /* @__PURE__ */
|
|
1754
|
-
/* @__PURE__ */
|
|
1755
|
-
/* @__PURE__ */
|
|
1756
|
-
/* @__PURE__ */
|
|
2330
|
+
), K = V(function({ position: e, radius: t, width: o, color: s }) {
|
|
2331
|
+
return /* @__PURE__ */ r.jsxs("group", { position: e, children: [
|
|
2332
|
+
/* @__PURE__ */ r.jsxs("mesh", { rotation: [0, 0, Math.PI / 2], castShadow: !0, children: [
|
|
2333
|
+
/* @__PURE__ */ r.jsx("cylinderGeometry", { args: [t, t, o, 24] }),
|
|
2334
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: s, roughness: 0.9, metalness: 0.1 })
|
|
1757
2335
|
] }),
|
|
1758
|
-
/* @__PURE__ */
|
|
1759
|
-
/* @__PURE__ */
|
|
1760
|
-
/* @__PURE__ */
|
|
2336
|
+
/* @__PURE__ */ r.jsxs("mesh", { rotation: [0, 0, Math.PI / 2], children: [
|
|
2337
|
+
/* @__PURE__ */ r.jsx("cylinderGeometry", { args: [t * 0.55, t * 0.55, o + 5e-3, 16] }),
|
|
2338
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: "#888888", roughness: 0.3, metalness: 0.7 })
|
|
1761
2339
|
] })
|
|
1762
2340
|
] });
|
|
1763
|
-
}),
|
|
2341
|
+
}), Rt = V(function({
|
|
1764
2342
|
truck: e,
|
|
1765
2343
|
showGrid: t,
|
|
1766
|
-
wallOpacity:
|
|
1767
|
-
showRoof:
|
|
1768
|
-
showSideWalls:
|
|
2344
|
+
wallOpacity: o = 0.3,
|
|
2345
|
+
showRoof: s = !1,
|
|
2346
|
+
showSideWalls: n = !0,
|
|
1769
2347
|
children: a
|
|
1770
2348
|
}) {
|
|
1771
|
-
const
|
|
1772
|
-
if (!
|
|
1773
|
-
const G = 0.5,
|
|
1774
|
-
for (let X = 0; X <=
|
|
1775
|
-
|
|
1776
|
-
for (let X = 0; X <=
|
|
1777
|
-
|
|
1778
|
-
const F = new
|
|
1779
|
-
return F.setAttribute("position", new
|
|
1780
|
-
}, [
|
|
1781
|
-
() => /* @__PURE__ */
|
|
2349
|
+
const l = ce().truck, f = t ?? l.showGrid, h = U.MM_TO_M, g = e.dimensions.width * h, w = e.dimensions.height * h, m = e.dimensions.depth * h, x = 0.05, u = 0.08, d = 0.28, b = 0.18, j = 0.15, E = 0.25, S = d + j, C = S + d + 0.1, z = C + E / 2 + u / 2, y = g + x * 2, v = g * 0.65, M = w * 0.85, _ = 0.15, T = m + x + _, I = z, R = k(() => {
|
|
2350
|
+
if (!f) return null;
|
|
2351
|
+
const G = 0.5, D = z + 2e-3, H = [];
|
|
2352
|
+
for (let X = 0; X <= g; X += G)
|
|
2353
|
+
H.push(X, D, 0, X, D, m);
|
|
2354
|
+
for (let X = 0; X <= m; X += G)
|
|
2355
|
+
H.push(0, D, X, g, D, X);
|
|
2356
|
+
const F = new B.BufferGeometry();
|
|
2357
|
+
return F.setAttribute("position", new B.Float32BufferAttribute(H, 3)), F;
|
|
2358
|
+
}, [f, g, m, z]), A = k(
|
|
2359
|
+
() => /* @__PURE__ */ r.jsx(
|
|
1782
2360
|
"meshStandardMaterial",
|
|
1783
2361
|
{
|
|
1784
|
-
color:
|
|
2362
|
+
color: l.wallColor,
|
|
1785
2363
|
roughness: 0.5,
|
|
1786
2364
|
metalness: 0.3,
|
|
1787
|
-
transparent:
|
|
1788
|
-
opacity:
|
|
1789
|
-
side:
|
|
1790
|
-
depthWrite:
|
|
2365
|
+
transparent: o < 1,
|
|
2366
|
+
opacity: o,
|
|
2367
|
+
side: B.DoubleSide,
|
|
2368
|
+
depthWrite: o >= 0.95
|
|
1791
2369
|
}
|
|
1792
2370
|
),
|
|
1793
|
-
[
|
|
2371
|
+
[l.wallColor, o]
|
|
1794
2372
|
);
|
|
1795
|
-
return /* @__PURE__ */
|
|
1796
|
-
/* @__PURE__ */
|
|
2373
|
+
return /* @__PURE__ */ r.jsxs("group", { children: [
|
|
2374
|
+
/* @__PURE__ */ r.jsxs(
|
|
1797
2375
|
"mesh",
|
|
1798
2376
|
{
|
|
1799
|
-
position: [
|
|
2377
|
+
position: [g / 2, z, m / 2],
|
|
1800
2378
|
rotation: [-Math.PI / 2, 0, 0],
|
|
1801
2379
|
receiveShadow: !0,
|
|
1802
2380
|
children: [
|
|
1803
|
-
/* @__PURE__ */
|
|
1804
|
-
/* @__PURE__ */
|
|
2381
|
+
/* @__PURE__ */ r.jsx("planeGeometry", { args: [g, m] }),
|
|
2382
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: l.floorColor, roughness: 0.85 })
|
|
1805
2383
|
]
|
|
1806
2384
|
}
|
|
1807
2385
|
),
|
|
1808
|
-
/* @__PURE__ */
|
|
1809
|
-
/* @__PURE__ */
|
|
1810
|
-
/* @__PURE__ */
|
|
2386
|
+
/* @__PURE__ */ r.jsxs("mesh", { position: [g / 2, z - u / 2, m / 2], castShadow: !0, receiveShadow: !0, children: [
|
|
2387
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: [g + x * 2, u, m + x] }),
|
|
2388
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: l.floorColor, roughness: 0.85, metalness: 0.1 })
|
|
1811
2389
|
] }),
|
|
1812
|
-
|
|
1813
|
-
/* @__PURE__ */
|
|
2390
|
+
n && /* @__PURE__ */ r.jsxs("mesh", { position: [-x / 2, z + w / 2, m / 2], castShadow: !0, children: [
|
|
2391
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: [x, w, m + x] }),
|
|
1814
2392
|
A
|
|
1815
2393
|
] }),
|
|
1816
|
-
|
|
1817
|
-
/* @__PURE__ */
|
|
2394
|
+
n && /* @__PURE__ */ r.jsxs("mesh", { position: [g + x / 2, z + w / 2, m / 2], castShadow: !0, children: [
|
|
2395
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: [x, w, m + x] }),
|
|
1818
2396
|
A
|
|
1819
2397
|
] }),
|
|
1820
|
-
/* @__PURE__ */
|
|
1821
|
-
/* @__PURE__ */
|
|
2398
|
+
/* @__PURE__ */ r.jsxs("mesh", { position: [g / 2, z + w / 2, m + x / 2], castShadow: !0, children: [
|
|
2399
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: [g + x * 2, w, x] }),
|
|
1822
2400
|
A
|
|
1823
2401
|
] }),
|
|
1824
|
-
|
|
1825
|
-
/* @__PURE__ */
|
|
2402
|
+
s && /* @__PURE__ */ r.jsxs("mesh", { position: [g / 2, z + w, m / 2], castShadow: !0, children: [
|
|
2403
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: [g + x * 2, x, m + x] }),
|
|
1826
2404
|
A
|
|
1827
2405
|
] }),
|
|
1828
|
-
|
|
2406
|
+
f && R && /* @__PURE__ */ r.jsx("lineSegments", { geometry: R, children: /* @__PURE__ */ r.jsx(
|
|
1829
2407
|
"lineBasicMaterial",
|
|
1830
2408
|
{
|
|
1831
|
-
color:
|
|
2409
|
+
color: l.gridColor,
|
|
1832
2410
|
opacity: 0.5,
|
|
1833
2411
|
transparent: !0,
|
|
1834
2412
|
depthWrite: !1
|
|
1835
2413
|
}
|
|
1836
2414
|
) }),
|
|
1837
|
-
/* @__PURE__ */
|
|
1838
|
-
/* @__PURE__ */
|
|
1839
|
-
/* @__PURE__ */
|
|
2415
|
+
/* @__PURE__ */ r.jsxs("mesh", { position: [g * 0.25, C, (m + v + _) / 2], castShadow: !0, children: [
|
|
2416
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: [0.12, E, m + v + _] }),
|
|
2417
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: l.chassisColor, roughness: 0.7, metalness: 0.5 })
|
|
1840
2418
|
] }),
|
|
1841
|
-
/* @__PURE__ */
|
|
1842
|
-
/* @__PURE__ */
|
|
1843
|
-
/* @__PURE__ */
|
|
2419
|
+
/* @__PURE__ */ r.jsxs("mesh", { position: [g * 0.75, C, (m + v + _) / 2], castShadow: !0, children: [
|
|
2420
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: [0.12, E, m + v + _] }),
|
|
2421
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: l.chassisColor, roughness: 0.7, metalness: 0.5 })
|
|
1844
2422
|
] }),
|
|
1845
|
-
[0.15, 0.35, 0.55, 0.75, 0.95].map((G) => /* @__PURE__ */
|
|
1846
|
-
/* @__PURE__ */
|
|
1847
|
-
/* @__PURE__ */
|
|
2423
|
+
[0.15, 0.35, 0.55, 0.75, 0.95].map((G) => /* @__PURE__ */ r.jsxs("mesh", { position: [g / 2, C, m * G], castShadow: !0, children: [
|
|
2424
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: [g * 0.6, 0.06, 0.06] }),
|
|
2425
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: l.chassisColor, roughness: 0.7, metalness: 0.5 })
|
|
1848
2426
|
] }, G)),
|
|
1849
|
-
/* @__PURE__ */
|
|
1850
|
-
/* @__PURE__ */
|
|
1851
|
-
/* @__PURE__ */
|
|
1852
|
-
/* @__PURE__ */
|
|
1853
|
-
/* @__PURE__ */
|
|
1854
|
-
/* @__PURE__ */
|
|
1855
|
-
/* @__PURE__ */
|
|
1856
|
-
/* @__PURE__ */
|
|
1857
|
-
/* @__PURE__ */
|
|
1858
|
-
/* @__PURE__ */
|
|
2427
|
+
/* @__PURE__ */ r.jsx(K, { position: [-b / 2 - x, S, m * 0.12], radius: d, width: b, color: l.wheelColor }),
|
|
2428
|
+
/* @__PURE__ */ r.jsx(K, { position: [g + b / 2 + x, S, m * 0.12], radius: d, width: b, color: l.wheelColor }),
|
|
2429
|
+
/* @__PURE__ */ r.jsx(K, { position: [-b / 2 - x, S, m * 0.22], radius: d, width: b, color: l.wheelColor }),
|
|
2430
|
+
/* @__PURE__ */ r.jsx(K, { position: [g + b / 2 + x, S, m * 0.22], radius: d, width: b, color: l.wheelColor }),
|
|
2431
|
+
/* @__PURE__ */ r.jsx(K, { position: [-b / 2 - x, S, T + v * 0.5], radius: d, width: b, color: l.wheelColor }),
|
|
2432
|
+
/* @__PURE__ */ r.jsx(K, { position: [g + b / 2 + x, S, T + v * 0.5], radius: d, width: b, color: l.wheelColor }),
|
|
2433
|
+
/* @__PURE__ */ r.jsxs("group", { position: [g / 2, I, T], children: [
|
|
2434
|
+
/* @__PURE__ */ r.jsxs("mesh", { position: [0, M / 2, v / 2], castShadow: !0, receiveShadow: !0, children: [
|
|
2435
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: [y, M, v] }),
|
|
2436
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: l.cabColor, roughness: 0.4, metalness: 0.3 })
|
|
1859
2437
|
] }),
|
|
1860
|
-
/* @__PURE__ */
|
|
2438
|
+
/* @__PURE__ */ r.jsxs(
|
|
1861
2439
|
"mesh",
|
|
1862
2440
|
{
|
|
1863
|
-
position: [0,
|
|
2441
|
+
position: [0, M * 0.6, v + 0.01],
|
|
1864
2442
|
castShadow: !0,
|
|
1865
2443
|
children: [
|
|
1866
|
-
/* @__PURE__ */
|
|
1867
|
-
/* @__PURE__ */
|
|
2444
|
+
/* @__PURE__ */ r.jsx("planeGeometry", { args: [y * 0.75, M * 0.4] }),
|
|
2445
|
+
/* @__PURE__ */ r.jsx(
|
|
1868
2446
|
"meshStandardMaterial",
|
|
1869
2447
|
{
|
|
1870
2448
|
color: "#88bbdd",
|
|
@@ -1872,15 +2450,15 @@ const bt = V(function({
|
|
|
1872
2450
|
opacity: 0.5,
|
|
1873
2451
|
roughness: 0.1,
|
|
1874
2452
|
metalness: 0.6,
|
|
1875
|
-
side:
|
|
2453
|
+
side: B.DoubleSide
|
|
1876
2454
|
}
|
|
1877
2455
|
)
|
|
1878
2456
|
]
|
|
1879
2457
|
}
|
|
1880
2458
|
),
|
|
1881
|
-
/* @__PURE__ */
|
|
1882
|
-
/* @__PURE__ */
|
|
1883
|
-
/* @__PURE__ */
|
|
2459
|
+
/* @__PURE__ */ r.jsxs("mesh", { position: [-y / 2 - 0.01, M * 0.6, v * 0.55], rotation: [0, Math.PI / 2, 0], children: [
|
|
2460
|
+
/* @__PURE__ */ r.jsx("planeGeometry", { args: [v * 0.5, M * 0.3] }),
|
|
2461
|
+
/* @__PURE__ */ r.jsx(
|
|
1884
2462
|
"meshStandardMaterial",
|
|
1885
2463
|
{
|
|
1886
2464
|
color: "#88bbdd",
|
|
@@ -1888,13 +2466,13 @@ const bt = V(function({
|
|
|
1888
2466
|
opacity: 0.4,
|
|
1889
2467
|
roughness: 0.1,
|
|
1890
2468
|
metalness: 0.6,
|
|
1891
|
-
side:
|
|
2469
|
+
side: B.DoubleSide
|
|
1892
2470
|
}
|
|
1893
2471
|
)
|
|
1894
2472
|
] }),
|
|
1895
|
-
/* @__PURE__ */
|
|
1896
|
-
/* @__PURE__ */
|
|
1897
|
-
/* @__PURE__ */
|
|
2473
|
+
/* @__PURE__ */ r.jsxs("mesh", { position: [y / 2 + 0.01, M * 0.6, v * 0.55], rotation: [0, -Math.PI / 2, 0], children: [
|
|
2474
|
+
/* @__PURE__ */ r.jsx("planeGeometry", { args: [v * 0.5, M * 0.3] }),
|
|
2475
|
+
/* @__PURE__ */ r.jsx(
|
|
1898
2476
|
"meshStandardMaterial",
|
|
1899
2477
|
{
|
|
1900
2478
|
color: "#88bbdd",
|
|
@@ -1902,72 +2480,72 @@ const bt = V(function({
|
|
|
1902
2480
|
opacity: 0.4,
|
|
1903
2481
|
roughness: 0.1,
|
|
1904
2482
|
metalness: 0.6,
|
|
1905
|
-
side:
|
|
2483
|
+
side: B.DoubleSide
|
|
1906
2484
|
}
|
|
1907
2485
|
)
|
|
1908
2486
|
] }),
|
|
1909
|
-
/* @__PURE__ */
|
|
1910
|
-
/* @__PURE__ */
|
|
1911
|
-
/* @__PURE__ */
|
|
2487
|
+
/* @__PURE__ */ r.jsxs("mesh", { position: [0, M + 0.04, v / 2], children: [
|
|
2488
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: [y * 0.95, 0.08, v * 0.9] }),
|
|
2489
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: l.cabColor, roughness: 0.4, metalness: 0.3 })
|
|
1912
2490
|
] }),
|
|
1913
|
-
/* @__PURE__ */
|
|
1914
|
-
/* @__PURE__ */
|
|
1915
|
-
/* @__PURE__ */
|
|
2491
|
+
/* @__PURE__ */ r.jsxs("mesh", { position: [0, M + 0.25, v * 0.1], rotation: [-0.3, 0, 0], children: [
|
|
2492
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: [y * 0.9, 0.04, v * 0.5] }),
|
|
2493
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: l.cabColor, roughness: 0.4, metalness: 0.3 })
|
|
1916
2494
|
] }),
|
|
1917
|
-
/* @__PURE__ */
|
|
1918
|
-
/* @__PURE__ */
|
|
1919
|
-
/* @__PURE__ */
|
|
2495
|
+
/* @__PURE__ */ r.jsxs("mesh", { position: [-y * 0.35, M * 0.2, v + 0.02], children: [
|
|
2496
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: [y * 0.15, 0.08, 0.02] }),
|
|
2497
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: "#ffffcc", emissive: "#ffffaa", emissiveIntensity: 0.3 })
|
|
1920
2498
|
] }),
|
|
1921
|
-
/* @__PURE__ */
|
|
1922
|
-
/* @__PURE__ */
|
|
1923
|
-
/* @__PURE__ */
|
|
2499
|
+
/* @__PURE__ */ r.jsxs("mesh", { position: [y * 0.35, M * 0.2, v + 0.02], children: [
|
|
2500
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: [y * 0.15, 0.08, 0.02] }),
|
|
2501
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: "#ffffcc", emissive: "#ffffaa", emissiveIntensity: 0.3 })
|
|
1924
2502
|
] }),
|
|
1925
|
-
/* @__PURE__ */
|
|
1926
|
-
/* @__PURE__ */
|
|
1927
|
-
/* @__PURE__ */
|
|
2503
|
+
/* @__PURE__ */ r.jsxs("mesh", { position: [0, 0.06, v + 0.04], castShadow: !0, children: [
|
|
2504
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: [y * 1.02, 0.12, 0.06] }),
|
|
2505
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: l.chassisColor, roughness: 0.5, metalness: 0.6 })
|
|
1928
2506
|
] })
|
|
1929
2507
|
] }),
|
|
1930
|
-
[-1, 1].map((G) => /* @__PURE__ */
|
|
2508
|
+
[-1, 1].map((G) => /* @__PURE__ */ r.jsxs(
|
|
1931
2509
|
"mesh",
|
|
1932
2510
|
{
|
|
1933
2511
|
position: [
|
|
1934
|
-
G === -1 ? -
|
|
1935
|
-
|
|
1936
|
-
|
|
2512
|
+
G === -1 ? -x - b * 0.5 : g + x + b * 0.5,
|
|
2513
|
+
S + d * 0.6,
|
|
2514
|
+
m * 0.17
|
|
1937
2515
|
],
|
|
1938
2516
|
castShadow: !0,
|
|
1939
2517
|
children: [
|
|
1940
|
-
/* @__PURE__ */
|
|
1941
|
-
/* @__PURE__ */
|
|
2518
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: [b + 0.04, 0.04, d * 2.5] }),
|
|
2519
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: l.chassisColor, roughness: 0.6, metalness: 0.4 })
|
|
1942
2520
|
]
|
|
1943
2521
|
},
|
|
1944
2522
|
`fender-rear-${G}`
|
|
1945
2523
|
)),
|
|
1946
|
-
/* @__PURE__ */
|
|
1947
|
-
/* @__PURE__ */
|
|
1948
|
-
/* @__PURE__ */
|
|
2524
|
+
/* @__PURE__ */ r.jsxs("mesh", { position: [-x / 2 + 0.01, z + w * 0.3, -0.01], children: [
|
|
2525
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: [0.08, 0.12, 0.02] }),
|
|
2526
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: "#ff3333", emissive: "#ff0000", emissiveIntensity: 0.3 })
|
|
1949
2527
|
] }),
|
|
1950
|
-
/* @__PURE__ */
|
|
1951
|
-
/* @__PURE__ */
|
|
1952
|
-
/* @__PURE__ */
|
|
2528
|
+
/* @__PURE__ */ r.jsxs("mesh", { position: [g + x / 2 - 0.01, z + w * 0.3, -0.01], children: [
|
|
2529
|
+
/* @__PURE__ */ r.jsx("boxGeometry", { args: [0.08, 0.12, 0.02] }),
|
|
2530
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: "#ff3333", emissive: "#ff0000", emissiveIntensity: 0.3 })
|
|
1953
2531
|
] }),
|
|
1954
|
-
/* @__PURE__ */
|
|
1955
|
-
/* @__PURE__ */
|
|
2532
|
+
/* @__PURE__ */ r.jsx("ambientLight", { intensity: 0.45 }),
|
|
2533
|
+
/* @__PURE__ */ r.jsx(
|
|
1956
2534
|
"directionalLight",
|
|
1957
2535
|
{
|
|
1958
|
-
position: [
|
|
2536
|
+
position: [g / 2, z + w * 1.5, m * 0.8],
|
|
1959
2537
|
intensity: 0.75,
|
|
1960
2538
|
castShadow: !0,
|
|
1961
2539
|
"shadow-mapSize-width": 1024,
|
|
1962
2540
|
"shadow-mapSize-height": 1024
|
|
1963
2541
|
}
|
|
1964
2542
|
),
|
|
1965
|
-
/* @__PURE__ */
|
|
1966
|
-
/* @__PURE__ */
|
|
1967
|
-
/* @__PURE__ */
|
|
2543
|
+
/* @__PURE__ */ r.jsx("pointLight", { position: [g / 2, z + w * 0.7, m / 2], intensity: 0.35 }),
|
|
2544
|
+
/* @__PURE__ */ r.jsx("pointLight", { position: [g / 2, z + w * 0.9, m * 0.3], intensity: 0.25 }),
|
|
2545
|
+
/* @__PURE__ */ r.jsx("group", { position: [0, z, 0], children: a })
|
|
1968
2546
|
] });
|
|
1969
2547
|
});
|
|
1970
|
-
function
|
|
2548
|
+
function Tt(i, e, t) {
|
|
1971
2549
|
if (!t)
|
|
1972
2550
|
return {
|
|
1973
2551
|
perspective: [3, 3, 3],
|
|
@@ -1975,58 +2553,58 @@ function Rt(o, e, t) {
|
|
|
1975
2553
|
top: [0, 5, 0],
|
|
1976
2554
|
front: [0, 1.5, 5],
|
|
1977
2555
|
side: [5, 1.5, 0]
|
|
1978
|
-
}[
|
|
1979
|
-
const { width:
|
|
1980
|
-
switch (
|
|
2556
|
+
}[i];
|
|
2557
|
+
const { width: o, height: s, depth: n } = t, [a, c, l] = e, h = Math.sqrt(o ** 2 + s ** 2 + n ** 2) * 3;
|
|
2558
|
+
switch (i) {
|
|
1981
2559
|
case "perspective":
|
|
1982
2560
|
return [
|
|
1983
|
-
a +
|
|
1984
|
-
|
|
1985
|
-
|
|
2561
|
+
a + h * 0.6,
|
|
2562
|
+
c + h * 0.5,
|
|
2563
|
+
l + h * 0.6
|
|
1986
2564
|
];
|
|
1987
2565
|
case "isometric":
|
|
1988
2566
|
return [
|
|
1989
|
-
a +
|
|
1990
|
-
|
|
1991
|
-
|
|
2567
|
+
a + h * 0.577,
|
|
2568
|
+
c + h * 0.577,
|
|
2569
|
+
l + h * 0.577
|
|
1992
2570
|
];
|
|
1993
2571
|
case "top":
|
|
1994
|
-
return [a,
|
|
2572
|
+
return [a, c + Math.max(h, s * 2), l];
|
|
1995
2573
|
case "front":
|
|
1996
|
-
return [a,
|
|
2574
|
+
return [a, c + s * 0.5, l + Math.max(h, n * 1.5)];
|
|
1997
2575
|
case "side":
|
|
1998
|
-
return [a + Math.max(
|
|
2576
|
+
return [a + Math.max(h, o * 1.5), c + s * 0.5, l];
|
|
1999
2577
|
}
|
|
2000
2578
|
}
|
|
2001
|
-
const
|
|
2579
|
+
const Se = V(function({
|
|
2002
2580
|
preset: e = "perspective",
|
|
2003
2581
|
autoRotate: t = !1,
|
|
2004
|
-
enablePan:
|
|
2005
|
-
enableZoom:
|
|
2006
|
-
target:
|
|
2582
|
+
enablePan: o = !0,
|
|
2583
|
+
enableZoom: s = !0,
|
|
2584
|
+
target: n = [0, 0, 0],
|
|
2007
2585
|
minDistance: a = 0.5,
|
|
2008
|
-
maxDistance:
|
|
2009
|
-
sceneSize:
|
|
2586
|
+
maxDistance: c = 50,
|
|
2587
|
+
sceneSize: l
|
|
2010
2588
|
}) {
|
|
2011
|
-
const { camera:
|
|
2589
|
+
const { camera: f } = Ae(), h = _e(null);
|
|
2012
2590
|
return fe(() => {
|
|
2013
|
-
const
|
|
2014
|
-
const
|
|
2015
|
-
|
|
2591
|
+
const g = Tt(e, n, l), w = new B.Vector3(g[0], g[1], g[2]), m = new B.Vector3(...n), x = f.position.clone(), u = 1e3, d = Date.now(), b = () => {
|
|
2592
|
+
const j = Date.now() - d, E = Math.min(j / u, 1), S = 1 - Math.pow(1 - E, 3);
|
|
2593
|
+
f.position.lerpVectors(x, w, S), h.current && (h.current.target.lerp(m, S), h.current.update()), E < 1 && requestAnimationFrame(b);
|
|
2016
2594
|
};
|
|
2017
|
-
|
|
2018
|
-
}, [e,
|
|
2019
|
-
|
|
2595
|
+
b();
|
|
2596
|
+
}, [e, l, f, n]), /* @__PURE__ */ r.jsx(
|
|
2597
|
+
Ze,
|
|
2020
2598
|
{
|
|
2021
|
-
ref:
|
|
2022
|
-
target:
|
|
2599
|
+
ref: h,
|
|
2600
|
+
target: n,
|
|
2023
2601
|
autoRotate: t,
|
|
2024
2602
|
autoRotateSpeed: 0.5,
|
|
2025
|
-
enablePan:
|
|
2026
|
-
enableZoom:
|
|
2603
|
+
enablePan: o,
|
|
2604
|
+
enableZoom: s,
|
|
2027
2605
|
enableRotate: !0,
|
|
2028
2606
|
minDistance: a,
|
|
2029
|
-
maxDistance:
|
|
2607
|
+
maxDistance: c,
|
|
2030
2608
|
enableDamping: !0,
|
|
2031
2609
|
dampingFactor: 0.05,
|
|
2032
2610
|
rotateSpeed: 0.5,
|
|
@@ -2035,7 +2613,7 @@ const je = V(function({
|
|
|
2035
2613
|
makeDefault: !0
|
|
2036
2614
|
}
|
|
2037
2615
|
);
|
|
2038
|
-
}),
|
|
2616
|
+
}), Et = {
|
|
2039
2617
|
perspective: { label: "Perspectiva", icon: "📐" },
|
|
2040
2618
|
isometric: { label: "Isométrica", icon: "🔲" },
|
|
2041
2619
|
top: { label: "Superior", icon: "⬇️" },
|
|
@@ -2045,58 +2623,58 @@ const je = V(function({
|
|
|
2045
2623
|
V(function({
|
|
2046
2624
|
currentPreset: e,
|
|
2047
2625
|
onPresetChange: t,
|
|
2048
|
-
position:
|
|
2626
|
+
position: o = "top-right"
|
|
2049
2627
|
}) {
|
|
2050
|
-
const
|
|
2051
|
-
return /* @__PURE__ */
|
|
2052
|
-
/* @__PURE__ */
|
|
2053
|
-
/* @__PURE__ */
|
|
2054
|
-
const { label: a, icon:
|
|
2055
|
-
return /* @__PURE__ */
|
|
2628
|
+
const s = ["perspective", "isometric", "top", "front", "side"];
|
|
2629
|
+
return /* @__PURE__ */ r.jsxs("div", { className: `view-controls view-controls--${o}`, children: [
|
|
2630
|
+
/* @__PURE__ */ r.jsx("div", { className: "view-controls__title", children: "Vista" }),
|
|
2631
|
+
/* @__PURE__ */ r.jsx("div", { className: "view-controls__buttons", children: s.map((n) => {
|
|
2632
|
+
const { label: a, icon: c } = Et[n], l = e === n;
|
|
2633
|
+
return /* @__PURE__ */ r.jsxs(
|
|
2056
2634
|
"button",
|
|
2057
2635
|
{
|
|
2058
|
-
className: `view-controls__button ${
|
|
2059
|
-
onClick: () => t(
|
|
2636
|
+
className: `view-controls__button ${l ? "view-controls__button--active" : ""}`,
|
|
2637
|
+
onClick: () => t(n),
|
|
2060
2638
|
title: a,
|
|
2061
2639
|
"aria-label": a,
|
|
2062
2640
|
children: [
|
|
2063
|
-
/* @__PURE__ */
|
|
2064
|
-
/* @__PURE__ */
|
|
2641
|
+
/* @__PURE__ */ r.jsx("span", { className: "view-controls__icon", role: "img", "aria-hidden": "true", children: c }),
|
|
2642
|
+
/* @__PURE__ */ r.jsx("span", { className: "view-controls__label", children: a })
|
|
2065
2643
|
]
|
|
2066
2644
|
},
|
|
2067
|
-
|
|
2645
|
+
n
|
|
2068
2646
|
);
|
|
2069
2647
|
}) })
|
|
2070
2648
|
] });
|
|
2071
2649
|
});
|
|
2072
|
-
const
|
|
2650
|
+
const je = V(function({
|
|
2073
2651
|
sceneWidth: e,
|
|
2074
2652
|
sceneDepth: t,
|
|
2075
|
-
sceneType:
|
|
2076
|
-
floorPolygon:
|
|
2077
|
-
cameraPosition:
|
|
2653
|
+
sceneType: o,
|
|
2654
|
+
floorPolygon: s,
|
|
2655
|
+
cameraPosition: n,
|
|
2078
2656
|
targetPosition: a,
|
|
2079
|
-
position:
|
|
2657
|
+
position: c = "bottom-left"
|
|
2080
2658
|
}) {
|
|
2081
|
-
const
|
|
2082
|
-
x: 10 +
|
|
2083
|
-
y: 10 +
|
|
2084
|
-
}),
|
|
2085
|
-
const
|
|
2086
|
-
return `${
|
|
2087
|
-
}).join(" L ")} Z`, [
|
|
2088
|
-
if (
|
|
2089
|
-
const
|
|
2659
|
+
const h = k(() => 130 / Math.max(e, t), [e, t]), g = (d, b) => ({
|
|
2660
|
+
x: 10 + d * h,
|
|
2661
|
+
y: 10 + b * h
|
|
2662
|
+
}), w = k(() => o !== "warehouse" || !s || s.length === 0 ? "" : `M ${s.map((b) => {
|
|
2663
|
+
const j = g(b.x, b.z);
|
|
2664
|
+
return `${j.x},${j.y}`;
|
|
2665
|
+
}).join(" L ")} Z`, [o, s, h]), m = k(() => {
|
|
2666
|
+
if (o !== "truck") return null;
|
|
2667
|
+
const d = g(0, 0);
|
|
2090
2668
|
return {
|
|
2091
|
-
x:
|
|
2092
|
-
y:
|
|
2093
|
-
width: e *
|
|
2094
|
-
height: t *
|
|
2669
|
+
x: d.x,
|
|
2670
|
+
y: d.y,
|
|
2671
|
+
width: e * h,
|
|
2672
|
+
height: t * h
|
|
2095
2673
|
};
|
|
2096
|
-
}, [
|
|
2097
|
-
return /* @__PURE__ */
|
|
2098
|
-
/* @__PURE__ */
|
|
2099
|
-
/* @__PURE__ */
|
|
2674
|
+
}, [o, e, t, h]), x = n ? g(n.x, n.z) : null, u = a ? g(a.x, a.z) : null;
|
|
2675
|
+
return /* @__PURE__ */ r.jsxs("div", { className: `minimap minimap--${c}`, children: [
|
|
2676
|
+
/* @__PURE__ */ r.jsx("div", { className: "minimap__title", children: "Mapa" }),
|
|
2677
|
+
/* @__PURE__ */ r.jsxs(
|
|
2100
2678
|
"svg",
|
|
2101
2679
|
{
|
|
2102
2680
|
className: "minimap__canvas",
|
|
@@ -2105,31 +2683,31 @@ const Se = V(function({
|
|
|
2105
2683
|
viewBox: "0 0 150 150",
|
|
2106
2684
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2107
2685
|
children: [
|
|
2108
|
-
/* @__PURE__ */
|
|
2109
|
-
|
|
2110
|
-
|
|
2686
|
+
/* @__PURE__ */ r.jsx("rect", { width: 150, height: 150, fill: "#1a1a2e" }),
|
|
2687
|
+
o === "warehouse" && w && /* @__PURE__ */ r.jsx("path", { d: w, fill: "rgba(96, 165, 250, 0.15)", stroke: "#60a5fa", strokeWidth: "2" }),
|
|
2688
|
+
o === "truck" && m && /* @__PURE__ */ r.jsx(
|
|
2111
2689
|
"rect",
|
|
2112
2690
|
{
|
|
2113
|
-
x:
|
|
2114
|
-
y:
|
|
2115
|
-
width:
|
|
2116
|
-
height:
|
|
2691
|
+
x: m.x,
|
|
2692
|
+
y: m.y,
|
|
2693
|
+
width: m.width,
|
|
2694
|
+
height: m.height,
|
|
2117
2695
|
fill: "rgba(96, 165, 250, 0.15)",
|
|
2118
2696
|
stroke: "#60a5fa",
|
|
2119
2697
|
strokeWidth: "2"
|
|
2120
2698
|
}
|
|
2121
2699
|
),
|
|
2122
|
-
/* @__PURE__ */
|
|
2700
|
+
/* @__PURE__ */ r.jsx("defs", { children: /* @__PURE__ */ r.jsx(
|
|
2123
2701
|
"pattern",
|
|
2124
2702
|
{
|
|
2125
2703
|
id: "minimap-grid",
|
|
2126
|
-
width:
|
|
2127
|
-
height:
|
|
2704
|
+
width: h,
|
|
2705
|
+
height: h,
|
|
2128
2706
|
patternUnits: "userSpaceOnUse",
|
|
2129
|
-
children: /* @__PURE__ */
|
|
2707
|
+
children: /* @__PURE__ */ r.jsx(
|
|
2130
2708
|
"path",
|
|
2131
2709
|
{
|
|
2132
|
-
d: `M ${
|
|
2710
|
+
d: `M ${h} 0 L 0 0 0 ${h}`,
|
|
2133
2711
|
fill: "none",
|
|
2134
2712
|
stroke: "rgba(255, 255, 255, 0.08)",
|
|
2135
2713
|
strokeWidth: "0.5"
|
|
@@ -2137,29 +2715,29 @@ const Se = V(function({
|
|
|
2137
2715
|
)
|
|
2138
2716
|
}
|
|
2139
2717
|
) }),
|
|
2140
|
-
|
|
2718
|
+
o === "truck" && m && /* @__PURE__ */ r.jsx(
|
|
2141
2719
|
"rect",
|
|
2142
2720
|
{
|
|
2143
|
-
x:
|
|
2144
|
-
y:
|
|
2145
|
-
width:
|
|
2146
|
-
height:
|
|
2721
|
+
x: m.x,
|
|
2722
|
+
y: m.y,
|
|
2723
|
+
width: m.width,
|
|
2724
|
+
height: m.height,
|
|
2147
2725
|
fill: "url(#minimap-grid)"
|
|
2148
2726
|
}
|
|
2149
2727
|
),
|
|
2150
|
-
|
|
2151
|
-
/* @__PURE__ */
|
|
2152
|
-
/* @__PURE__ */
|
|
2728
|
+
u && /* @__PURE__ */ r.jsxs("g", { children: [
|
|
2729
|
+
/* @__PURE__ */ r.jsx("circle", { cx: u.x, cy: u.y, r: "3", fill: "#f87171", opacity: "0.6" }),
|
|
2730
|
+
/* @__PURE__ */ r.jsx("circle", { cx: u.x, cy: u.y, r: "5", fill: "none", stroke: "#f87171", strokeWidth: "1.5" })
|
|
2153
2731
|
] }),
|
|
2154
|
-
|
|
2155
|
-
/* @__PURE__ */
|
|
2156
|
-
|
|
2732
|
+
x && /* @__PURE__ */ r.jsxs("g", { children: [
|
|
2733
|
+
/* @__PURE__ */ r.jsx("circle", { cx: x.x, cy: x.y, r: "4", fill: "#60a5fa" }),
|
|
2734
|
+
u && /* @__PURE__ */ r.jsx(
|
|
2157
2735
|
"line",
|
|
2158
2736
|
{
|
|
2159
|
-
x1:
|
|
2160
|
-
y1:
|
|
2161
|
-
x2:
|
|
2162
|
-
y2:
|
|
2737
|
+
x1: x.x,
|
|
2738
|
+
y1: x.y,
|
|
2739
|
+
x2: u.x,
|
|
2740
|
+
y2: u.y,
|
|
2163
2741
|
stroke: "#60a5fa",
|
|
2164
2742
|
strokeWidth: "1",
|
|
2165
2743
|
strokeDasharray: "2,2",
|
|
@@ -2170,103 +2748,103 @@ const Se = V(function({
|
|
|
2170
2748
|
]
|
|
2171
2749
|
}
|
|
2172
2750
|
),
|
|
2173
|
-
/* @__PURE__ */
|
|
2174
|
-
/* @__PURE__ */
|
|
2175
|
-
/* @__PURE__ */
|
|
2176
|
-
/* @__PURE__ */
|
|
2751
|
+
/* @__PURE__ */ r.jsxs("div", { className: "minimap__legend", children: [
|
|
2752
|
+
/* @__PURE__ */ r.jsxs("div", { className: "minimap__legend-item", children: [
|
|
2753
|
+
/* @__PURE__ */ r.jsx("span", { className: "minimap__legend-dot minimap__legend-dot--camera" }),
|
|
2754
|
+
/* @__PURE__ */ r.jsx("span", { className: "minimap__legend-text", children: "Cámara" })
|
|
2177
2755
|
] }),
|
|
2178
|
-
/* @__PURE__ */
|
|
2179
|
-
/* @__PURE__ */
|
|
2180
|
-
/* @__PURE__ */
|
|
2756
|
+
/* @__PURE__ */ r.jsxs("div", { className: "minimap__legend-item", children: [
|
|
2757
|
+
/* @__PURE__ */ r.jsx("span", { className: "minimap__legend-dot minimap__legend-dot--target" }),
|
|
2758
|
+
/* @__PURE__ */ r.jsx("span", { className: "minimap__legend-text", children: "Objetivo" })
|
|
2181
2759
|
] })
|
|
2182
2760
|
] })
|
|
2183
2761
|
] });
|
|
2184
2762
|
});
|
|
2185
|
-
function
|
|
2186
|
-
const { camera:
|
|
2187
|
-
x:
|
|
2188
|
-
y:
|
|
2189
|
-
z:
|
|
2763
|
+
function _t() {
|
|
2764
|
+
const { camera: i } = Ae(), [e, t] = ae({
|
|
2765
|
+
x: i.position.x,
|
|
2766
|
+
y: i.position.y,
|
|
2767
|
+
z: i.position.z
|
|
2190
2768
|
});
|
|
2191
2769
|
return fe(() => {
|
|
2192
|
-
let
|
|
2193
|
-
const
|
|
2770
|
+
let o;
|
|
2771
|
+
const s = () => {
|
|
2194
2772
|
t({
|
|
2195
|
-
x:
|
|
2196
|
-
y:
|
|
2197
|
-
z:
|
|
2198
|
-
}),
|
|
2773
|
+
x: i.position.x,
|
|
2774
|
+
y: i.position.y,
|
|
2775
|
+
z: i.position.z
|
|
2776
|
+
}), o = requestAnimationFrame(s);
|
|
2199
2777
|
};
|
|
2200
|
-
return
|
|
2201
|
-
|
|
2778
|
+
return o = requestAnimationFrame(s), () => {
|
|
2779
|
+
o && cancelAnimationFrame(o);
|
|
2202
2780
|
};
|
|
2203
|
-
}, [
|
|
2781
|
+
}, [i]), e;
|
|
2204
2782
|
}
|
|
2205
|
-
function
|
|
2206
|
-
const e =
|
|
2783
|
+
function Me({ onPositionChange: i }) {
|
|
2784
|
+
const e = _t();
|
|
2207
2785
|
return fe(() => {
|
|
2208
|
-
|
|
2209
|
-
}, [e,
|
|
2786
|
+
i(e);
|
|
2787
|
+
}, [e, i]), null;
|
|
2210
2788
|
}
|
|
2211
2789
|
const Yt = V(function({
|
|
2212
2790
|
stackedPallet: e,
|
|
2213
2791
|
preset: t,
|
|
2214
|
-
selectedBoxId:
|
|
2215
|
-
highlightedBoxId:
|
|
2216
|
-
selectedColor:
|
|
2792
|
+
selectedBoxId: o,
|
|
2793
|
+
highlightedBoxId: s,
|
|
2794
|
+
selectedColor: n,
|
|
2217
2795
|
highlightedColor: a,
|
|
2218
|
-
showLabels:
|
|
2219
|
-
cameraPreset:
|
|
2220
|
-
showGrid:
|
|
2221
|
-
showMiniMap:
|
|
2222
|
-
onBoxClick:
|
|
2223
|
-
onBoxHover:
|
|
2224
|
-
children:
|
|
2225
|
-
style:
|
|
2796
|
+
showLabels: c = !1,
|
|
2797
|
+
cameraPreset: l = "perspective",
|
|
2798
|
+
showGrid: f = !0,
|
|
2799
|
+
showMiniMap: h = !1,
|
|
2800
|
+
onBoxClick: g,
|
|
2801
|
+
onBoxHover: w,
|
|
2802
|
+
children: m,
|
|
2803
|
+
style: x
|
|
2226
2804
|
}) {
|
|
2227
|
-
const
|
|
2228
|
-
|
|
2229
|
-
}, []),
|
|
2230
|
-
width:
|
|
2231
|
-
height: le(e) *
|
|
2232
|
-
depth:
|
|
2233
|
-
} : { width: 1.2, height: 1, depth: 0.8 }, [
|
|
2234
|
-
const
|
|
2235
|
-
return [
|
|
2236
|
-
}, [
|
|
2237
|
-
const
|
|
2238
|
-
|
|
2805
|
+
const u = U.MM_TO_M, d = e.floors[0]?.pallet, [b, j] = ae({ x: 0, z: 0 }), E = q((v) => {
|
|
2806
|
+
j({ x: v.x, z: v.z });
|
|
2807
|
+
}, []), S = k(() => d ? {
|
|
2808
|
+
width: d.dimensions.width * u,
|
|
2809
|
+
height: le(e) * u,
|
|
2810
|
+
depth: d.dimensions.depth * u
|
|
2811
|
+
} : { width: 1.2, height: 1, depth: 0.8 }, [d, e, u]), C = k(() => {
|
|
2812
|
+
const v = d ? d.dimensions.width * u / 2 : 0, M = d ? d.dimensions.depth * u / 2 : 0, _ = S.height / 2;
|
|
2813
|
+
return [v, _, M];
|
|
2814
|
+
}, [d, u, S.height]), z = k(() => {
|
|
2815
|
+
const M = Math.sqrt(
|
|
2816
|
+
S.width ** 2 + S.height ** 2 + S.depth ** 2
|
|
2239
2817
|
) * 3.5;
|
|
2240
2818
|
return [
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2819
|
+
C[0] + M * 0.7,
|
|
2820
|
+
C[1] + M * 0.6,
|
|
2821
|
+
C[2] + M * 0.7
|
|
2244
2822
|
];
|
|
2245
|
-
}, [
|
|
2246
|
-
if (!
|
|
2247
|
-
const
|
|
2248
|
-
for (let A = 0; A <=
|
|
2249
|
-
|
|
2250
|
-
for (let A = 0; A <=
|
|
2251
|
-
|
|
2252
|
-
const
|
|
2253
|
-
return
|
|
2254
|
-
}, [
|
|
2255
|
-
return /* @__PURE__ */
|
|
2256
|
-
/* @__PURE__ */
|
|
2823
|
+
}, [C, S]), y = k(() => {
|
|
2824
|
+
if (!f || !d) return null;
|
|
2825
|
+
const v = d.dimensions.width * u, M = d.dimensions.depth * u, _ = 0.2, T = 1e-3, I = [];
|
|
2826
|
+
for (let A = 0; A <= v; A += _)
|
|
2827
|
+
I.push(A, T, 0, A, T, M);
|
|
2828
|
+
for (let A = 0; A <= M; A += _)
|
|
2829
|
+
I.push(0, T, A, v, T, A);
|
|
2830
|
+
const R = new B.BufferGeometry();
|
|
2831
|
+
return R.setAttribute("position", new B.Float32BufferAttribute(I, 3)), R;
|
|
2832
|
+
}, [f, d, u]);
|
|
2833
|
+
return /* @__PURE__ */ r.jsxs("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
|
|
2834
|
+
/* @__PURE__ */ r.jsx(
|
|
2257
2835
|
pe,
|
|
2258
2836
|
{
|
|
2259
2837
|
shadows: !0,
|
|
2260
2838
|
camera: {
|
|
2261
|
-
position:
|
|
2839
|
+
position: z,
|
|
2262
2840
|
fov: 45,
|
|
2263
2841
|
near: 0.01,
|
|
2264
2842
|
far: 100
|
|
2265
2843
|
},
|
|
2266
|
-
style: { width: "100%", height: "100%", ...
|
|
2267
|
-
children: /* @__PURE__ */
|
|
2268
|
-
/* @__PURE__ */
|
|
2269
|
-
/* @__PURE__ */
|
|
2844
|
+
style: { width: "100%", height: "100%", ...x },
|
|
2845
|
+
children: /* @__PURE__ */ r.jsxs(we, { preset: t, children: [
|
|
2846
|
+
/* @__PURE__ */ r.jsx("ambientLight", { intensity: 0.4 }),
|
|
2847
|
+
/* @__PURE__ */ r.jsx(
|
|
2270
2848
|
"directionalLight",
|
|
2271
2849
|
{
|
|
2272
2850
|
position: [5, 8, 5],
|
|
@@ -2276,26 +2854,26 @@ const Yt = V(function({
|
|
|
2276
2854
|
"shadow-mapSize-height": 1024
|
|
2277
2855
|
}
|
|
2278
2856
|
),
|
|
2279
|
-
/* @__PURE__ */
|
|
2280
|
-
/* @__PURE__ */
|
|
2281
|
-
|
|
2857
|
+
/* @__PURE__ */ r.jsx("hemisphereLight", { intensity: 0.3, color: "#ffffff", groundColor: "#444444" }),
|
|
2858
|
+
/* @__PURE__ */ r.jsx(
|
|
2859
|
+
Se,
|
|
2282
2860
|
{
|
|
2283
|
-
preset:
|
|
2284
|
-
target:
|
|
2285
|
-
sceneSize:
|
|
2861
|
+
preset: l,
|
|
2862
|
+
target: C,
|
|
2863
|
+
sceneSize: S,
|
|
2286
2864
|
minDistance: 0.3,
|
|
2287
|
-
maxDistance: Math.max(
|
|
2865
|
+
maxDistance: Math.max(S.width, S.height, S.depth) * 4
|
|
2288
2866
|
}
|
|
2289
2867
|
),
|
|
2290
|
-
/* @__PURE__ */
|
|
2291
|
-
/* @__PURE__ */
|
|
2292
|
-
/* @__PURE__ */
|
|
2293
|
-
|
|
2294
|
-
|
|
2868
|
+
/* @__PURE__ */ r.jsx(Me, { onPositionChange: E }),
|
|
2869
|
+
/* @__PURE__ */ r.jsxs("mesh", { rotation: [-Math.PI / 2, 0, 0], position: [C[0], -2e-3, C[2]], receiveShadow: !0, children: [
|
|
2870
|
+
/* @__PURE__ */ r.jsx("planeGeometry", { args: [
|
|
2871
|
+
d ? d.dimensions.width * u * 1.5 : 3,
|
|
2872
|
+
d ? d.dimensions.depth * u * 1.5 : 3
|
|
2295
2873
|
] }),
|
|
2296
|
-
/* @__PURE__ */
|
|
2874
|
+
/* @__PURE__ */ r.jsx("meshStandardMaterial", { color: "#e0e0e0", roughness: 0.9 })
|
|
2297
2875
|
] }),
|
|
2298
|
-
|
|
2876
|
+
f && y && /* @__PURE__ */ r.jsx("lineSegments", { geometry: y, children: /* @__PURE__ */ r.jsx(
|
|
2299
2877
|
"lineBasicMaterial",
|
|
2300
2878
|
{
|
|
2301
2879
|
color: "#aaaaaa",
|
|
@@ -2304,308 +2882,308 @@ const Yt = V(function({
|
|
|
2304
2882
|
depthWrite: !1
|
|
2305
2883
|
}
|
|
2306
2884
|
) }),
|
|
2307
|
-
/* @__PURE__ */
|
|
2885
|
+
/* @__PURE__ */ r.jsx(
|
|
2308
2886
|
be,
|
|
2309
2887
|
{
|
|
2310
2888
|
stackedPallet: e,
|
|
2311
|
-
selectedBoxId:
|
|
2312
|
-
highlightedBoxId:
|
|
2313
|
-
selectedColor:
|
|
2889
|
+
selectedBoxId: o,
|
|
2890
|
+
highlightedBoxId: s,
|
|
2891
|
+
selectedColor: n,
|
|
2314
2892
|
highlightedColor: a,
|
|
2315
|
-
showLabels:
|
|
2316
|
-
onBoxClick:
|
|
2317
|
-
onBoxHover:
|
|
2893
|
+
showLabels: c,
|
|
2894
|
+
onBoxClick: g,
|
|
2895
|
+
onBoxHover: w
|
|
2318
2896
|
}
|
|
2319
2897
|
),
|
|
2320
|
-
|
|
2898
|
+
m
|
|
2321
2899
|
] })
|
|
2322
2900
|
}
|
|
2323
2901
|
),
|
|
2324
|
-
|
|
2325
|
-
|
|
2902
|
+
h && d && /* @__PURE__ */ r.jsx(
|
|
2903
|
+
je,
|
|
2326
2904
|
{
|
|
2327
|
-
sceneWidth:
|
|
2328
|
-
sceneDepth:
|
|
2905
|
+
sceneWidth: S.width,
|
|
2906
|
+
sceneDepth: S.depth,
|
|
2329
2907
|
sceneType: "truck",
|
|
2330
|
-
cameraPosition:
|
|
2331
|
-
targetPosition: { x:
|
|
2908
|
+
cameraPosition: b,
|
|
2909
|
+
targetPosition: { x: C[0], z: C[2] },
|
|
2332
2910
|
position: "bottom-left"
|
|
2333
2911
|
}
|
|
2334
2912
|
)
|
|
2335
2913
|
] });
|
|
2336
|
-
}),
|
|
2914
|
+
}), Ft = V(function({
|
|
2337
2915
|
truck: e,
|
|
2338
2916
|
preset: t,
|
|
2339
|
-
selectedBoxId:
|
|
2340
|
-
highlightedBoxId:
|
|
2341
|
-
selectedColor:
|
|
2917
|
+
selectedBoxId: o,
|
|
2918
|
+
highlightedBoxId: s,
|
|
2919
|
+
selectedColor: n,
|
|
2342
2920
|
highlightedColor: a,
|
|
2343
|
-
showLabels:
|
|
2344
|
-
showGrid:
|
|
2345
|
-
wallOpacity:
|
|
2346
|
-
showRoof:
|
|
2347
|
-
showSideWalls:
|
|
2348
|
-
cameraPreset:
|
|
2349
|
-
showMiniMap:
|
|
2350
|
-
onBoxClick:
|
|
2351
|
-
onBoxHover:
|
|
2352
|
-
children:
|
|
2353
|
-
style:
|
|
2921
|
+
showLabels: c = !1,
|
|
2922
|
+
showGrid: l,
|
|
2923
|
+
wallOpacity: f = 0.3,
|
|
2924
|
+
showRoof: h = !1,
|
|
2925
|
+
showSideWalls: g = !0,
|
|
2926
|
+
cameraPreset: w = "perspective",
|
|
2927
|
+
showMiniMap: m = !1,
|
|
2928
|
+
onBoxClick: x,
|
|
2929
|
+
onBoxHover: u,
|
|
2930
|
+
children: d,
|
|
2931
|
+
style: b
|
|
2354
2932
|
}) {
|
|
2355
|
-
const [
|
|
2356
|
-
|
|
2357
|
-
}, []),
|
|
2358
|
-
() => [
|
|
2359
|
-
[
|
|
2360
|
-
),
|
|
2361
|
-
() => ({ width:
|
|
2362
|
-
[
|
|
2363
|
-
),
|
|
2364
|
-
const A =
|
|
2933
|
+
const [j, E] = ae({ x: 0, z: 0 }), S = q((R) => {
|
|
2934
|
+
E({ x: R.x, z: R.z });
|
|
2935
|
+
}, []), C = U.MM_TO_M, z = e.dimensions.width * C, y = e.dimensions.height * C, v = e.dimensions.depth * C, M = k(
|
|
2936
|
+
() => [z / 2, y / 2, v / 2],
|
|
2937
|
+
[z, y, v]
|
|
2938
|
+
), _ = k(
|
|
2939
|
+
() => ({ width: z, height: y, depth: v }),
|
|
2940
|
+
[z, y, v]
|
|
2941
|
+
), T = k(() => [z * 0.8, y * 1.2, v * 0.4], [z, y, v]), I = k(() => e.pallets.filter((R) => {
|
|
2942
|
+
const A = ot(R, e);
|
|
2365
2943
|
return A.isValid ? !0 : (console.error(
|
|
2366
|
-
`[TruckScene] Palet "${
|
|
2944
|
+
`[TruckScene] Palet "${R.id}" fuera de los límites del camión.`,
|
|
2367
2945
|
"Violaciones:",
|
|
2368
2946
|
A.violations
|
|
2369
2947
|
), !1);
|
|
2370
2948
|
}), [e]);
|
|
2371
|
-
return /* @__PURE__ */
|
|
2372
|
-
/* @__PURE__ */
|
|
2949
|
+
return /* @__PURE__ */ r.jsxs("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
|
|
2950
|
+
/* @__PURE__ */ r.jsx(
|
|
2373
2951
|
pe,
|
|
2374
2952
|
{
|
|
2375
2953
|
shadows: !0,
|
|
2376
2954
|
camera: {
|
|
2377
|
-
position:
|
|
2955
|
+
position: T,
|
|
2378
2956
|
fov: 45,
|
|
2379
2957
|
near: 0.01,
|
|
2380
2958
|
far: 200
|
|
2381
2959
|
},
|
|
2382
|
-
style: { width: "100%", height: "100%", ...
|
|
2383
|
-
children: /* @__PURE__ */
|
|
2384
|
-
/* @__PURE__ */
|
|
2385
|
-
|
|
2960
|
+
style: { width: "100%", height: "100%", ...b },
|
|
2961
|
+
children: /* @__PURE__ */ r.jsxs(we, { preset: t, children: [
|
|
2962
|
+
/* @__PURE__ */ r.jsx(
|
|
2963
|
+
Se,
|
|
2386
2964
|
{
|
|
2387
|
-
preset:
|
|
2388
|
-
target:
|
|
2389
|
-
sceneSize:
|
|
2390
|
-
maxDistance: Math.max(
|
|
2965
|
+
preset: w,
|
|
2966
|
+
target: M,
|
|
2967
|
+
sceneSize: _,
|
|
2968
|
+
maxDistance: Math.max(z, y, v) * 3,
|
|
2391
2969
|
minDistance: 0.5
|
|
2392
2970
|
}
|
|
2393
2971
|
),
|
|
2394
|
-
/* @__PURE__ */
|
|
2395
|
-
/* @__PURE__ */
|
|
2396
|
-
|
|
2972
|
+
/* @__PURE__ */ r.jsx(Me, { onPositionChange: S }),
|
|
2973
|
+
/* @__PURE__ */ r.jsxs(
|
|
2974
|
+
Rt,
|
|
2397
2975
|
{
|
|
2398
2976
|
truck: e,
|
|
2399
|
-
showGrid:
|
|
2400
|
-
wallOpacity:
|
|
2401
|
-
showRoof:
|
|
2402
|
-
showSideWalls:
|
|
2977
|
+
showGrid: l,
|
|
2978
|
+
wallOpacity: f,
|
|
2979
|
+
showRoof: h,
|
|
2980
|
+
showSideWalls: g,
|
|
2403
2981
|
children: [
|
|
2404
|
-
|
|
2982
|
+
I.map((R) => /* @__PURE__ */ r.jsx(
|
|
2405
2983
|
be,
|
|
2406
2984
|
{
|
|
2407
|
-
stackedPallet:
|
|
2408
|
-
position:
|
|
2409
|
-
yRotation:
|
|
2410
|
-
palletId:
|
|
2411
|
-
selectedBoxId:
|
|
2412
|
-
highlightedBoxId:
|
|
2413
|
-
selectedColor:
|
|
2985
|
+
stackedPallet: R.stackedPallet,
|
|
2986
|
+
position: R.position,
|
|
2987
|
+
yRotation: R.yRotation,
|
|
2988
|
+
palletId: R.id,
|
|
2989
|
+
selectedBoxId: o,
|
|
2990
|
+
highlightedBoxId: s,
|
|
2991
|
+
selectedColor: n,
|
|
2414
2992
|
highlightedColor: a,
|
|
2415
|
-
showLabels:
|
|
2416
|
-
onBoxClick:
|
|
2417
|
-
onBoxHover:
|
|
2993
|
+
showLabels: c,
|
|
2994
|
+
onBoxClick: x,
|
|
2995
|
+
onBoxHover: u
|
|
2418
2996
|
},
|
|
2419
|
-
|
|
2997
|
+
R.id
|
|
2420
2998
|
)),
|
|
2421
|
-
|
|
2999
|
+
d
|
|
2422
3000
|
]
|
|
2423
3001
|
}
|
|
2424
3002
|
)
|
|
2425
3003
|
] })
|
|
2426
3004
|
}
|
|
2427
3005
|
),
|
|
2428
|
-
|
|
2429
|
-
|
|
3006
|
+
m && /* @__PURE__ */ r.jsx(
|
|
3007
|
+
je,
|
|
2430
3008
|
{
|
|
2431
|
-
sceneWidth:
|
|
2432
|
-
sceneDepth:
|
|
3009
|
+
sceneWidth: z,
|
|
3010
|
+
sceneDepth: v,
|
|
2433
3011
|
sceneType: "truck",
|
|
2434
|
-
cameraPosition:
|
|
2435
|
-
targetPosition: { x:
|
|
3012
|
+
cameraPosition: j,
|
|
3013
|
+
targetPosition: { x: M[0], z: M[2] },
|
|
2436
3014
|
position: "bottom-left"
|
|
2437
3015
|
}
|
|
2438
3016
|
)
|
|
2439
3017
|
] });
|
|
2440
|
-
}),
|
|
3018
|
+
}), qt = V(function({
|
|
2441
3019
|
room: e,
|
|
2442
3020
|
preset: t,
|
|
2443
|
-
selectedBoxId:
|
|
2444
|
-
highlightedBoxId:
|
|
2445
|
-
selectedColor:
|
|
3021
|
+
selectedBoxId: o,
|
|
3022
|
+
highlightedBoxId: s,
|
|
3023
|
+
selectedColor: n,
|
|
2446
3024
|
highlightedColor: a,
|
|
2447
|
-
showLabels:
|
|
2448
|
-
cameraPreset:
|
|
2449
|
-
showMiniMap:
|
|
2450
|
-
onBoxClick:
|
|
2451
|
-
onBoxHover:
|
|
2452
|
-
children:
|
|
2453
|
-
style:
|
|
3025
|
+
showLabels: c = !1,
|
|
3026
|
+
cameraPreset: l = "perspective",
|
|
3027
|
+
showMiniMap: f = !1,
|
|
3028
|
+
onBoxClick: h,
|
|
3029
|
+
onBoxHover: g,
|
|
3030
|
+
children: w,
|
|
3031
|
+
style: m
|
|
2454
3032
|
}) {
|
|
2455
|
-
const
|
|
2456
|
-
|
|
2457
|
-
}, []), { target:
|
|
3033
|
+
const x = U.MM_TO_M, [u, d] = ae({ x: 0, z: 0 }), b = q((y) => {
|
|
3034
|
+
d({ x: y.x, z: y.z });
|
|
3035
|
+
}, []), { target: j, sceneSize: E, initialCameraPosition: S } = k(() => {
|
|
2458
3036
|
const y = e.floorPolygon;
|
|
2459
|
-
let
|
|
2460
|
-
for (const
|
|
2461
|
-
|
|
2462
|
-
const
|
|
3037
|
+
let v = 1 / 0, M = -1 / 0, _ = 1 / 0, T = -1 / 0;
|
|
3038
|
+
for (const P of y)
|
|
3039
|
+
v = Math.min(v, P.x * x), M = Math.max(M, P.x * x), _ = Math.min(_, P.z * x), T = Math.max(T, P.z * x);
|
|
3040
|
+
const I = M - v, R = T - _, A = e.ceilingHeight * x, G = (v + M) / 2, D = (_ + T) / 2, H = [G, A / 2, D], F = { width: I, height: A, depth: R }, J = Math.sqrt(I ** 2 + A ** 2 + R ** 2) * 0.8, p = [
|
|
2463
3041
|
G + J * 0.6,
|
|
2464
3042
|
A + J * 0.5,
|
|
2465
|
-
|
|
3043
|
+
D + J * 0.6
|
|
2466
3044
|
];
|
|
2467
3045
|
return {
|
|
2468
|
-
target:
|
|
3046
|
+
target: H,
|
|
2469
3047
|
sceneSize: F,
|
|
2470
|
-
initialCameraPosition:
|
|
3048
|
+
initialCameraPosition: p
|
|
2471
3049
|
};
|
|
2472
|
-
}, [e.floorPolygon, e.ceilingHeight,
|
|
2473
|
-
const
|
|
2474
|
-
return
|
|
3050
|
+
}, [e.floorPolygon, e.ceilingHeight, x]), C = k(() => e.floorPolygon.map((y) => ({ x: y.x * x, z: y.z * x })), [e.floorPolygon, x]), z = k(() => e.pallets.filter((y) => {
|
|
3051
|
+
const v = We(y, e);
|
|
3052
|
+
return v.isValid ? !0 : (console.error(
|
|
2475
3053
|
`[WarehouseScene] Palet "${y.id}" fuera de los límites de la estancia "${e.name}".`,
|
|
2476
3054
|
"Violaciones:",
|
|
2477
|
-
|
|
3055
|
+
v.violations
|
|
2478
3056
|
), !1);
|
|
2479
3057
|
}), [e]);
|
|
2480
|
-
return /* @__PURE__ */
|
|
2481
|
-
/* @__PURE__ */
|
|
3058
|
+
return /* @__PURE__ */ r.jsxs("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
|
|
3059
|
+
/* @__PURE__ */ r.jsx(
|
|
2482
3060
|
pe,
|
|
2483
3061
|
{
|
|
2484
3062
|
shadows: !0,
|
|
2485
3063
|
camera: {
|
|
2486
|
-
position:
|
|
3064
|
+
position: S,
|
|
2487
3065
|
fov: 45,
|
|
2488
3066
|
near: 0.01,
|
|
2489
3067
|
far: 300
|
|
2490
3068
|
},
|
|
2491
|
-
style: { width: "100%", height: "100%", ...
|
|
2492
|
-
children: /* @__PURE__ */
|
|
2493
|
-
/* @__PURE__ */
|
|
2494
|
-
|
|
3069
|
+
style: { width: "100%", height: "100%", ...m },
|
|
3070
|
+
children: /* @__PURE__ */ r.jsxs(we, { preset: t, children: [
|
|
3071
|
+
/* @__PURE__ */ r.jsx(
|
|
3072
|
+
Se,
|
|
2495
3073
|
{
|
|
2496
|
-
preset:
|
|
2497
|
-
target:
|
|
2498
|
-
sceneSize:
|
|
2499
|
-
maxDistance: Math.max(
|
|
3074
|
+
preset: l,
|
|
3075
|
+
target: j,
|
|
3076
|
+
sceneSize: E,
|
|
3077
|
+
maxDistance: Math.max(E.width, E.height, E.depth) * 4,
|
|
2500
3078
|
minDistance: 0.5
|
|
2501
3079
|
}
|
|
2502
3080
|
),
|
|
2503
|
-
/* @__PURE__ */
|
|
2504
|
-
/* @__PURE__ */
|
|
2505
|
-
|
|
3081
|
+
/* @__PURE__ */ r.jsx(Me, { onPositionChange: b }),
|
|
3082
|
+
/* @__PURE__ */ r.jsxs(Pt, { room: e, children: [
|
|
3083
|
+
z.map((y) => /* @__PURE__ */ r.jsx(
|
|
2506
3084
|
be,
|
|
2507
3085
|
{
|
|
2508
3086
|
stackedPallet: y.stackedPallet,
|
|
2509
3087
|
position: y.position,
|
|
2510
3088
|
yRotation: y.yRotation,
|
|
2511
3089
|
palletId: y.id,
|
|
2512
|
-
selectedBoxId:
|
|
2513
|
-
highlightedBoxId:
|
|
2514
|
-
selectedColor:
|
|
3090
|
+
selectedBoxId: o,
|
|
3091
|
+
highlightedBoxId: s,
|
|
3092
|
+
selectedColor: n,
|
|
2515
3093
|
highlightedColor: a,
|
|
2516
|
-
showLabels:
|
|
2517
|
-
onBoxClick:
|
|
2518
|
-
onBoxHover:
|
|
3094
|
+
showLabels: c,
|
|
3095
|
+
onBoxClick: h,
|
|
3096
|
+
onBoxHover: g
|
|
2519
3097
|
},
|
|
2520
3098
|
y.id
|
|
2521
3099
|
)),
|
|
2522
|
-
|
|
3100
|
+
w
|
|
2523
3101
|
] })
|
|
2524
3102
|
] })
|
|
2525
3103
|
}
|
|
2526
3104
|
),
|
|
2527
|
-
|
|
2528
|
-
|
|
3105
|
+
f && /* @__PURE__ */ r.jsx(
|
|
3106
|
+
je,
|
|
2529
3107
|
{
|
|
2530
|
-
sceneWidth:
|
|
2531
|
-
sceneDepth:
|
|
3108
|
+
sceneWidth: E.width,
|
|
3109
|
+
sceneDepth: E.depth,
|
|
2532
3110
|
sceneType: "warehouse",
|
|
2533
|
-
floorPolygon:
|
|
2534
|
-
cameraPosition:
|
|
2535
|
-
targetPosition: { x:
|
|
3111
|
+
floorPolygon: C,
|
|
3112
|
+
cameraPosition: u,
|
|
3113
|
+
targetPosition: { x: j[0], z: j[2] },
|
|
2536
3114
|
position: "bottom-left"
|
|
2537
3115
|
}
|
|
2538
3116
|
)
|
|
2539
3117
|
] });
|
|
2540
3118
|
});
|
|
2541
3119
|
export {
|
|
2542
|
-
|
|
2543
|
-
|
|
3120
|
+
xt as BinPacking3DStrategy,
|
|
3121
|
+
jt as BoxComponent,
|
|
2544
3122
|
ge as BoxFactory,
|
|
2545
3123
|
Ne as COLLISION_TOLERANCE,
|
|
2546
|
-
|
|
2547
|
-
|
|
3124
|
+
Se as CameraControlsComponent,
|
|
3125
|
+
ut as ColumnStrategy,
|
|
2548
3126
|
xe as DEFAULT_PRESET,
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
3127
|
+
Ht as Label,
|
|
3128
|
+
ze as MIN_SUPPORT_PERCENTAGE,
|
|
3129
|
+
Oe as PRESET_INDUSTRIAL,
|
|
3130
|
+
Ue as PRESET_UNSTYLED,
|
|
3131
|
+
pt as PackingRegistry,
|
|
3132
|
+
Mt as PalletComponent,
|
|
2555
3133
|
Z as PalletFactory,
|
|
2556
|
-
|
|
3134
|
+
N as PalletMaterial,
|
|
2557
3135
|
Yt as PalletScene,
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
3136
|
+
we as PresetProvider,
|
|
3137
|
+
He as SCENE_PRESETS,
|
|
3138
|
+
Ot as SEPARATOR_DEFAULTS,
|
|
2561
3139
|
ue as STANDARD_PALLETS,
|
|
2562
3140
|
Ct as SeparatorComponent,
|
|
2563
3141
|
me as SeparatorMaterial,
|
|
2564
3142
|
be as StackedPalletComponent,
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
3143
|
+
De as TRUCK_PRESETS,
|
|
3144
|
+
Rt as TruckEnvironment,
|
|
3145
|
+
Xt as TruckFactory,
|
|
3146
|
+
Ft as TruckScene,
|
|
2569
3147
|
ie as TruckType,
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
3148
|
+
gt as TypeGroupStrategy,
|
|
3149
|
+
U as UNITS,
|
|
3150
|
+
Ie as WEIGHT_WARNING_THRESHOLD,
|
|
3151
|
+
Pt as WarehouseEnvironment,
|
|
3152
|
+
qt as WarehouseScene,
|
|
3153
|
+
ve as aabbIntersects,
|
|
3154
|
+
Y as calculateCenterOfGravity,
|
|
3155
|
+
ee as calculateStabilityScore,
|
|
3156
|
+
wt as defaultRegistry,
|
|
3157
|
+
Je as ensureUniqueBoxIds,
|
|
3158
|
+
L as getBoxBoundingBox,
|
|
3159
|
+
se as getPalletBoundingBox,
|
|
2582
3160
|
le as getStackedPalletTotalHeight,
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
3161
|
+
ye as getStackedPalletTotalWeight,
|
|
3162
|
+
mt as pointInPolygon,
|
|
3163
|
+
Nt as usePackingStrategy,
|
|
3164
|
+
Dt as usePalletMetrics,
|
|
3165
|
+
Zt as usePhysicsValidation,
|
|
2588
3166
|
ce as usePreset,
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
3167
|
+
Ut as useWarehouseValidation,
|
|
3168
|
+
tt as validateAllBoxesInPalletBounds,
|
|
3169
|
+
et as validateBoxInPalletBounds,
|
|
3170
|
+
at as validateBoxStackability,
|
|
3171
|
+
dt as validateCogInsideSupport,
|
|
3172
|
+
st as validateFragileLoad,
|
|
3173
|
+
ct as validateInvertedPyramid,
|
|
3174
|
+
Qe as validateNoBoxCollisions,
|
|
3175
|
+
Ke as validateNoPalletCollisions,
|
|
3176
|
+
Bt as validatePalletHeight,
|
|
2599
3177
|
We as validatePalletInRoom,
|
|
2600
|
-
|
|
3178
|
+
ot as validatePalletInTruck,
|
|
2601
3179
|
it as validatePalletWeight,
|
|
2602
|
-
|
|
2603
|
-
|
|
3180
|
+
Lt as validateSeparators,
|
|
3181
|
+
ht as validateStability,
|
|
2604
3182
|
$t as validateStackDimensions,
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
3183
|
+
Gt as validateStackHeight,
|
|
3184
|
+
Vt as validateStackWeight,
|
|
3185
|
+
lt as validateSupport,
|
|
3186
|
+
Wt as validateTruckWeight,
|
|
3187
|
+
rt as validateWeightDistribution
|
|
2610
3188
|
};
|
|
2611
3189
|
//# sourceMappingURL=pallet-builder.js.map
|