-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instructions for running in Node.js? #9
Comments
After creating and importing this no workers build it looks like a separate "node" build of xatlas js is needed (see the build script, emscripten Environment docs). I'm not set up for emscripten development but if a node js bundle was made available I could look into getting xatlas-three running in node. Otherwise I may look at puppeteer for the moment. |
It required some changes in xatlas.js for node.js. I have tried those and now it seems to work. To use it directly, check the script - https://github.com/repalash/xatlas.js/blob/v2/source/test/test.mjs For xatlas-three, the api wrapper had to be created with different imports and now we should be able to use it by just passing the path to the node worker and wasm file locally - https://github.com/repalash/xatlas-three/blob/master/test/node-worker.ts So this runs, but I haven't done any testing to see if the outputs are correct or if there are any other bugs. Will have to write some proper tests to check if it's working. |
Amazing! I'm using regular JS so I won't be able to easily test this for my use case until a JS entry point is added - but the simple solution would be to expose two entry points from the package.json. Eg one for "xatlas-three/web" and "xatlas-three/node" and just produce two separate bundles. Three.js is doing this for webgpu exports in the package.json. |
I'm taking a look at what's required now but I figured I'd ask in case you already have a straight forward answer. It looks like it will require a special build that doesn't require Workers, at least.
edit: it seems like the no-worker build path isn't working, as well, unless I'm missing something
The text was updated successfully, but these errors were encountered: