@ifc-lite/viewer 1.27.0 → 1.28.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/.turbo/turbo-build.log +38 -38
- package/CHANGELOG.md +64 -0
- package/dist/assets/{basketViewActivator-B3CdrLsb.js → basketViewActivator-BNRDNuUJ.js} +8 -8
- package/dist/assets/{bcf-QeHK_Aud.js → bcf-DCwCuP7n.js} +56 -56
- package/dist/assets/{decode-worker-CgM1iNSK.js → decode-worker-Cjign7Zh.js} +1 -1
- package/dist/assets/{deflate-B-d0SYQM.js → deflate-DNGgs8Ur.js} +1 -1
- package/dist/assets/drawing-2d-D0dDf6Lh.js +257 -0
- package/dist/assets/e57-source-2wI9jkCA.js +1 -0
- package/dist/assets/{exporters-B4LbZFeT.js → exporters-B9v81gi9.js} +1249 -1140
- package/dist/assets/geometry.worker-Bpa3115V.js +1 -0
- package/dist/assets/{geotiff-CrVtDRFq.js → geotiff-D-YCLS4g.js} +10 -10
- package/dist/assets/{ids-DjsGFN10.js → ids-CCpq-5d3.js} +952 -945
- package/dist/assets/{ifc-lite_bg-DsYUIHm3.wasm → ifc-lite_bg-DbgS5EUA.wasm} +0 -0
- package/dist/assets/{index-COYokSKc.js → index-Bgb3_Pu_.js} +41073 -38715
- package/dist/assets/index-BtbXFKsX.css +1 -0
- package/dist/assets/{index.es-CY202jA3.js → index.es-CWfqZyyr.js} +9 -9
- package/dist/assets/{jpeg-D4wOkf5h.js → jpeg-DGOAeUqU.js} +1 -1
- package/dist/assets/{jspdf.es.min-DIGb9BHN.js → jspdf.es.min-XPLU2Wkq.js} +4 -4
- package/dist/assets/lens-C4p1kQ0p.js +1 -0
- package/dist/assets/{lerc-DmW0_tgf.js → lerc-1PMSCHwX.js} +1 -1
- package/dist/assets/{lzw-oWetY-d6.js → lzw-C65U9lNM.js} +1 -1
- package/dist/assets/{native-bridge-BX8_tHXE.js → native-bridge-XxXos6yI.js} +2 -2
- package/dist/assets/{packbits-F8Nkp4NY.js → packbits-BdMWXC3m.js} +1 -1
- package/dist/assets/parser.worker-Ddwo3_06.js +182 -0
- package/dist/assets/{pdf-Dsh3HPZB.js → pdf-CRwaZf3s.js} +10 -10
- package/dist/assets/raw-CJgQdyuZ.js +1 -0
- package/dist/assets/{sandbox-BAC3a-eN.js → sandbox-0sDo3g3m.js} +2960 -2552
- package/dist/assets/server-client-cTCJ-853.js +719 -0
- package/dist/assets/{webimage-BLV1dgmd.js → webimage-BtakWX7W.js} +1 -1
- package/dist/assets/{xlsx-Bc2HTrjC.js → xlsx-B1YOg2QB.js} +8 -8
- package/dist/assets/{zstd-C_1HxVrA.js → zstd-CmwsbxmM.js} +1 -1
- package/dist/index.html +9 -9
- package/package.json +24 -23
- package/src/components/mcp/playground-dispatcher.ts +3 -0
- package/src/components/mcp/playground-files.ts +33 -1
- package/src/components/viewer/CommandPalette.tsx +6 -1
- package/src/components/viewer/ComparePanel.tsx +420 -0
- package/src/components/viewer/HierarchyPanel.tsx +46 -7
- package/src/components/viewer/MainToolbar.tsx +19 -2
- package/src/components/viewer/PropertiesPanel.tsx +71 -2
- package/src/components/viewer/ViewerLayout.tsx +5 -0
- package/src/components/viewer/Viewport.tsx +3 -0
- package/src/components/viewer/hierarchy/HierarchyNode.tsx +3 -3
- package/src/components/viewer/hierarchy/ifc-icons.ts +9 -0
- package/src/components/viewer/hierarchy/treeDataBuilder.ts +87 -0
- package/src/components/viewer/hierarchy/types.ts +1 -0
- package/src/components/viewer/hierarchy/useHierarchyTree.ts +6 -2
- package/src/components/viewer/properties/MaterialTotalsPanel.tsx +283 -0
- package/src/hooks/federationLoadGate.test.ts +12 -2
- package/src/hooks/federationLoadGate.ts +9 -2
- package/src/hooks/ingest/federationAlign.ts +481 -0
- package/src/hooks/ingest/viewerModelIngest.ts +3 -212
- package/src/hooks/useCompare.ts +0 -0
- package/src/hooks/useCompareOverlay.ts +119 -0
- package/src/hooks/useDrawingGeneration.ts +23 -1
- package/src/hooks/useIfc.ts +1 -1
- package/src/hooks/useIfcCache.ts +32 -9
- package/src/hooks/useIfcFederation.ts +42 -810
- package/src/hooks/useIfcLoader.ts +361 -488
- package/src/hooks/useIfcServer.ts +3 -0
- package/src/hooks/useLens.ts +5 -1
- package/src/hooks/useSymbolicAnnotations.ts +70 -38
- package/src/lib/compare/buildFingerprints.ts +173 -0
- package/src/lib/compare/describeChange.ts +0 -0
- package/src/lib/compare/geometricData.test.ts +54 -0
- package/src/lib/compare/geometricData.ts +37 -0
- package/src/lib/compare/overlay.test.ts +99 -0
- package/src/lib/compare/overlay.ts +91 -0
- package/src/lib/geo/cesium-placement.ts +1 -1
- package/src/lib/geo/reproject.ts +4 -1
- package/src/lib/llm/script-edit-ops.ts +23 -0
- package/src/lib/llm/stream-client.ts +8 -1
- package/src/lib/search/result-export.ts +7 -1
- package/src/sdk/adapters/export-adapter.ts +6 -1
- package/src/store/globalId.ts +15 -13
- package/src/store/index.ts +16 -1
- package/src/store/slices/cesiumSlice.ts +8 -1
- package/src/store/slices/compareSlice.ts +96 -0
- package/src/store/slices/lensSlice.ts +8 -0
- package/src/utils/acquireFileBuffer.test.ts +12 -4
- package/src/utils/desktopModelSnapshot.ts +2 -1
- package/src/utils/loadingUtils.ts +32 -0
- package/src/utils/spatialHierarchy.test.ts +53 -1
- package/src/utils/spatialHierarchy.ts +42 -2
- package/src/vite-env.d.ts +2 -0
- package/dist/assets/drawing-2d-C71b8Ugx.js +0 -257
- package/dist/assets/e57-source-CQHxE8n3.js +0 -1
- package/dist/assets/geometry.worker-BdH-E6NB.js +0 -1
- package/dist/assets/index-ajK6D32J.css +0 -1
- package/dist/assets/lens-PYsLu_MA.js +0 -1
- package/dist/assets/parser.worker-D591Zu_-.js +0 -182
- package/dist/assets/raw-D9iw0tmc.js +0 -1
- package/dist/assets/server-client-Cjwnm7il.js +0 -706
- package/src/hooks/ingest/resolveDataStoreOrAbort.test.ts +0 -61
- package/src/hooks/ingest/resolveDataStoreOrAbort.ts +0 -28
- package/src/hooks/ingest/watchedGeometryStream.test.ts +0 -78
- package/src/hooks/ingest/watchedGeometryStream.ts +0 -76
|
@@ -1,706 +0,0 @@
|
|
|
1
|
-
import { _ as ft, __tla as __tla_0 } from "./sandbox-BAC3a-eN.js";
|
|
2
|
-
let te, ee;
|
|
3
|
-
let __tla = Promise.all([
|
|
4
|
-
(()=>{
|
|
5
|
-
try {
|
|
6
|
-
return __tla_0;
|
|
7
|
-
} catch {}
|
|
8
|
-
})()
|
|
9
|
-
]).then(async ()=>{
|
|
10
|
-
let qt = !1, At = null;
|
|
11
|
-
async function Ct() {
|
|
12
|
-
if (qt && At) return At;
|
|
13
|
-
console.log("[parquet-decoder] Starting WASM initialization...");
|
|
14
|
-
let s;
|
|
15
|
-
try {
|
|
16
|
-
if (s = await ft(()=>import("./parquet-CEXmQNRO.js").then((t)=>t.a), []), console.log("[parquet-decoder] Imported ESM build"), typeof s.default == "function") {
|
|
17
|
-
console.log("[parquet-decoder] Calling ESM init to load WASM...");
|
|
18
|
-
const n = (await ft(()=>import("./parquet-CEXmQNRO.js").then((o)=>o.b), [])).default;
|
|
19
|
-
console.log("[parquet-decoder] Loading WASM from:", n), await s.default(n), console.log("[parquet-decoder] ESM WASM initialized");
|
|
20
|
-
}
|
|
21
|
-
if (typeof s.readParquet == "function") return At = s, qt = !0, console.log("[parquet-decoder] ESM build ready with readParquet"), s;
|
|
22
|
-
console.warn("[parquet-decoder] ESM build initialized but readParquet not found");
|
|
23
|
-
} catch (t) {
|
|
24
|
-
console.warn("[parquet-decoder] ESM import failed:", t);
|
|
25
|
-
}
|
|
26
|
-
try {
|
|
27
|
-
if (s = await ft(()=>import("./parquet-CEXmQNRO.js").then((t)=>t.a), []), typeof s.default == "function") {
|
|
28
|
-
console.log("[parquet-decoder] Trying web init with node_modules path...");
|
|
29
|
-
const t = [
|
|
30
|
-
"/node_modules/parquet-wasm/esm/arrow2_bg.wasm",
|
|
31
|
-
"./node_modules/parquet-wasm/esm/arrow2_bg.wasm"
|
|
32
|
-
];
|
|
33
|
-
for (const n of t)try {
|
|
34
|
-
const o = await fetch(n);
|
|
35
|
-
if (o.ok && (console.log("[parquet-decoder] Found WASM at:", n), await s.default(o), typeof s.readParquet == "function")) return At = s, qt = !0, console.log("[parquet-decoder] Web init successful"), s;
|
|
36
|
-
} catch {}
|
|
37
|
-
}
|
|
38
|
-
} catch (t) {
|
|
39
|
-
console.warn("[parquet-decoder] Web init failed:", t);
|
|
40
|
-
}
|
|
41
|
-
throw new Error("parquet-wasm: Could not load WASM module. Ensure parquet-wasm is installed and WASM files are accessible.");
|
|
42
|
-
}
|
|
43
|
-
async function Dt(s) {
|
|
44
|
-
const t = await Ct(), n = new DataView(s);
|
|
45
|
-
let o = 0;
|
|
46
|
-
const a = n.getUint32(o, !0);
|
|
47
|
-
o += 4;
|
|
48
|
-
const e = new Uint8Array(s, o, a);
|
|
49
|
-
o += a;
|
|
50
|
-
const i = n.getUint32(o, !0);
|
|
51
|
-
o += 4;
|
|
52
|
-
const l = new Uint8Array(s, o, i);
|
|
53
|
-
o += i;
|
|
54
|
-
const c = n.getUint32(o, !0);
|
|
55
|
-
o += 4;
|
|
56
|
-
const m = new Uint8Array(s, o, c), f = t.readParquet(e), g = t.readParquet(l), C = t.readParquet(m), u = await ft(()=>import("./arrow-CXWhTnNT.js").then((q)=>q.A), []), d = u.tableFromIPC(f.intoIPCStream()), P = u.tableFromIPC(g.intoIPCStream()), T = u.tableFromIPC(C.intoIPCStream()), k = d.getChild("express_id")?.toArray(), E = d.getChild("ifc_type"), M = d.getChild("vertex_start")?.toArray(), L = d.getChild("vertex_count")?.toArray(), z = d.getChild("index_start")?.toArray(), x = d.getChild("index_count")?.toArray(), _ = d.getChild("color_r")?.toArray(), v = d.getChild("color_g")?.toArray(), b = d.getChild("color_b")?.toArray(), I = d.getChild("color_a")?.toArray(), U = P.getChild("x")?.toArray(), S = P.getChild("y")?.toArray(), K = P.getChild("z")?.toArray(), at = P.getChild("nx")?.toArray(), j = P.getChild("ny")?.toArray(), tt = P.getChild("nz")?.toArray(), R = T.getChild("i0")?.toArray(), G = T.getChild("i1")?.toArray(), V = T.getChild("i2")?.toArray(), mt = k.length, ht = new Array(mt);
|
|
57
|
-
for(let q = 0; q < mt; q++){
|
|
58
|
-
const W = M[q], et = L[q], B = z[q], nt = x[q], ot = new Float32Array(et * 3);
|
|
59
|
-
for(let h = 0; h < et; h++){
|
|
60
|
-
const F = W + h;
|
|
61
|
-
ot[h * 3] = U[F], ot[h * 3 + 1] = S[F], ot[h * 3 + 2] = K[F];
|
|
62
|
-
}
|
|
63
|
-
const X = new Float32Array(et * 3);
|
|
64
|
-
for(let h = 0; h < et; h++){
|
|
65
|
-
const F = W + h;
|
|
66
|
-
X[h * 3] = at[F], X[h * 3 + 1] = j[F], X[h * 3 + 2] = tt[F];
|
|
67
|
-
}
|
|
68
|
-
const ut = nt / 3, pt = B / 3, H = new Uint32Array(nt);
|
|
69
|
-
for(let h = 0; h < ut; h++){
|
|
70
|
-
const F = pt + h;
|
|
71
|
-
H[h * 3] = R[F], H[h * 3 + 1] = G[F], H[h * 3 + 2] = V[F];
|
|
72
|
-
}
|
|
73
|
-
ht[q] = {
|
|
74
|
-
express_id: k[q],
|
|
75
|
-
ifc_type: E?.get(q) ?? "Unknown",
|
|
76
|
-
positions: ot,
|
|
77
|
-
normals: X,
|
|
78
|
-
indices: H,
|
|
79
|
-
color: [
|
|
80
|
-
_[q],
|
|
81
|
-
v[q],
|
|
82
|
-
b[q],
|
|
83
|
-
I[q]
|
|
84
|
-
]
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
return ht;
|
|
88
|
-
}
|
|
89
|
-
async function bt() {
|
|
90
|
-
try {
|
|
91
|
-
return await Ct(), !0;
|
|
92
|
-
} catch (s) {
|
|
93
|
-
return console.warn("[parquet-decoder] Parquet WASM initialization failed:", s), !1;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
async function Zt(s, t = 1e4) {
|
|
97
|
-
const n = await Ct(), o = await ft(()=>import("./arrow-CXWhTnNT.js").then((O)=>O.A), []), a = new DataView(s);
|
|
98
|
-
let e = 0;
|
|
99
|
-
const i = a.getUint8(e);
|
|
100
|
-
if (e += 1, i !== 2) throw new Error(`Unsupported optimized Parquet version: ${i}`);
|
|
101
|
-
const l = a.getUint8(e);
|
|
102
|
-
e += 1;
|
|
103
|
-
const c = (l & 1) !== 0, m = a.getUint32(e, !0);
|
|
104
|
-
e += 4;
|
|
105
|
-
const f = a.getUint32(e, !0);
|
|
106
|
-
e += 4;
|
|
107
|
-
const g = a.getUint32(e, !0);
|
|
108
|
-
e += 4;
|
|
109
|
-
const C = a.getUint32(e, !0);
|
|
110
|
-
e += 4;
|
|
111
|
-
const u = a.getUint32(e, !0);
|
|
112
|
-
e += 4;
|
|
113
|
-
const d = new Uint8Array(s, e, m);
|
|
114
|
-
e += m;
|
|
115
|
-
const P = new Uint8Array(s, e, f);
|
|
116
|
-
e += f;
|
|
117
|
-
const T = new Uint8Array(s, e, g);
|
|
118
|
-
e += g;
|
|
119
|
-
const k = new Uint8Array(s, e, C);
|
|
120
|
-
e += C;
|
|
121
|
-
const E = new Uint8Array(s, e, u), M = n.readParquet(d), L = n.readParquet(P), z = n.readParquet(T), x = n.readParquet(k), _ = n.readParquet(E), v = o.tableFromIPC(M.intoIPCStream()), b = o.tableFromIPC(L.intoIPCStream()), I = o.tableFromIPC(z.intoIPCStream()), U = o.tableFromIPC(x.intoIPCStream()), S = o.tableFromIPC(_.intoIPCStream()), K = v.getChild("entity_id")?.toArray(), at = v.getChild("ifc_type"), j = v.getChild("mesh_index")?.toArray(), tt = v.getChild("material_index")?.toArray(), R = b.getChild("vertex_offset")?.toArray(), G = b.getChild("vertex_count")?.toArray(), V = b.getChild("index_offset")?.toArray(), mt = b.getChild("index_count")?.toArray(), ht = I.getChild("r")?.toArray(), q = I.getChild("g")?.toArray(), W = I.getChild("b")?.toArray(), et = I.getChild("a")?.toArray(), B = U.getChild("x")?.toArray(), nt = U.getChild("y")?.toArray(), ot = U.getChild("z")?.toArray(), X = c ? U.getChild("nx")?.toArray() : null, ut = c ? U.getChild("ny")?.toArray() : null, pt = c ? U.getChild("nz")?.toArray() : null, H = S.getChild("i")?.toArray(), h = K.length, F = new Array(h), st = 1 / t;
|
|
122
|
-
for(let O = 0; O < h; O++){
|
|
123
|
-
const it = j[O], N = tt[O], y = R[it], ct = G[it], gt = V[it], yt = mt[it], lt = new Float32Array(ct * 3);
|
|
124
|
-
for(let A = 0; A < ct; A++){
|
|
125
|
-
const Y = y + A;
|
|
126
|
-
lt[A * 3] = B[Y] * st, lt[A * 3 + 1] = nt[Y] * st, lt[A * 3 + 2] = ot[Y] * st;
|
|
127
|
-
}
|
|
128
|
-
let J;
|
|
129
|
-
if (c && X && ut && pt) {
|
|
130
|
-
J = new Float32Array(ct * 3);
|
|
131
|
-
for(let A = 0; A < ct; A++){
|
|
132
|
-
const Y = y + A;
|
|
133
|
-
J[A * 3] = X[Y], J[A * 3 + 1] = ut[Y], J[A * 3 + 2] = pt[Y];
|
|
134
|
-
}
|
|
135
|
-
} else J = Qt(lt, H.slice(gt, gt + yt));
|
|
136
|
-
const wt = new Uint32Array(yt);
|
|
137
|
-
for(let A = 0; A < yt; A++)wt[A] = H[gt + A];
|
|
138
|
-
F[O] = {
|
|
139
|
-
express_id: K[O],
|
|
140
|
-
ifc_type: at?.get(O) ?? "Unknown",
|
|
141
|
-
positions: lt,
|
|
142
|
-
normals: J,
|
|
143
|
-
indices: wt,
|
|
144
|
-
color: [
|
|
145
|
-
ht[N] / 255,
|
|
146
|
-
q[N] / 255,
|
|
147
|
-
W[N] / 255,
|
|
148
|
-
et[N] / 255
|
|
149
|
-
]
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
return F;
|
|
153
|
-
}
|
|
154
|
-
function Qt(s, t) {
|
|
155
|
-
const n = s.length / 3, o = new Float32Array(n * 3).fill(0), a = t.length / 3;
|
|
156
|
-
for(let e = 0; e < a; e++){
|
|
157
|
-
const i = t[e * 3], l = t[e * 3 + 1], c = t[e * 3 + 2], m = s[i * 3], f = s[i * 3 + 1], g = s[i * 3 + 2], C = s[l * 3], u = s[l * 3 + 1], d = s[l * 3 + 2], P = s[c * 3], T = s[c * 3 + 1], k = s[c * 3 + 2], E = C - m, M = u - f, L = d - g, z = P - m, x = T - f, _ = k - g, v = M * _ - L * x, b = L * z - E * _, I = E * x - M * z;
|
|
158
|
-
o[i * 3] += v, o[i * 3 + 1] += b, o[i * 3 + 2] += I, o[l * 3] += v, o[l * 3 + 1] += b, o[l * 3 + 2] += I, o[c * 3] += v, o[c * 3 + 1] += b, o[c * 3 + 2] += I;
|
|
159
|
-
}
|
|
160
|
-
for(let e = 0; e < n; e++){
|
|
161
|
-
const i = o[e * 3], l = o[e * 3 + 1], c = o[e * 3 + 2], m = Math.sqrt(i * i + l * l + c * c);
|
|
162
|
-
m > 0 && (o[e * 3] /= m, o[e * 3 + 1] /= m, o[e * 3 + 2] /= m);
|
|
163
|
-
}
|
|
164
|
-
return o;
|
|
165
|
-
}
|
|
166
|
-
async function Pt(s) {
|
|
167
|
-
const t = s instanceof File ? s.stream() : new Blob([
|
|
168
|
-
s
|
|
169
|
-
]).stream(), n = new CompressionStream("gzip"), o = t.pipeThrough(n);
|
|
170
|
-
return new Response(o).blob();
|
|
171
|
-
}
|
|
172
|
-
async function Mt(s) {
|
|
173
|
-
const t = s instanceof File ? await s.arrayBuffer() : s, n = await crypto.subtle.digest("SHA-256", t);
|
|
174
|
-
return Array.from(new Uint8Array(n)).map((o)=>o.toString(16).padStart(2, "0")).join("");
|
|
175
|
-
}
|
|
176
|
-
te = class {
|
|
177
|
-
constructor(t){
|
|
178
|
-
this.baseUrl = t.baseUrl.replace(/\/$/, ""), this.timeout = t.timeout ?? 3e5;
|
|
179
|
-
}
|
|
180
|
-
async health() {
|
|
181
|
-
const t = await fetch(`${this.baseUrl}/api/v1/health`, {
|
|
182
|
-
signal: AbortSignal.timeout(this.timeout)
|
|
183
|
-
});
|
|
184
|
-
if (!t.ok) throw await this.handleError(t);
|
|
185
|
-
return t.json();
|
|
186
|
-
}
|
|
187
|
-
async parse(t) {
|
|
188
|
-
const n = await Pt(t), o = t instanceof File ? t.name : "model.ifc", a = new FormData;
|
|
189
|
-
a.append("file", n, o);
|
|
190
|
-
const e = await fetch(`${this.baseUrl}/api/v1/parse`, {
|
|
191
|
-
method: "POST",
|
|
192
|
-
body: a,
|
|
193
|
-
signal: AbortSignal.timeout(this.timeout)
|
|
194
|
-
});
|
|
195
|
-
if (!e.ok) throw await this.handleError(e);
|
|
196
|
-
return e.json();
|
|
197
|
-
}
|
|
198
|
-
async parseParquet(t) {
|
|
199
|
-
if (!await bt()) throw new Error("Parquet parsing requires parquet-wasm and apache-arrow. Install them with: npm install parquet-wasm apache-arrow");
|
|
200
|
-
const o = performance.now(), a = await Mt(t), e = performance.now() - o;
|
|
201
|
-
console.log(`[client] Computed file hash in ${e.toFixed(0)}ms: ${a.substring(0, 16)}...`);
|
|
202
|
-
const i = performance.now(), l = await fetch(`${this.baseUrl}/api/v1/cache/check/${a}`, {
|
|
203
|
-
method: "GET",
|
|
204
|
-
signal: AbortSignal.timeout(5e3)
|
|
205
|
-
}), c = performance.now() - i;
|
|
206
|
-
return l.ok ? (console.log(`[client] Cache HIT (check: ${c.toFixed(0)}ms) - skipping upload`), this.fetchCachedGeometry(a)) : (console.log(`[client] Cache MISS (check: ${c.toFixed(0)}ms) - uploading file`), this.uploadAndProcessParquet(t, a));
|
|
207
|
-
}
|
|
208
|
-
async parseParquetStream(t, n) {
|
|
209
|
-
if (!await bt()) throw new Error("Parquet streaming requires parquet-wasm and apache-arrow. Install them with: npm install parquet-wasm apache-arrow");
|
|
210
|
-
const a = t instanceof File ? t.size : t.byteLength, e = t instanceof File ? t.name : "model.ifc", i = performance.now(), l = await Mt(t), c = performance.now() - i;
|
|
211
|
-
console.log(`[client] Stream: computed hash in ${c.toFixed(0)}ms: ${l.substring(0, 16)}...`);
|
|
212
|
-
const m = performance.now(), f = await fetch(`${this.baseUrl}/api/v1/cache/check/${l}`, {
|
|
213
|
-
method: "GET",
|
|
214
|
-
signal: AbortSignal.timeout(5e3)
|
|
215
|
-
}), g = performance.now() - m;
|
|
216
|
-
if (f.ok) {
|
|
217
|
-
console.log(`[client] Stream: Cache HIT (check: ${g.toFixed(0)}ms) - fetching cached geometry`);
|
|
218
|
-
const _ = await this.fetchCachedGeometry(l), v = performance.now();
|
|
219
|
-
n({
|
|
220
|
-
meshes: _.meshes,
|
|
221
|
-
batch_number: 1,
|
|
222
|
-
decode_time_ms: performance.now() - v
|
|
223
|
-
});
|
|
224
|
-
let b = null;
|
|
225
|
-
try {
|
|
226
|
-
b = await this.fetchSymbolic(_.cache_key);
|
|
227
|
-
} catch (I) {
|
|
228
|
-
console.warn("[client] Symbolic fetch failed on cache hit; continuing without symbols:", I);
|
|
229
|
-
}
|
|
230
|
-
return {
|
|
231
|
-
cache_key: _.cache_key,
|
|
232
|
-
total_meshes: _.meshes.length,
|
|
233
|
-
stats: _.stats,
|
|
234
|
-
metadata: _.metadata,
|
|
235
|
-
symbolic_data: b ?? void 0
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
console.log(`[client] Stream: Cache MISS (check: ${g.toFixed(0)}ms) - starting stream for ${e} (${(a / 1024 / 1024).toFixed(1)}MB)`);
|
|
239
|
-
const C = new FormData;
|
|
240
|
-
C.append("file", t instanceof File ? t : new Blob([
|
|
241
|
-
t
|
|
242
|
-
]), e);
|
|
243
|
-
const u = performance.now(), d = await fetch(`${this.baseUrl}/api/v1/parse/parquet-stream`, {
|
|
244
|
-
method: "POST",
|
|
245
|
-
body: C,
|
|
246
|
-
signal: AbortSignal.timeout(this.timeout)
|
|
247
|
-
});
|
|
248
|
-
if (!d.ok) throw await this.handleError(d);
|
|
249
|
-
if (!d.body) throw new Error("No response body for streaming");
|
|
250
|
-
const P = d.body.getReader(), T = new TextDecoder;
|
|
251
|
-
let k = "", E = "", M = 0, L = null, z = null, x;
|
|
252
|
-
for(;;){
|
|
253
|
-
const { done: _, value: v } = await P.read();
|
|
254
|
-
if (_) break;
|
|
255
|
-
k += T.decode(v, {
|
|
256
|
-
stream: !0
|
|
257
|
-
});
|
|
258
|
-
const b = k.split(`
|
|
259
|
-
`);
|
|
260
|
-
k = b.pop() || "";
|
|
261
|
-
for (const I of b){
|
|
262
|
-
if (!I.startsWith("data:")) continue;
|
|
263
|
-
const U = I.slice(5).trim();
|
|
264
|
-
if (U) try {
|
|
265
|
-
const S = JSON.parse(U);
|
|
266
|
-
switch(S.type){
|
|
267
|
-
case "start":
|
|
268
|
-
E = S.cache_key, console.log(`[client] Stream started: ${S.total_estimate} entities, cache_key: ${E.substring(0, 16)}...`);
|
|
269
|
-
break;
|
|
270
|
-
case "progress":
|
|
271
|
-
break;
|
|
272
|
-
case "batch":
|
|
273
|
-
{
|
|
274
|
-
const at = performance.now(), j = atob(S.data), tt = new Uint8Array(j.length);
|
|
275
|
-
for(let V = 0; V < j.length; V++)tt[V] = j.charCodeAt(V);
|
|
276
|
-
const R = await Dt(tt.buffer), G = performance.now() - at;
|
|
277
|
-
M += R.length, console.log(`[client] Batch #${S.batch_number}: ${R.length} meshes, decode: ${G.toFixed(0)}ms`), n({
|
|
278
|
-
meshes: R,
|
|
279
|
-
batch_number: S.batch_number,
|
|
280
|
-
decode_time_ms: G
|
|
281
|
-
});
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
case "complete":
|
|
285
|
-
L = S.stats, z = S.metadata, x = S.symbolic_data;
|
|
286
|
-
const K = performance.now() - u;
|
|
287
|
-
console.log(`[client] Stream complete: ${M} meshes in ${K.toFixed(0)}ms`);
|
|
288
|
-
break;
|
|
289
|
-
case "error":
|
|
290
|
-
throw new Error(`Stream error: ${S.message}`);
|
|
291
|
-
}
|
|
292
|
-
} catch (S) {
|
|
293
|
-
if (S instanceof SyntaxError) console.warn("[client] Failed to parse SSE event:", U);
|
|
294
|
-
else throw S;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
if (!L || !z) throw new Error("Stream ended without complete event");
|
|
299
|
-
return {
|
|
300
|
-
cache_key: E,
|
|
301
|
-
total_meshes: M,
|
|
302
|
-
stats: L,
|
|
303
|
-
metadata: z,
|
|
304
|
-
symbolic_data: x
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
async fetchCachedGeometry(t) {
|
|
308
|
-
const n = performance.now(), o = await fetch(`${this.baseUrl}/api/v1/cache/geometry/${t}`, {
|
|
309
|
-
method: "GET",
|
|
310
|
-
signal: AbortSignal.timeout(this.timeout)
|
|
311
|
-
});
|
|
312
|
-
if (!o.ok) throw await this.handleError(o);
|
|
313
|
-
const a = performance.now() - n;
|
|
314
|
-
console.log(`[client] Fetched cached geometry in ${a.toFixed(0)}ms`);
|
|
315
|
-
const e = o.headers.get("X-IFC-Metadata");
|
|
316
|
-
if (!e) throw new Error("Missing X-IFC-Metadata header in cached geometry response");
|
|
317
|
-
const i = JSON.parse(e), l = await o.arrayBuffer(), c = l.byteLength;
|
|
318
|
-
return this.parseParquetResponse(l, i, c);
|
|
319
|
-
}
|
|
320
|
-
async uploadAndProcessParquet(t, n) {
|
|
321
|
-
const o = t instanceof File ? t.size : t.byteLength, a = t instanceof File ? t.name : "model.ifc", e = this.baseUrl.includes("localhost") || this.baseUrl.includes("127.0.0.1"), i = o > 50 * 1024 * 1024 || e;
|
|
322
|
-
let l;
|
|
323
|
-
if (i) console.log(`[client] Skipping compression (file: ${(o / 1024 / 1024).toFixed(1)}MB, localhost: ${e})`), l = t instanceof File ? t : new Blob([
|
|
324
|
-
t
|
|
325
|
-
]);
|
|
326
|
-
else {
|
|
327
|
-
const T = performance.now();
|
|
328
|
-
l = await Pt(t), console.log(`[client] Compressed in ${(performance.now() - T).toFixed(0)}ms: ${(o / 1024 / 1024).toFixed(1)}MB → ${(l.size / 1024 / 1024).toFixed(1)}MB`);
|
|
329
|
-
}
|
|
330
|
-
const c = new FormData;
|
|
331
|
-
c.append("file", l, a);
|
|
332
|
-
const m = performance.now(), f = await fetch(`${this.baseUrl}/api/v1/parse/parquet`, {
|
|
333
|
-
method: "POST",
|
|
334
|
-
body: c,
|
|
335
|
-
signal: AbortSignal.timeout(this.timeout)
|
|
336
|
-
}), g = performance.now() - m;
|
|
337
|
-
if (console.log(`[client] Upload and processing completed in ${g.toFixed(0)}ms`), !f.ok) throw await this.handleError(f);
|
|
338
|
-
const C = f.headers.get("X-IFC-Metadata");
|
|
339
|
-
if (!C) throw new Error("Missing X-IFC-Metadata header in Parquet response");
|
|
340
|
-
const u = JSON.parse(C);
|
|
341
|
-
u.cache_key !== n && console.warn(`[client] Cache key mismatch: expected ${n.substring(0, 16)}..., got ${u.cache_key.substring(0, 16)}...`);
|
|
342
|
-
const d = await f.arrayBuffer(), P = d.byteLength;
|
|
343
|
-
return this.parseParquetResponse(d, u, P);
|
|
344
|
-
}
|
|
345
|
-
async parseParquetResponse(t, n, o) {
|
|
346
|
-
const a = new DataView(t);
|
|
347
|
-
let e = 0;
|
|
348
|
-
const i = a.getUint32(0, !0), l = i > 0 && i < t.byteLength && i < t.byteLength - 4;
|
|
349
|
-
let c, m;
|
|
350
|
-
if (l) {
|
|
351
|
-
const u = i;
|
|
352
|
-
if (e += 4, u > t.byteLength || u === 0 || e + u > t.byteLength) throw new Error(`Invalid geometry length: ${u}, buffer size: ${t.byteLength}, offset: ${e}`);
|
|
353
|
-
if (c = t.slice(e, e + u), e += u, e < t.byteLength) {
|
|
354
|
-
const d = a.getUint32(e, !0);
|
|
355
|
-
e += 4, d > 0 && e + d <= t.byteLength && (m = t.slice(e, e + d));
|
|
356
|
-
}
|
|
357
|
-
} else console.log("[client] Detected old format (no wrapper), using entire payload as geometry"), c = t, m = void 0;
|
|
358
|
-
const f = performance.now(), g = await Dt(c), C = performance.now() - f;
|
|
359
|
-
return {
|
|
360
|
-
cache_key: n.cache_key,
|
|
361
|
-
meshes: g,
|
|
362
|
-
mesh_coordinate_space: n.mesh_coordinate_space,
|
|
363
|
-
site_transform: n.site_transform,
|
|
364
|
-
building_transform: n.building_transform,
|
|
365
|
-
metadata: n.metadata,
|
|
366
|
-
stats: n.stats,
|
|
367
|
-
parquet_stats: {
|
|
368
|
-
payload_size: o,
|
|
369
|
-
decode_time_ms: Math.round(C)
|
|
370
|
-
},
|
|
371
|
-
data_model: m
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
|
-
async fetchDataModel(t, n = 10) {
|
|
375
|
-
let o = 100;
|
|
376
|
-
for(let a = 0; a < n; a++)try {
|
|
377
|
-
const e = await fetch(`${this.baseUrl}/api/v1/parse/data-model/${t}`, {
|
|
378
|
-
method: "GET",
|
|
379
|
-
signal: AbortSignal.timeout(3e4)
|
|
380
|
-
});
|
|
381
|
-
if (e.status === 200) {
|
|
382
|
-
const i = await e.arrayBuffer();
|
|
383
|
-
return console.log(`[client] Data model fetched: ${(i.byteLength / 1024 / 1024).toFixed(2)}MB`), i;
|
|
384
|
-
} else if (e.status === 202) console.log(`[client] Data model still processing (attempt ${a + 1}/${n}), waiting ${o}ms...`), await new Promise((i)=>setTimeout(i, o)), o = Math.min(o * 1.5, 2e3);
|
|
385
|
-
else {
|
|
386
|
-
if (e.status === 404) return console.warn(`[client] Data model not found for cache key: ${t}`), null;
|
|
387
|
-
throw new Error(`Unexpected response status: ${e.status}`);
|
|
388
|
-
}
|
|
389
|
-
} catch (e) {
|
|
390
|
-
if (a === n - 1) return console.error("[client] Failed to fetch data model:", e), null;
|
|
391
|
-
await new Promise((i)=>setTimeout(i, o)), o = Math.min(o * 1.5, 2e3);
|
|
392
|
-
}
|
|
393
|
-
return console.warn("[client] Data model fetch timed out after max retries"), null;
|
|
394
|
-
}
|
|
395
|
-
async fetchSymbolic(t, n = 10) {
|
|
396
|
-
let o = 100;
|
|
397
|
-
for(let a = 0; a < n; a++){
|
|
398
|
-
let e;
|
|
399
|
-
try {
|
|
400
|
-
e = await fetch(`${this.baseUrl}/api/v1/parse/symbolic/${t}`, {
|
|
401
|
-
method: "GET",
|
|
402
|
-
signal: AbortSignal.timeout(3e4)
|
|
403
|
-
});
|
|
404
|
-
} catch (i) {
|
|
405
|
-
if (a === n - 1) throw i;
|
|
406
|
-
console.warn("[client] Retrying symbolic data fetch after network error:", i), await new Promise((l)=>setTimeout(l, o)), o = Math.min(o * 1.5, 2e3);
|
|
407
|
-
continue;
|
|
408
|
-
}
|
|
409
|
-
if (e.status === 200) return await e.json();
|
|
410
|
-
if (e.status === 202) await new Promise((i)=>setTimeout(i, o)), o = Math.min(o * 1.5, 2e3);
|
|
411
|
-
else {
|
|
412
|
-
if (e.status === 404) return console.warn(`[client] Symbolic data not found for cache key: ${t}`), null;
|
|
413
|
-
throw await this.handleError(e);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
return console.warn("[client] Symbolic data fetch timed out after max retries"), null;
|
|
417
|
-
}
|
|
418
|
-
async isParquetSupported() {
|
|
419
|
-
return bt();
|
|
420
|
-
}
|
|
421
|
-
async parseParquetOptimized(t) {
|
|
422
|
-
if (!await bt()) throw new Error("Parquet parsing requires parquet-wasm and apache-arrow. Install them with: npm install parquet-wasm apache-arrow");
|
|
423
|
-
const o = await Pt(t), a = t instanceof File ? t.name : "model.ifc", e = new FormData;
|
|
424
|
-
e.append("file", o, a);
|
|
425
|
-
const i = await fetch(`${this.baseUrl}/api/v1/parse/parquet/optimized`, {
|
|
426
|
-
method: "POST",
|
|
427
|
-
body: e,
|
|
428
|
-
signal: AbortSignal.timeout(this.timeout)
|
|
429
|
-
});
|
|
430
|
-
if (!i.ok) throw await this.handleError(i);
|
|
431
|
-
const l = i.headers.get("X-IFC-Metadata");
|
|
432
|
-
if (!l) throw new Error("Missing X-IFC-Metadata header in optimized Parquet response");
|
|
433
|
-
const c = JSON.parse(l), m = await i.arrayBuffer(), f = m.byteLength, g = performance.now(), C = await Zt(m, c.vertex_multiplier), u = performance.now() - g;
|
|
434
|
-
return {
|
|
435
|
-
cache_key: c.cache_key,
|
|
436
|
-
meshes: C,
|
|
437
|
-
mesh_coordinate_space: c.mesh_coordinate_space,
|
|
438
|
-
site_transform: c.site_transform,
|
|
439
|
-
building_transform: c.building_transform,
|
|
440
|
-
metadata: c.metadata,
|
|
441
|
-
stats: c.stats,
|
|
442
|
-
optimization_stats: c.optimization_stats,
|
|
443
|
-
parquet_stats: {
|
|
444
|
-
payload_size: f,
|
|
445
|
-
decode_time_ms: Math.round(u)
|
|
446
|
-
}
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
async *parseStream(t) {
|
|
450
|
-
const n = new FormData, o = t instanceof File ? t : new Blob([
|
|
451
|
-
t
|
|
452
|
-
], {
|
|
453
|
-
type: "application/octet-stream"
|
|
454
|
-
});
|
|
455
|
-
n.append("file", o, t instanceof File ? t.name : "model.ifc");
|
|
456
|
-
const a = await fetch(`${this.baseUrl}/api/v1/parse/stream`, {
|
|
457
|
-
method: "POST",
|
|
458
|
-
body: n,
|
|
459
|
-
headers: {
|
|
460
|
-
Accept: "text/event-stream"
|
|
461
|
-
}
|
|
462
|
-
});
|
|
463
|
-
if (!a.ok) throw await this.handleError(a);
|
|
464
|
-
if (!a.body) throw new Error("Response body is null");
|
|
465
|
-
const e = a.body.getReader(), i = new TextDecoder;
|
|
466
|
-
let l = "";
|
|
467
|
-
try {
|
|
468
|
-
for(;;){
|
|
469
|
-
const { done: c, value: m } = await e.read();
|
|
470
|
-
if (c) break;
|
|
471
|
-
l += i.decode(m, {
|
|
472
|
-
stream: !0
|
|
473
|
-
});
|
|
474
|
-
const f = l.split(`
|
|
475
|
-
|
|
476
|
-
`);
|
|
477
|
-
l = f.pop() || "";
|
|
478
|
-
for (const g of f)if (g.startsWith("data: ")) try {
|
|
479
|
-
yield JSON.parse(g.slice(6));
|
|
480
|
-
} catch {}
|
|
481
|
-
}
|
|
482
|
-
if (l.startsWith("data: ")) try {
|
|
483
|
-
yield JSON.parse(l.slice(6));
|
|
484
|
-
} catch {}
|
|
485
|
-
} finally{
|
|
486
|
-
e.releaseLock();
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
async getMetadata(t) {
|
|
490
|
-
const n = new FormData;
|
|
491
|
-
n.append("file", t instanceof File ? t : new Blob([
|
|
492
|
-
t
|
|
493
|
-
]), t instanceof File ? t.name : "model.ifc");
|
|
494
|
-
const o = await fetch(`${this.baseUrl}/api/v1/parse/metadata`, {
|
|
495
|
-
method: "POST",
|
|
496
|
-
body: n,
|
|
497
|
-
signal: AbortSignal.timeout(3e4)
|
|
498
|
-
});
|
|
499
|
-
if (!o.ok) throw await this.handleError(o);
|
|
500
|
-
return o.json();
|
|
501
|
-
}
|
|
502
|
-
async getCached(t) {
|
|
503
|
-
const n = await fetch(`${this.baseUrl}/api/v1/cache/${t}`, {
|
|
504
|
-
signal: AbortSignal.timeout(this.timeout)
|
|
505
|
-
});
|
|
506
|
-
if (n.status === 404) return null;
|
|
507
|
-
if (!n.ok) throw await this.handleError(n);
|
|
508
|
-
return n.json();
|
|
509
|
-
}
|
|
510
|
-
async handleError(t) {
|
|
511
|
-
try {
|
|
512
|
-
const n = await t.json();
|
|
513
|
-
return new Error(`Server error (${n.code}): ${n.error}`);
|
|
514
|
-
} catch {
|
|
515
|
-
return new Error(`Server error: ${t.status} ${t.statusText}`);
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
};
|
|
519
|
-
ee = async function(s) {
|
|
520
|
-
const t = await Ct(), n = await ft(()=>import("./arrow-CXWhTnNT.js").then((r)=>r.A), []), o = new DataView(s);
|
|
521
|
-
let a = 0;
|
|
522
|
-
const e = o.getUint32(a, !0);
|
|
523
|
-
a += 4;
|
|
524
|
-
const i = new Uint8Array(s, a, e);
|
|
525
|
-
a += e;
|
|
526
|
-
const l = o.getUint32(a, !0);
|
|
527
|
-
a += 4;
|
|
528
|
-
const c = new Uint8Array(s, a, l);
|
|
529
|
-
a += l;
|
|
530
|
-
const m = o.getUint32(a, !0);
|
|
531
|
-
a += 4;
|
|
532
|
-
const f = new Uint8Array(s, a, m);
|
|
533
|
-
a += m;
|
|
534
|
-
const g = o.getUint32(a, !0);
|
|
535
|
-
a += 4;
|
|
536
|
-
const C = new Uint8Array(s, a, g);
|
|
537
|
-
a += g;
|
|
538
|
-
const u = o.getUint32(a, !0);
|
|
539
|
-
a += 4;
|
|
540
|
-
const d = new Uint8Array(s, a, u);
|
|
541
|
-
a += u;
|
|
542
|
-
const P = ()=>{
|
|
543
|
-
if (a + 4 > s.byteLength) return null;
|
|
544
|
-
const r = o.getUint32(a, !0);
|
|
545
|
-
if (a += 4, r === 0 || a + r > s.byteLength) throw new Error(`Malformed data model: truncated appended section (len=${r}, remaining=${s.byteLength - a})`);
|
|
546
|
-
const p = new Uint8Array(s, a, r);
|
|
547
|
-
return a += r, p;
|
|
548
|
-
}, T = P(), k = P(), E = P(), M = t.readParquet(i), L = t.readParquet(c), z = t.readParquet(C), x = n.tableFromIPC(M.intoIPCStream()), _ = n.tableFromIPC(L.intoIPCStream()), v = n.tableFromIPC(z.intoIPCStream()), b = x.getChild("entity_id")?.toArray(), I = x.getChild("has_geometry")?.toArray(), U = x.getChild("type_name")?.toArray(), S = x.getChild("global_id")?.toArray(), K = x.getChild("name")?.toArray(), at = x.getChild("description")?.toArray(), j = x.getChild("object_type")?.toArray(), tt = b.length, R = new Map;
|
|
549
|
-
for(let r = 0; r < tt; r++)R.set(b[r], {
|
|
550
|
-
entity_id: b[r],
|
|
551
|
-
type_name: U[r] ?? "",
|
|
552
|
-
global_id: S[r] || void 0,
|
|
553
|
-
name: K[r] || void 0,
|
|
554
|
-
description: at?.[r] || void 0,
|
|
555
|
-
object_type: j?.[r] || void 0,
|
|
556
|
-
has_geometry: I[r] !== 0
|
|
557
|
-
});
|
|
558
|
-
const G = _.getChild("pset_id")?.toArray(), V = _.getChild("pset_name")?.toArray(), mt = _.getChild("property_name")?.toArray(), ht = _.getChild("property_value")?.toArray(), q = _.getChild("property_type")?.toArray(), W = new Map;
|
|
559
|
-
for(let r = 0; r < G.length; r++){
|
|
560
|
-
const p = G[r];
|
|
561
|
-
W.has(p) || W.set(p, {
|
|
562
|
-
pset_id: p,
|
|
563
|
-
pset_name: V[r] ?? "",
|
|
564
|
-
properties: []
|
|
565
|
-
}), W.get(p).properties.push({
|
|
566
|
-
property_name: mt[r] ?? "",
|
|
567
|
-
property_value: ht[r] ?? "",
|
|
568
|
-
property_type: q[r] ?? ""
|
|
569
|
-
});
|
|
570
|
-
}
|
|
571
|
-
const et = t.readParquet(f), B = n.tableFromIPC(et.intoIPCStream()), nt = B.getChild("qset_id")?.toArray(), ot = B.getChild("qset_name")?.toArray(), X = B.getChild("method_of_measurement")?.toArray(), ut = B.getChild("quantity_name")?.toArray(), pt = B.getChild("quantity_value")?.toArray(), H = B.getChild("quantity_type")?.toArray(), h = new Map;
|
|
572
|
-
for(let r = 0; r < nt.length; r++){
|
|
573
|
-
const p = nt[r];
|
|
574
|
-
h.has(p) || h.set(p, {
|
|
575
|
-
qset_id: p,
|
|
576
|
-
qset_name: ot[r] ?? "",
|
|
577
|
-
method_of_measurement: X[r] || void 0,
|
|
578
|
-
quantities: []
|
|
579
|
-
}), h.get(p).quantities.push({
|
|
580
|
-
quantity_name: ut[r] ?? "",
|
|
581
|
-
quantity_value: pt[r] ?? 0,
|
|
582
|
-
quantity_type: H[r] ?? ""
|
|
583
|
-
});
|
|
584
|
-
}
|
|
585
|
-
const F = v.getChild("rel_type")?.toArray(), st = v.getChild("relating_id")?.toArray(), O = v.getChild("related_id")?.toArray(), it = new Array(st.length);
|
|
586
|
-
for(let r = 0; r < st.length; r++)it[r] = {
|
|
587
|
-
rel_type: F[r] ?? "",
|
|
588
|
-
relating_id: st[r],
|
|
589
|
-
related_id: O[r]
|
|
590
|
-
};
|
|
591
|
-
const N = new DataView(d.buffer, d.byteOffset, d.byteLength);
|
|
592
|
-
let y = 0;
|
|
593
|
-
const ct = N.getUint32(y, !0);
|
|
594
|
-
y += 4;
|
|
595
|
-
const gt = new Uint8Array(d.buffer, d.byteOffset + y, ct);
|
|
596
|
-
y += ct;
|
|
597
|
-
const yt = N.getUint32(y, !0);
|
|
598
|
-
y += 4;
|
|
599
|
-
const lt = new Uint8Array(d.buffer, d.byteOffset + y, yt);
|
|
600
|
-
y += yt;
|
|
601
|
-
const J = N.getUint32(y, !0);
|
|
602
|
-
y += 4;
|
|
603
|
-
const wt = new Uint8Array(d.buffer, d.byteOffset + y, J);
|
|
604
|
-
y += J;
|
|
605
|
-
const A = N.getUint32(y, !0);
|
|
606
|
-
y += 4;
|
|
607
|
-
const Y = new Uint8Array(d.buffer, d.byteOffset + y, A);
|
|
608
|
-
y += A;
|
|
609
|
-
const vt = N.getUint32(y, !0);
|
|
610
|
-
y += 4;
|
|
611
|
-
const Lt = new Uint8Array(d.buffer, d.byteOffset + y, vt);
|
|
612
|
-
y += vt;
|
|
613
|
-
const zt = N.getUint32(y, !0), Ot = t.readParquet(gt), Z = n.tableFromIPC(Ot.intoIPCStream()), xt = Z.getChild("entity_id")?.toArray(), Nt = Z.getChild("parent_id")?.toArray(), Rt = Z.getChild("level")?.toArray(), Vt = Z.getChild("path")?.toArray(), Bt = Z.getChild("type_name")?.toArray(), jt = Z.getChild("name")?.toArray(), Gt = Z.getChild("elevation")?.toArray(), It = Z.getChild("children_ids"), Ft = Z.getChild("element_ids"), Tt = xt.length, Ut = new Array(Tt);
|
|
614
|
-
for(let r = 0; r < Tt; r++){
|
|
615
|
-
let p = [], D = [];
|
|
616
|
-
if (It) {
|
|
617
|
-
const $ = It.get(r);
|
|
618
|
-
$ && (p = [
|
|
619
|
-
...$.toArray()
|
|
620
|
-
]);
|
|
621
|
-
}
|
|
622
|
-
if (Ft) {
|
|
623
|
-
const $ = Ft.get(r);
|
|
624
|
-
$ && (D = [
|
|
625
|
-
...$.toArray()
|
|
626
|
-
]);
|
|
627
|
-
}
|
|
628
|
-
Ut[r] = {
|
|
629
|
-
entity_id: xt[r],
|
|
630
|
-
parent_id: Nt[r] ?? 0,
|
|
631
|
-
level: Rt[r],
|
|
632
|
-
path: Vt[r] ?? "",
|
|
633
|
-
type_name: Bt[r] ?? "",
|
|
634
|
-
name: jt[r] || void 0,
|
|
635
|
-
elevation: Gt[r] ?? void 0,
|
|
636
|
-
children_ids: p,
|
|
637
|
-
element_ids: D
|
|
638
|
-
};
|
|
639
|
-
}
|
|
640
|
-
const _t = (r)=>{
|
|
641
|
-
const p = t.readParquet(r), D = n.tableFromIPC(p.intoIPCStream()), $ = D.getChild("element_id")?.toArray(), dt = D.getChild("spatial_id")?.toArray(), rt = new Map;
|
|
642
|
-
for(let w = 0; w < $.length; w++)rt.set($[w], dt[w]);
|
|
643
|
-
return rt;
|
|
644
|
-
}, [Wt, Xt, Ht, Jt] = [
|
|
645
|
-
_t(lt),
|
|
646
|
-
_t(wt),
|
|
647
|
-
_t(Y),
|
|
648
|
-
_t(Lt)
|
|
649
|
-
], $t = [];
|
|
650
|
-
if (T) {
|
|
651
|
-
const r = n.tableFromIPC(t.readParquet(T).intoIPCStream()), p = r.getChild("element_id")?.toArray(), D = r.getChild("system_name")?.toArray(), $ = r.getChild("identification")?.toArray(), dt = r.getChild("name")?.toArray(), rt = r.getChild("location")?.toArray();
|
|
652
|
-
for(let w = 0; w < p.length; w++)$t.push({
|
|
653
|
-
element_id: p[w],
|
|
654
|
-
system_name: D?.[w] || void 0,
|
|
655
|
-
identification: $?.[w] || void 0,
|
|
656
|
-
name: dt?.[w] || void 0,
|
|
657
|
-
location: rt?.[w] || void 0
|
|
658
|
-
});
|
|
659
|
-
}
|
|
660
|
-
const kt = [];
|
|
661
|
-
if (k) {
|
|
662
|
-
const r = n.tableFromIPC(t.readParquet(k).intoIPCStream()), p = r.getChild("element_id")?.toArray(), D = r.getChild("set_name")?.toArray(), $ = r.getChild("layer_index")?.toArray(), dt = r.getChild("material_name")?.toArray(), rt = r.getChild("thickness")?.toArray(), w = r.getChild("is_ventilated"), Yt = r.getChild("category")?.toArray();
|
|
663
|
-
for(let Q = 0; Q < p.length; Q++){
|
|
664
|
-
const St = w?.get(Q);
|
|
665
|
-
kt.push({
|
|
666
|
-
element_id: p[Q],
|
|
667
|
-
set_name: D?.[Q] || void 0,
|
|
668
|
-
layer_index: $[Q],
|
|
669
|
-
material_name: dt?.[Q] ?? "",
|
|
670
|
-
thickness: rt?.[Q] ?? void 0,
|
|
671
|
-
is_ventilated: St == null ? void 0 : !!St,
|
|
672
|
-
category: Yt?.[Q] || void 0
|
|
673
|
-
});
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
const Et = [];
|
|
677
|
-
if (E) {
|
|
678
|
-
const r = n.tableFromIPC(t.readParquet(E).intoIPCStream()), p = r.getChild("element_id")?.toArray(), D = r.getChild("identification")?.toArray(), $ = r.getChild("name")?.toArray(), dt = r.getChild("location")?.toArray(), rt = r.getChild("description")?.toArray();
|
|
679
|
-
for(let w = 0; w < p.length; w++)Et.push({
|
|
680
|
-
element_id: p[w],
|
|
681
|
-
identification: D?.[w] || void 0,
|
|
682
|
-
name: $?.[w] || void 0,
|
|
683
|
-
location: dt?.[w] || void 0,
|
|
684
|
-
description: rt?.[w] || void 0
|
|
685
|
-
});
|
|
686
|
-
}
|
|
687
|
-
return {
|
|
688
|
-
entities: R,
|
|
689
|
-
propertySets: W,
|
|
690
|
-
quantitySets: h,
|
|
691
|
-
relationships: it,
|
|
692
|
-
classifications: $t,
|
|
693
|
-
materials: kt,
|
|
694
|
-
documents: Et,
|
|
695
|
-
spatialHierarchy: {
|
|
696
|
-
nodes: Ut,
|
|
697
|
-
project_id: zt,
|
|
698
|
-
element_to_storey: Wt,
|
|
699
|
-
element_to_building: Xt,
|
|
700
|
-
element_to_site: Ht,
|
|
701
|
-
element_to_space: Jt
|
|
702
|
-
}
|
|
703
|
-
};
|
|
704
|
-
};
|
|
705
|
-
});
|
|
706
|
-
export { te as I, ee as d, __tla };
|