@rulecad/viewer

The model page: opens model links, checks dropped STL files, writes print files. Plain static files you can host anywhere.

npm 0.3.14sourceMIT
npm install @rulecad/viewer   # then serve node_modules/@rulecad/viewer/site

See it

The model page itself, live on this site. Open the soap tray from create-rulecad's starter project, or drop an STL file on the page to check it for printing.

Reference

A model page you can host anywhere, as plain static files: no server code, no build, no accounts. Try it at jonibach.github.io/rulecad: drop an STL on it.

Host your own

The page is the site/ folder. Copy it anywhere that serves files:

npm pack @rulecad/viewer && tar xzf rulecad-viewer-*.tgz   # package/site/ is the page

Working on it

site/view.mjs is the page, site/index.html its layout (and its content policy) and site/view.css its styles; site/boot.js says so when the page's script fails to load. node scripts/build.mjs copies the link format, the print check and @rulecad/robots (into site/robots/) in beside them (--three rebuilds the trimmed three.js after a name is added to its list). node --test test/viewer.browser.mjs from the repository root drops an STL into the page in headless Chrome and saves screenshots.

three.js (MIT, site/three.LICENSE) draws the model.