Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

model-viewer

Lightweight browser-based STL and STEP viewer built on Three.js. Drop it anywhere — GitHub Pages, a VPS, whatever and point it at a model file via URL param.

Example: Setup

Usage

viewer.html?file=https://raw.githubusercontent.com/you/repo/main/part.stl
viewer.html?file=https://github.com/you/repo/blob/main/part.step

GitHub blob URLs are rewritten to raw automatically.

Flags

?file=…&flags=edit,upload
Flag What it does
edit Scale input, Auto Orient, Confirm
upload Local file picker (.stl / .step / .stp)

Formats

  • STL — binary and ASCII
  • STEP — via OpenCASCADE WASM (occt-import-js), loads on demand

postMessage API

Send a model from a parent frame:

iframe.contentWindow.postMessage({
  type: "load_model",
  buffer: arrayBuffer,
  ext: "step"
}, "*")

Confirmation comes back as:

{ type: "model_confirmed", data: { rotation: [x, y, z], scale: 1 } }

Self-hosting

Single HTML file, no build step. Just serve it.

About

A simple STL or STEP file viewer anyone can use in their website, works with file upload or even github or any raw site containing the file

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages