(viewCount)
| 1290 | // Read file bytes via main process (same as 3D preview) — avoids fragile file:// fetch in the worker. |
| 1291 | let modelArrayBuffer = null; |
| 1292 | if (window.electron && typeof window.electron.readModelFile === 'function') { |
| 1293 | try { |
| 1294 | const raw = await window.electron.readModelFile(filePath); |
| 1295 | if (raw) { |
| 1296 | modelArrayBuffer = raw instanceof ArrayBuffer |
| 1297 | ? raw |
| 1298 | : raw.buffer |
| 1299 | ? raw.buffer.slice(raw.byteOffset, raw.byteOffset + raw.byteLength) |
| 1300 | : null; |
| 1301 | } |
| 1302 | } catch (e) { |
| 1303 | console.warn('loadModel: readModelFile failed, worker will use URL:', e); |
| 1304 | } |
| 1305 | } |
no test coverage detected