threeis a peer dependency. Versions>=0.168.0 <0.185.0are supported.- The package is ES modules only. Its TypeScript types are included. They use the types of
three, whichthreedoes not ship: in a TypeScript project, also runnpm 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/:
workerURL goes in the second argument, not the first.
Vite settings
Vite pre-bundles dependencies. Keepopengeometry out of that step, and allow top-level await in the build:
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:
Check the installed line
Cuboid, Vector3 or setPlacement is written for 2.0.
