question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ThreeJs ThreeMF loader is blocking the UI while upzipping the 3MF file.

See original GitHub issue
Description of the problem

ThreeJs ThreeMF loader is blocking the UI while upzipping the 3MF file.

try {
	zip = new JSZip( data ); // eslint-disable-line no-undef
} catch ( e ) {
	if ( e instanceof ReferenceError ) {
		console.error( 'THREE.3MFLoader: jszip missing and file is compressed.' );
		return null;
	}
}

According the the JSZip documenation I assume it would be better to unzip the container asynchronously not to block the UI.

Three.js version
  • [x ] Dev
  • r120
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, …)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
Mugen87commented, Nov 12, 2020

After a closer performance analysis of 3MFLoader.parse(), the actual overhead does indeed not come from the unzip operation. DOMParser.parseFromString() as well as the processing of the XML document takes way more time than anything else. In webgl_loader_3mf_materials, unzipping takes 2.6 ms whereas the rest of parse() takes 1.85 seconds.

So similar to ColladaLoader, the actual overhead is produced by parsing and processing XML. Hence, marking this issue as a duplicate of #11746.

0reactions
donmccurdycommented, Aug 28, 2020

Might be a good candidate for https://github.com/mrdoob/three.js/pull/19650? We could keep JSZip but move it to a worker.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem when I try to load a 3MF model - three.js forum
When I try to load a 3D model from a .3mf file format the following error occurs: three.module.js:4698 Uncaught TypeError: Cannot read ...
Read more >
Three.js obj model loading freezes the Canvas until load is ...
During the loading phase, the entire canvas freezes. This is a really big problem as I am loading models in on the fly...
Read more >
Can't change material of loaded 3MF file as the object has no ...
I've noticed that when loading a 3MF file with the 3MF loader, the resulting group and child meshes do not contain any normal...
Read more >
WHY my .3mf file cannot be correctly loaded and show in the ...
I used solidworks to export a .3mf file, but I can't use 3MFLoader to show it in the webpage. The error massage in...
Read more >
Textures and 3MFLoader - Bug? - Questions - three.js forum
js, there's a point where it looks through the .3mf file (which is actually a zip file) to load resources from various locations....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found