@roomle/web-sdk 5.1.0-alpha.9 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ConfiguratorKernel.wasm +0 -0
- package/lib/RoomleCore.wasm +0 -0
- package/lib/RoomleToolsCore.wasm +0 -0
- package/lib/{api-DBo4bqkV.mjs → api-Woc5NOM1.mjs} +7 -4
- package/lib/api-Woc5NOM1.mjs.map +1 -0
- package/lib/asset-loader.worker-CE4O0JU-.mjs.map +1 -1
- package/lib/budgeteer.sw-yR2xApHT.mjs.map +1 -1
- package/lib/{component-raycast-helper-razJrkD8.mjs → component-raycast-helper-CaY2UMli.mjs} +2 -2
- package/lib/{component-raycast-helper-razJrkD8.mjs.map → component-raycast-helper-CaY2UMli.mjs.map} +1 -1
- package/lib/configurator-Bo_pnqDi.mjs +2 -0
- package/lib/configurator-i-Zl5omd.mjs +45 -0
- package/lib/{configurator-Bfbi3q7X.mjs.map → configurator-i-Zl5omd.mjs.map} +1 -1
- package/lib/{glb-viewer-CP0TDbjo.mjs → glb-viewer-C1-vP2Vq.mjs} +22 -22
- package/lib/{glb-viewer-CP0TDbjo.mjs.map → glb-viewer-C1-vP2Vq.mjs.map} +1 -1
- package/lib/glb-viewer-CaNU0FLF.mjs +2 -0
- package/lib/{highlight-coordinator-DwIDs-5n.mjs → highlight-coordinator-DKMaPGPo.mjs} +3 -3
- package/lib/{highlight-coordinator-DwIDs-5n.mjs.map → highlight-coordinator-DKMaPGPo.mjs.map} +1 -1
- package/lib/{homag-intelligence-1GdmdIBg.mjs → homag-intelligence-Dr0m9LxO.mjs} +9 -3
- package/lib/homag-intelligence-Dr0m9LxO.mjs.map +1 -0
- package/lib/{material-viewer-DJEEvr_2.mjs → material-viewer-CHzje_V0.mjs} +29 -29
- package/lib/{material-viewer-DJEEvr_2.mjs.map → material-viewer-CHzje_V0.mjs.map} +1 -1
- package/lib/{packages-Da2aAUP6.mjs → packages-DbOsSpKq.mjs} +5 -5
- package/lib/{packages-Da2aAUP6.mjs.map → packages-DbOsSpKq.mjs.map} +1 -1
- package/lib/{planner-B3gmGQ5h.mjs → planner-BOrph7M7.mjs} +14 -14
- package/lib/{planner-B3gmGQ5h.mjs.map → planner-BOrph7M7.mjs.map} +1 -1
- package/lib/planner-DXeyIHUx.mjs +2 -0
- package/lib/roomle-headless.d.ts +115 -8
- package/lib/roomle-headless.js +84 -84
- package/lib/roomle-headless.js.map +1 -1
- package/lib/{roomle-sdk-B7kJPhbu.mjs → roomle-sdk-CN9TqA78.mjs} +3248 -2957
- package/lib/roomle-sdk-CN9TqA78.mjs.map +1 -0
- package/lib/roomle-sdk.d.ts +115 -8
- package/lib/roomle-sdk.js +8 -8
- package/lib/{scene-renderer-CHMngNZI.mjs → scene-renderer-DGSgD6mp.mjs} +15 -15
- package/lib/{scene-renderer-CHMngNZI.mjs.map → scene-renderer-DGSgD6mp.mjs.map} +1 -1
- package/lib/{script-loader-Bgt0r8D_.mjs → script-loader-CL3F8sIY.mjs} +2 -2
- package/lib/{script-loader-Bgt0r8D_.mjs.map → script-loader-CL3F8sIY.mjs.map} +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
- package/lib/{stats-helper-CuB9x20N.mjs → stats-helper-C74q5Bje.mjs} +2 -2
- package/lib/{stats-helper-CuB9x20N.mjs.map → stats-helper-C74q5Bje.mjs.map} +1 -1
- package/lib/{threejs-utils-CrP6G-ow.mjs → threejs-utils-DHTRY4yW.mjs} +105 -112
- package/lib/{threejs-utils-CrP6G-ow.mjs.map → threejs-utils-DHTRY4yW.mjs.map} +1 -1
- package/lib/{tools-core-Bo2DwzBG.mjs → tools-core-D3kc3jRW.mjs} +6 -6
- package/lib/{tools-core-Bo2DwzBG.mjs.map → tools-core-D3kc3jRW.mjs.map} +1 -1
- package/package.json +2 -2
- package/lib/api-DBo4bqkV.mjs.map +0 -1
- package/lib/configurator-Bfbi3q7X.mjs +0 -45
- package/lib/configurator-BxIDaIsx.mjs +0 -2
- package/lib/glb-viewer-DYkOoOv-.mjs +0 -2
- package/lib/homag-intelligence-1GdmdIBg.mjs.map +0 -1
- package/lib/planner-BpzUs9MN.mjs +0 -2
- package/lib/roomle-sdk-B7kJPhbu.mjs.map +0 -1
package/lib/roomle-headless.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { a as e, i as t, n, r, t as i } from "./packages-
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "./packages-DbOsSpKq.mjs";
|
|
2
2
|
import { i as a, t as o } from "./kernel-BWfRHWkW.mjs";
|
|
3
|
-
import { Et as s, St as c } from "./threejs-utils-
|
|
3
|
+
import { Et as s, St as c } from "./threejs-utils-DHTRY4yW.mjs";
|
|
4
4
|
import { Ti as l, m as u, nt as d } from "./three.core-BTUCraWz.mjs";
|
|
5
5
|
import { i as f } from "./decorate-CjaqqbUP.mjs";
|
|
6
|
-
import { D as
|
|
7
|
-
import { A as
|
|
8
|
-
import { n as
|
|
9
|
-
import { n as
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import { n as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import { createRequire as
|
|
6
|
+
import { D as ee, H as p, g as m } from "./common-utils-CNGLvAo_.mjs";
|
|
7
|
+
import { A as te, F as ne, G as re, H as ie, J as ae, K as oe, M as se, N as ce, P as le, S as h, V as ue, Y as de, a as fe, b as pe, ct as g, dt as me, ft as he, ht as ge, i as _e, j as ve, k as ye, l as _, lt as v, m as y, o as b, ot as x, q as S, r as C, s as w, st as T, t as E, u as D, ut as O, x as k, y as A, z as j } from "./roomle-sdk-CN9TqA78.mjs";
|
|
8
|
+
import { n as M } from "./roomle-renderer-nCUrLU_S.mjs";
|
|
9
|
+
import { n as N } from "./script-loader-CL3F8sIY.mjs";
|
|
10
|
+
import { t as P } from "./configurator-i-Zl5omd.mjs";
|
|
11
|
+
import { t as be } from "./planner-BOrph7M7.mjs";
|
|
12
|
+
import { n as xe, t as Se } from "./glb-viewer-C1-vP2Vq.mjs";
|
|
13
|
+
import { t as Ce } from "./api-Woc5NOM1.mjs";
|
|
14
|
+
import { t as we } from "./roomle-headless-setup-DbO_rLjK.mjs";
|
|
15
|
+
import { createRequire as Te } from "module";
|
|
16
16
|
//#region packages/headless-core/src/headless-tween-stub.ts
|
|
17
|
-
var
|
|
17
|
+
var Ee = {
|
|
18
18
|
add(e) {
|
|
19
19
|
try {
|
|
20
20
|
e.end?.();
|
|
@@ -26,10 +26,10 @@ var Te = {
|
|
|
26
26
|
return [];
|
|
27
27
|
},
|
|
28
28
|
update() {}
|
|
29
|
-
},
|
|
29
|
+
}, De = () => {
|
|
30
30
|
let e = window;
|
|
31
|
-
e.TWEEN =
|
|
32
|
-
},
|
|
31
|
+
e.TWEEN = Ee;
|
|
32
|
+
}, Oe = Te(import.meta.url), F = {}, I = [
|
|
33
33
|
[
|
|
34
34
|
"ConfiguratorKernel.wasm",
|
|
35
35
|
"ConfiguratorKernel",
|
|
@@ -45,7 +45,7 @@ var Te = {
|
|
|
45
45
|
"RoomleToolsCore",
|
|
46
46
|
"roomle-core-hsc/wasm_modern/RoomleToolsCore.js"
|
|
47
47
|
]
|
|
48
|
-
],
|
|
48
|
+
], ke = class {
|
|
49
49
|
constructor(e) {
|
|
50
50
|
this._creator_ = e;
|
|
51
51
|
}
|
|
@@ -57,7 +57,7 @@ var Te = {
|
|
|
57
57
|
}
|
|
58
58
|
let n = this._resolveEntry(e);
|
|
59
59
|
if (n) {
|
|
60
|
-
let [, r, i] = n, a =
|
|
60
|
+
let [, r, i] = n, a = Oe(e.startsWith("/") ? e : i);
|
|
61
61
|
globalThis[r] = a.default || a, F[t.id] = !0;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -81,12 +81,12 @@ var Te = {
|
|
|
81
81
|
return Promise.all(t);
|
|
82
82
|
}
|
|
83
83
|
resolveKernelPaths(e) {
|
|
84
|
-
return
|
|
84
|
+
return N(e);
|
|
85
85
|
}
|
|
86
86
|
cleanUp() {
|
|
87
87
|
F = {};
|
|
88
88
|
}
|
|
89
|
-
},
|
|
89
|
+
}, L = class {
|
|
90
90
|
get _lifeCycleManager() {
|
|
91
91
|
return globalThis.__RML__DI__?.lookup("life-cycle-manager", this._creator_);
|
|
92
92
|
}
|
|
@@ -180,9 +180,9 @@ var Te = {
|
|
|
180
180
|
}
|
|
181
181
|
setAlwaysUseCache(e) {}
|
|
182
182
|
preFillAssetCache(e, t) {}
|
|
183
|
-
}, je = class extends
|
|
183
|
+
}, je = class extends _ {
|
|
184
184
|
_getScriptLoaderKernelId(e) {
|
|
185
|
-
return e ===
|
|
185
|
+
return e === te.PLANNER ? "kernel-planner" : "kernel";
|
|
186
186
|
}
|
|
187
187
|
useEnvironmentGeometry(e) {
|
|
188
188
|
if (!this._kernelInstance) throw Error("trying to set useEnvironmentGeometry but there is no kernel instance yet!");
|
|
@@ -201,25 +201,25 @@ var Te = {
|
|
|
201
201
|
} : n;
|
|
202
202
|
} });
|
|
203
203
|
}
|
|
204
|
-
}, Ne = class extends
|
|
204
|
+
}, Ne = class extends _e {
|
|
205
205
|
async addReflectiveFloor(e) {}
|
|
206
|
-
},
|
|
206
|
+
}, R = null;
|
|
207
207
|
function Pe(e) {
|
|
208
|
-
|
|
208
|
+
R = e;
|
|
209
209
|
}
|
|
210
|
-
var
|
|
211
|
-
function
|
|
210
|
+
var z = null, Fe = 256 * 1024 * 1024, Ie = 1, B = 500, V = 512;
|
|
211
|
+
function H(e) {
|
|
212
212
|
return Math.max(1, Math.floor(Fe * .95 / e));
|
|
213
213
|
}
|
|
214
214
|
var Le = (e) => {
|
|
215
|
-
|
|
216
|
-
},
|
|
217
|
-
minIntervalMs:
|
|
218
|
-
maxSize:
|
|
215
|
+
z = e;
|
|
216
|
+
}, U = null, W = {
|
|
217
|
+
minIntervalMs: B,
|
|
218
|
+
maxSize: V
|
|
219
219
|
}, Re = (e, t) => {
|
|
220
|
-
|
|
221
|
-
minIntervalMs: t?.minIntervalMs ??
|
|
222
|
-
maxSize: t?.maxSize ??
|
|
220
|
+
U = e, W = {
|
|
221
|
+
minIntervalMs: t?.minIntervalMs ?? B,
|
|
222
|
+
maxSize: t?.maxSize ?? V
|
|
223
223
|
};
|
|
224
224
|
}, ze = class {
|
|
225
225
|
constructor() {
|
|
@@ -237,7 +237,7 @@ var Le = (e) => {
|
|
|
237
237
|
try {
|
|
238
238
|
a.setScene(t, n), a.reset();
|
|
239
239
|
let o = Math.max(1, Math.floor(r)), s = 0;
|
|
240
|
-
for (; a.samples < o;) a.renderSample(),
|
|
240
|
+
for (; a.samples < o;) a.renderSample(), z?.(a.samples, o), U && a.samples >= 2 && performance.now() - s >= W.minIntervalMs && (await this._emitPreview(e, a.samples, o), s = performance.now()), await new Promise((e) => setTimeout(e, 0));
|
|
241
241
|
a.renderSample(), i.denoise && await this._denoiseAndBlit(e, a);
|
|
242
242
|
} finally {
|
|
243
243
|
this._undoScenePatches(o), e.autoClear = s.autoClear, e.toneMapping = s.toneMapping, e.toneMappingExposure = s.toneMappingExposure, e.outputColorSpace = s.outputColorSpace;
|
|
@@ -296,12 +296,12 @@ var Le = (e) => {
|
|
|
296
296
|
try {
|
|
297
297
|
let r = e.domElement, i = r.getContext?.("webgpu");
|
|
298
298
|
if (!i?.readbackScaled) return;
|
|
299
|
-
let a = Math.min(1,
|
|
299
|
+
let a = Math.min(1, W.maxSize / Math.max(1, Math.max(r.width, r.height))), o = Math.max(1, Math.round(r.width * a)), s = Math.max(1, Math.round(r.height * a)), c = await i.readbackScaled(o, s);
|
|
300
300
|
if (!c) return;
|
|
301
301
|
let { createCanvas: l, ImageData: u } = await import("@napi-rs/canvas"), d = l(c.width, c.height);
|
|
302
302
|
d.getContext("2d").putImageData(new u(new Uint8ClampedArray(c.data.buffer, c.data.byteOffset, c.data.byteLength), c.width, c.height), 0, 0);
|
|
303
303
|
let f = await d.encode("png");
|
|
304
|
-
|
|
304
|
+
U?.({
|
|
305
305
|
png: new Uint8Array(f.buffer, f.byteOffset, f.byteLength),
|
|
306
306
|
width: c.width,
|
|
307
307
|
height: c.height,
|
|
@@ -311,7 +311,7 @@ var Le = (e) => {
|
|
|
311
311
|
} catch {}
|
|
312
312
|
}
|
|
313
313
|
async _readHdrTargetTiled(e, t, n, r) {
|
|
314
|
-
let i = n * 4, a = Math.ceil(n / 16) * 16 * 4, o =
|
|
314
|
+
let i = n * 4, a = Math.ceil(n / 16) * 16 * 4, o = H(a * 4), s = new Float32Array(i * r);
|
|
315
315
|
for (let c = 0; c < r; c += o) {
|
|
316
316
|
let l = Math.min(o, r - c), u = await e.readRenderTargetPixelsAsync({ textures: [t] }, 0, c, n, l);
|
|
317
317
|
if (u.length === i * l) s.set(u, c * i);
|
|
@@ -320,8 +320,8 @@ var Le = (e) => {
|
|
|
320
320
|
return s;
|
|
321
321
|
}
|
|
322
322
|
async _denoiseAndBlit(e, t) {
|
|
323
|
-
if (!
|
|
324
|
-
let n = t._pathTracer.outputTarget, { width: r, height: i } = n, a = await this._readHdrTargetTiled(e, n, r, i), o = await
|
|
323
|
+
if (!R) throw Error("WebGPUPathTracerRenderer: pathTracerSettings.denoise=true but no external denoiser is registered. Use setPathTracerExternalDenoiser() with Intel OIDN binaries");
|
|
324
|
+
let n = t._pathTracer.outputTarget, { width: r, height: i } = n, a = await this._readHdrTargetTiled(e, n, r, i), o = await R(a, r, i);
|
|
325
325
|
this._writeDenoisedIntoTarget(e, n, o, r, i);
|
|
326
326
|
let s = t._blitQuad, c = e.toneMapping, l = e.toneMappingExposure, u = e.autoClear, d = e.getRenderTarget();
|
|
327
327
|
e.toneMapping = 0, e.toneMappingExposure = 1, e.autoClear = !0, e.setRenderTarget(null), s.material.transition = 1, s.material.opacity = 1, s.material.texture = n, s.material.toneMapping = c, s.material.toneMappingExposure = l, s.render(e), e.autoClear = u, e.toneMapping = c, e.toneMappingExposure = l, e.setRenderTarget(d);
|
|
@@ -329,7 +329,7 @@ var Le = (e) => {
|
|
|
329
329
|
_writeDenoisedIntoTarget(e, t, n, r, i) {
|
|
330
330
|
let a = e.backend, o = a?.get?.(t)?.texture, s = a?.device?.queue;
|
|
331
331
|
if (!o || !s) throw Error("WebGPUPathTracerRenderer: could not access the backend GPU texture for the denoise write-back.");
|
|
332
|
-
let c = r * 16, l = r * 4, u =
|
|
332
|
+
let c = r * 16, l = r * 4, u = H(c);
|
|
333
333
|
for (let e = 0; e < i; e += u) {
|
|
334
334
|
let t = Math.min(u, i - e), a = n.subarray(e * l, (e + t) * l);
|
|
335
335
|
s.writeTexture({
|
|
@@ -356,7 +356,7 @@ var Le = (e) => {
|
|
|
356
356
|
let { WebGPUPathTracer: t } = await import("./webgpu-zcxAHKs3.mjs"), n = new t(e);
|
|
357
357
|
return n.useMegakernel(!0), n.dynamicLowRes = !1, n.renderDelay = 0, n.fadeDuration = 0, n.minSamples = 1, this._pathTracer = n, this._renderer = e, n;
|
|
358
358
|
}
|
|
359
|
-
}, Be = class e extends
|
|
359
|
+
}, Be = class e extends y {
|
|
360
360
|
constructor(...e) {
|
|
361
361
|
super(...e), this._headlessPathTracerRenderer = null;
|
|
362
362
|
}
|
|
@@ -398,7 +398,7 @@ var Le = (e) => {
|
|
|
398
398
|
}) } : super._renderFrame(e, t, n, r);
|
|
399
399
|
}
|
|
400
400
|
async _renderPathTracedFrame(e, t, n, r) {
|
|
401
|
-
let i = e instanceof
|
|
401
|
+
let i = e instanceof M ? e.renderer : e;
|
|
402
402
|
if (!i.isWebGPURenderer) throw Error("HeadlessImageRenderer: path tracing requires the WebGPU renderer (enable webGpu)");
|
|
403
403
|
this._headlessPathTracerRenderer ||= new ze(), await this._headlessPathTracerRenderer.render(i, t, n, r.samples, r.settings);
|
|
404
404
|
let { imageDataUrl: a } = await this._readFrameAndClear(i);
|
|
@@ -434,7 +434,7 @@ var Le = (e) => {
|
|
|
434
434
|
let { width: r, height: i } = e.domElement;
|
|
435
435
|
return t.readbackScaled(Math.max(1, Math.round(r * n)), Math.max(1, Math.round(i * n)));
|
|
436
436
|
}
|
|
437
|
-
},
|
|
437
|
+
}, G = class extends fe {
|
|
438
438
|
constructor(...e) {
|
|
439
439
|
super(...e), this._callbacks = /* @__PURE__ */ new Set(), this._dispatcherInstalled = !1;
|
|
440
440
|
}
|
|
@@ -444,30 +444,30 @@ var Le = (e) => {
|
|
|
444
444
|
}), !0);
|
|
445
445
|
}
|
|
446
446
|
static async loadEquirectTexture(e) {
|
|
447
|
-
let t = await (e.toLowerCase().endsWith(".exr") ? new
|
|
447
|
+
let t = await (e.toLowerCase().endsWith(".exr") ? new w() : new b()).loadAsync(e);
|
|
448
448
|
return t.mapping = 303, t;
|
|
449
449
|
}
|
|
450
450
|
}, Ve = (e, t) => {
|
|
451
|
-
let n = new
|
|
451
|
+
let n = new x();
|
|
452
452
|
globalThis.__RML__DI__ = n;
|
|
453
|
-
class r extends
|
|
453
|
+
class r extends L {
|
|
454
454
|
constructor(n) {
|
|
455
455
|
super(n, e, t);
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
458
|
let i = [
|
|
459
|
-
new
|
|
460
|
-
new
|
|
461
|
-
new
|
|
462
|
-
new
|
|
463
|
-
new
|
|
464
|
-
new
|
|
465
|
-
new
|
|
466
|
-
new
|
|
459
|
+
new g("script-loader", ke, T.CONTEXT, !0),
|
|
460
|
+
new g("dom-helper", r, T.CONTEXT, !0),
|
|
461
|
+
new g("data-syncer", Ae, T.GLOBAL, !0),
|
|
462
|
+
new g("planner-kernel-access", je, T.GLOBAL, !0),
|
|
463
|
+
new g("kernel-callback-guard", Me, T.GLOBAL, !0),
|
|
464
|
+
new g("web-gpu-ground-shadow-reflection", Ne, T.CONTEXT, !0),
|
|
465
|
+
new g("image-renderer", Be, T.CONTEXT, !0),
|
|
466
|
+
new g("hdr-environment-loader", G, T.GLOBAL, !0)
|
|
467
467
|
];
|
|
468
|
-
return n.addDependencyInjectionAssignments(
|
|
469
|
-
},
|
|
470
|
-
let n = await
|
|
468
|
+
return n.addDependencyInjectionAssignments(C), n.addDependencyInjectionAssignments(i), n;
|
|
469
|
+
}, K = 12e4, He = async (e, t) => {
|
|
470
|
+
let n = await E.callbacks, r = n?.onReadyForRender, i = n ? new Promise((e) => {
|
|
471
471
|
n.onReadyForRender = () => {
|
|
472
472
|
try {
|
|
473
473
|
r?.();
|
|
@@ -476,8 +476,8 @@ var Le = (e) => {
|
|
|
476
476
|
}
|
|
477
477
|
};
|
|
478
478
|
}) : Promise.resolve(), a = e.getSceneManager().whenRenderLoopFunctionApplied();
|
|
479
|
-
await t(e), await Promise.all([
|
|
480
|
-
},
|
|
479
|
+
await t(e), await Promise.all([p(i, "HeadlessRoomleSdk: onReadyForRender never fired, the scene never finished loading its assets", K), p(a, "HeadlessRoomleSdk: the plan was never added to the scene, the render loop never ran the scheduled scene-graph mutation", K)]);
|
|
480
|
+
}, q = (e) => {
|
|
481
481
|
let t = e.ssaa ?? (e.pathTracer ? 1 : 2), n = e.width ?? e.size ?? 1024, r = e.height ?? e.size ?? 1024;
|
|
482
482
|
return {
|
|
483
483
|
ssaa: t,
|
|
@@ -486,11 +486,11 @@ var Le = (e) => {
|
|
|
486
486
|
renderWidth: n * t,
|
|
487
487
|
renderHeight: r * t
|
|
488
488
|
};
|
|
489
|
-
},
|
|
489
|
+
}, J = async (e, t, n, r) => e.pixels ? X(e.pixels, t, n) : r > 1 ? Z(e.image, t, n) : e.image, Ue = async (e, t) => {
|
|
490
490
|
if (e.pixels) {
|
|
491
491
|
let n = e.pixels.width < e.width, r = n ? e.pixels.width : Math.round(e.pixels.width / t), i = n ? e.pixels.height : Math.round(e.pixels.height / t);
|
|
492
492
|
return {
|
|
493
|
-
dataUrl: await
|
|
493
|
+
dataUrl: await X(e.pixels, r, i),
|
|
494
494
|
width: r,
|
|
495
495
|
height: i
|
|
496
496
|
};
|
|
@@ -498,7 +498,7 @@ var Le = (e) => {
|
|
|
498
498
|
if (t > 1) {
|
|
499
499
|
let n = Math.round(e.width / t), r = Math.round(e.height / t);
|
|
500
500
|
return {
|
|
501
|
-
dataUrl: await
|
|
501
|
+
dataUrl: await Z(e.image, n, r),
|
|
502
502
|
width: n,
|
|
503
503
|
height: r
|
|
504
504
|
};
|
|
@@ -508,22 +508,22 @@ var Le = (e) => {
|
|
|
508
508
|
width: e.width,
|
|
509
509
|
height: e.height
|
|
510
510
|
};
|
|
511
|
-
},
|
|
511
|
+
}, Y = async (e, t) => {
|
|
512
512
|
if (!t) return;
|
|
513
513
|
let n = await import("fs"), r = e.replace(/^data:image\/\w+;base64,/, "");
|
|
514
514
|
n.writeFileSync(t, Buffer.from(r, "base64"));
|
|
515
|
-
},
|
|
515
|
+
}, X = async (e, t, n) => {
|
|
516
516
|
let { createCanvas: r, ImageData: i } = await import("@napi-rs/canvas"), a = r(e.width, e.height);
|
|
517
517
|
if (a.getContext("2d").putImageData(new i(new Uint8ClampedArray(e.data.buffer, e.data.byteOffset, e.data.byteLength), e.width, e.height), 0, 0), t === e.width && n === e.height) return a.toDataURLAsync("image/png");
|
|
518
518
|
let o = r(t, n), s = o.getContext("2d");
|
|
519
519
|
return s.imageSmoothingEnabled = !0, s.imageSmoothingQuality = "high", s.drawImage(a, 0, 0, t, n), o.toDataURLAsync("image/png");
|
|
520
|
-
},
|
|
520
|
+
}, Z = async (e, t, n) => {
|
|
521
521
|
let { createCanvas: r, loadImage: i } = await import("@napi-rs/canvas"), a = await i(Buffer.from(e.replace(/^data:image\/\w+;base64,/, ""), "base64")), o = r(t, n), s = o.getContext("2d");
|
|
522
522
|
return s.imageSmoothingEnabled = !0, s.imageSmoothingQuality = "high", s.drawImage(a, 0, 0, t, n), o.toDataURLAsync("image/png");
|
|
523
|
-
},
|
|
523
|
+
}, We = 1024, Ge = 768, Ke = "inline-plan-xml#", qe = "inline-configuration#", Q = (e, t) => e && !t, Je = class e {
|
|
524
524
|
static async create(t) {
|
|
525
525
|
let n = new e(t);
|
|
526
|
-
return await
|
|
526
|
+
return await E.setGlobalInitData({
|
|
527
527
|
configuratorId: t.configuratorId,
|
|
528
528
|
locale: t.locale,
|
|
529
529
|
tenant: t.tenant,
|
|
@@ -539,7 +539,7 @@ var Le = (e) => {
|
|
|
539
539
|
autoQualityMinFps: 0,
|
|
540
540
|
autoQualityMaxFps: 2 ** 53 - 1,
|
|
541
541
|
...e.webGpuConfig
|
|
542
|
-
},
|
|
542
|
+
}, De(), this._container = Ve(e.width ?? We, e.height ?? Ge);
|
|
543
543
|
}
|
|
544
544
|
getHeadlessConfigurator() {
|
|
545
545
|
return this._getConfigurator();
|
|
@@ -553,7 +553,7 @@ var Le = (e) => {
|
|
|
553
553
|
async _bootPlanner() {
|
|
554
554
|
let { width: e, height: t, ...n } = this._initData;
|
|
555
555
|
if (n.moc === !1) throw Error("HeadlessRoomleSdk: planner requires moc:true");
|
|
556
|
-
let r = await
|
|
556
|
+
let r = await E.getPlanner({
|
|
557
557
|
...n,
|
|
558
558
|
moc: !0,
|
|
559
559
|
webGpu: !0,
|
|
@@ -572,7 +572,7 @@ var Le = (e) => {
|
|
|
572
572
|
return this._loadIntoPlanner(e, (t) => t.createPlanFromObject(e));
|
|
573
573
|
}
|
|
574
574
|
async loadConfigurationString(e) {
|
|
575
|
-
let t =
|
|
575
|
+
let t = qe + await f(e);
|
|
576
576
|
return this._loadIntoPlanner(t, (t) => t.createPlanFromConfigurationString(e));
|
|
577
577
|
}
|
|
578
578
|
async loadConfigurableItemById(e) {
|
|
@@ -589,7 +589,7 @@ var Le = (e) => {
|
|
|
589
589
|
return this._loadIntoPlanner(e, (t) => t.loadPlan(e), !0);
|
|
590
590
|
}
|
|
591
591
|
async loadPlanXml(e) {
|
|
592
|
-
let t =
|
|
592
|
+
let t = Ke + await f(e);
|
|
593
593
|
return this._loadIntoPlanner(t, (t) => t.loadPlanXml(e), !0);
|
|
594
594
|
}
|
|
595
595
|
_loadIntoPlanner(e, t, n = !1) {
|
|
@@ -597,7 +597,7 @@ var Le = (e) => {
|
|
|
597
597
|
}
|
|
598
598
|
async _load(e, t, n, r) {
|
|
599
599
|
let i = await this._getPlanner();
|
|
600
|
-
if (i.getConfiguratorContext().baseContext =
|
|
600
|
+
if (i.getConfiguratorContext().baseContext = ie.PLANNER, this._loadedScene?.identity === e) return;
|
|
601
601
|
this._loadedScene = null;
|
|
602
602
|
let a = Q(r, n);
|
|
603
603
|
this._useEnvironmentGeometry(a), await He(i, t), this._loadedScene = {
|
|
@@ -645,7 +645,7 @@ var Le = (e) => {
|
|
|
645
645
|
this._skyboxOriginal.has(t) || this._skyboxOriginal.set(t, {
|
|
646
646
|
background: t.background,
|
|
647
647
|
showEnvironmentBackground: t.userData.showEnvironmentBackground
|
|
648
|
-
}), t.background = await
|
|
648
|
+
}), t.background = await G.loadEquirectTexture(e), t.userData.showEnvironmentBackground = !1;
|
|
649
649
|
}
|
|
650
650
|
resetSkybox() {
|
|
651
651
|
let e = this._getActiveSceneManager().getScene(), t = this._skyboxOriginal.get(e);
|
|
@@ -670,7 +670,7 @@ var Le = (e) => {
|
|
|
670
670
|
}
|
|
671
671
|
exportScreenshot(e, t = {}) {
|
|
672
672
|
return this._withLoadedScene(!0, async (n) => {
|
|
673
|
-
let { ssaa: r, targetWidth: i, targetHeight: a, renderWidth: o, renderHeight: s } =
|
|
673
|
+
let { ssaa: r, targetWidth: i, targetHeight: a, renderWidth: o, renderHeight: s } = q(t), c = {
|
|
674
674
|
rotationY: t.rotationY,
|
|
675
675
|
cameraPosition: t.cameraPosition,
|
|
676
676
|
cameraPitch: t.cameraPitch,
|
|
@@ -685,20 +685,20 @@ var Le = (e) => {
|
|
|
685
685
|
pathTracerSettings: t.pathTracerSettings,
|
|
686
686
|
preferRawPixels: !0,
|
|
687
687
|
rawPixelsScale: 1 / r
|
|
688
|
-
}, l = await
|
|
689
|
-
return await
|
|
688
|
+
}, l = await J(await n.planner.preparePerspectiveImage(c), i, a, r);
|
|
689
|
+
return await Y(l, e), { dataUrl: l };
|
|
690
690
|
});
|
|
691
691
|
}
|
|
692
692
|
exportPerspectiveImage(e, t = {}) {
|
|
693
693
|
return this._withLoadedScene(!0, async (n) => {
|
|
694
|
-
let { ssaa: r, targetWidth: i, targetHeight: a, renderWidth: o, renderHeight: s } =
|
|
694
|
+
let { ssaa: r, targetWidth: i, targetHeight: a, renderWidth: o, renderHeight: s } = q(t), c = {
|
|
695
695
|
...t,
|
|
696
696
|
width: o,
|
|
697
697
|
height: s,
|
|
698
698
|
preferRawPixels: !0,
|
|
699
699
|
rawPixelsScale: 1 / r
|
|
700
|
-
}, l = await n.planner.preparePerspectiveImage(c), u = !!l.pixels || r > 1, d = await
|
|
701
|
-
return await
|
|
700
|
+
}, l = await n.planner.preparePerspectiveImage(c), u = !!l.pixels || r > 1, d = await J(l, i, a, r);
|
|
701
|
+
return await Y(d, e), {
|
|
702
702
|
dataUrl: d,
|
|
703
703
|
width: u ? i : l.width,
|
|
704
704
|
height: u ? a : l.height
|
|
@@ -714,7 +714,7 @@ var Le = (e) => {
|
|
|
714
714
|
preferRawPixels: !0,
|
|
715
715
|
rawPixelsScale: 1 / r
|
|
716
716
|
}, a = await Ue(await n.planner.prepareTopImage(i), r);
|
|
717
|
-
return await
|
|
717
|
+
return await Y(a.dataUrl, e), a;
|
|
718
718
|
});
|
|
719
719
|
}
|
|
720
720
|
getConfiguratorApi() {
|
|
@@ -726,10 +726,10 @@ var Le = (e) => {
|
|
|
726
726
|
async destroy() {
|
|
727
727
|
this._plannerMainPromise && (await this._plannerMainPromise.catch(() => null))?.destroy();
|
|
728
728
|
}
|
|
729
|
-
}, $ = () => globalThis.__RML__DI__?.lookup("model-export-state"),
|
|
729
|
+
}, $ = () => globalThis.__RML__DI__?.lookup("model-export-state"), Ye = (e) => {
|
|
730
730
|
$()?.setModelExportOngoing(e);
|
|
731
|
-
},
|
|
731
|
+
}, Xe = () => $()?.isModelExportOngoing() ?? !1;
|
|
732
732
|
//#endregion
|
|
733
|
-
export { o as CONFIGURATION_TYPE, c as CORE_EDGE_TYPE, s as CORE_OBJECT_CATEGORY, a as CORE_PERMISSION_TO_DELETE,
|
|
733
|
+
export { o as CONFIGURATION_TYPE, c as CORE_EDGE_TYPE, s as CORE_OBJECT_CATEGORY, a as CORE_PERMISSION_TO_DELETE, P as Configurator, ve as FloorPlanElementViewModel, Se as GlbViewer, j as HI_CONTEXT_ACTION, ue as HI_GROUP_OPERATION, Je as HeadlessRoomleSdk, h as MeasurementLinePlanElementViewModel, A as PLAN_ELEMENT_CHANGE_TYPES, ne as PlanElementViewModel, le as PlanObjectViewModel, be as Planner, v as RapiAccess, O as RapiInvalidIdError, me as RapiOfflineError, Ce as RoomDesignerApi, ye as RoomleConfigurator, xe as RoomleGLBViewer, ge as RoomleLightSource, D as RoomlePlanner, E as RoomleSdk, ce as StaticPlanObjectViewModel, se as WallPlanElementViewModel, re as createExtObj, de as createExtObjId, m as download, he as getCatalogIdFromConfigurationHash, we as getHeadlessWebGpuMaxTextureDimension, oe as isExtObjId, S as isExternalObject, pe as isFirefox, i as isIdAComponent, n as isIdAConfigurationString, r as isIdAPlan, t as isIdAnItem, Xe as isModelExportOngoing, e as isPlanSnapshotId, k as isSafari, ee as md5Hash, ae as removeExtObjIdPrefix, Ye as setModelExportOngoing, Pe as setPathTracerExternalDenoiser, Re as setPathTracerPreviewHook, Le as setPathTracerProgressHook };
|
|
734
734
|
|
|
735
735
|
//# sourceMappingURL=roomle-headless.js.map
|