| 100 | if (extract && typeof extract.zipHasSplitModelParts === 'function' && extract.zipHasSplitModelParts(names)) { |
| 101 | return true; |
| 102 | } |
| 103 | let modelBytes = 0; |
| 104 | for (let i = 0; i < names.length; i++) { |
| 105 | if (!names[i].toLowerCase().endsWith('.model')) continue; |
| 106 | const part = zip[names[i]]; |
| 107 | modelBytes += part && part.length ? part.length : 0; |
| 108 | if (modelBytes > FAST_3MF_XML_BYTES) return true; |
| 109 | } |
| 110 | return false; |
| 111 | } |
| 112 | |
| 113 | function parse3mfFastFromZip(zip) { |
| 114 | const extract = self.ThreeMFMeshExtract; |
| 115 | if (!extract || typeof extract.extractAllMeshesFast !== 'function') { |
| 116 | throw new Error('3MF fast extractor is not available'); |
| 117 | } |
| 118 | const names = zipKeys(zip); |
| 119 | const xmlParts = []; |
| 120 | for (let i = 0; i < names.length; i++) { |
| 121 | if (!names[i].toLowerCase().endsWith('.model')) continue; |
| 122 | xmlParts.push(decodeZipText(zip[names[i]])); |
| 123 | } |
| 124 | if (xmlParts.length === 0) { |