Skip to main content
  • three is a peer dependency. Versions >=0.168.0 <0.185.0 are supported.
  • The package is ES modules only. Its TypeScript types are included. They use the types of three, which three does not ship: in a TypeScript project, also run npm install --save-dev @types/three.

Serve the two files

The package ships two files that your page must fetch at run time: With no arguments, OpenGeometry.create() looks for both files next to the package’s own index.js. A bundler that moves or rewrites index.js breaks that lookup. The dependable way is to copy both files into the folder that your site serves at its root, and pass their addresses to create. In Vite, that folder is public/:
Then start the kernel once, before you make a body:
workerURL goes in the second argument, not the first.

Vite settings

Vite pre-bundles dependencies. Keep opengeometry out of that step, and allow top-level await in the build:
If your build cannot use top-level await, put the code after the imports in an async function and call it.

Without a worker

Pass { tessellation: 'inline' } to make the display meshes on the main thread. You then need no worker file:
For Node, see Run in Node.

Check the installed line

The 2.0 line has a different API. Code that uses Cuboid, Vector3 or setPlacement is written for 2.0.
Last modified on November 10, 2026