Merge pull request #400 from GridSpace/3mf-import-fix

fix 3mf import
This commit is contained in:
Stewart Allen 2025-07-08 09:21:36 -07:00 • committed by GitHub
commit d4e40b5792
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

7
src/ext/jszip.esm.js Normal file
View file

@ -0,0 +1,7 @@
/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
//import original library
import * as JSZip from "./jszip.js";
//export object attached to the window object
export default self.JSZip;

View file

@ -3,7 +3,7 @@
'use strict';
import { THREE } from '../ext/three.js';
import * as JSZip from '../ext/jszip.js';
import JSZip from '../ext/jszip.esm.js';
let { BufferAttribute, Matrix4 } = THREE;
@ -218,7 +218,7 @@ function extractItems(records) {
*/
export function parseAsync(data) {
return new Promise(async (resolve, reject) => {
let zip = await JSZip.default.loadAsync(data);
let zip = await JSZip.loadAsync(data);
let models = {};
for (let [key, value] of Object.entries(zip.files)) {
if (key.endsWith(".model")) {