Skip to content

A fork of the official THREE.js 3MF loader that can be used in a Web Worker

License

Notifications You must be signed in to change notification settings

manyfold3d/threejs-webworker-3mf-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

THREE.js 3MF Loader for Web Workers

The standard THREE.js 3MF loader cannot be used in a Web Worker, as it uses DOMParser.

This tiny fork includes the normal loader code and patches it with the xmldom and query-selector packages, as suggested in this GitHub comment.

This makes the loader usable in a Web Worker.

Installation

npm install https://github.com/manyfold3d/threejs-webworker-3mf-loader

or

yarn add https://github.com/manyfold3d/threejs-webworker-3mf-loader

Usage

import { ThreeMFLoader } from 'threejs-webworker-3mf-loader'

loader = new ThreeMFLoader()
model = loader.load(path)

Maintenance

This code will be updated occasionally with the 3MF loader code from upstream THREE.js, but I can't guarantee I'll notice. Feel free to open issues to remind me if it changes.

Credits

All credit goes to the three.js authors for all their work, and @coder-free and @morrisallison for their suggestions in various GitHub comments, which I've just wrapped up into this package.

About

A fork of the official THREE.js 3MF loader that can be used in a Web Worker

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published