How it works
The code is an iframe that loads the Mes3D viewer from freestlviewer.com and tells it where your model is. Your visitor's browser downloads the model from your server and draws it on their own device: nothing is uploaded to Mes3D, and the file never passes through our servers. Visitors can drag to rotate, scroll or pinch to zoom, and open the viewer full screen.
Leave the model address empty and you get a drop-a-file viewer instead: visitors drop their own STL or 3MF onto your page and see it right away. That is handy for a print shop's quote page or a maker club's website.
Use cases
- Selling STL files or printed parts. Let buyers turn the model before they pay instead of guessing from two screenshots.
- Documentation and kits. Show the exact part a step refers to, in 3D.
- Portfolios and project write-ups. A model is easier to read than a render, and visitors can see it from any side.
- Teaching. Put a model next to the lesson text without asking students to install anything.
Options
The generator writes these for you, but you can also edit the address by hand:
| Parameter | Values | What it does |
|---|---|---|
src |
Full https:// address of the model |
The file to show; leave it out for a drop-a-file viewer |
name |
File name, for example part.stl |
Sets the format when the address has no file extension |
bg |
light |
Light background instead of dark |
color |
Hex colour without #, for example ff9500 |
Model colour; files with their own colours keep them by default |
spin |
0 |
Do not turn the model while it waits for the first touch |
Allowing the download (CORS)
Browsers only let one website download a file from another website when the second one allows it. Your model files need this response header:
Access-Control-Allow-Origin: https://freestlviewer.com
- nginx: inside the
locationthat serves your models, addadd_header Access-Control-Allow-Origin "https://freestlviewer.com"; - Apache: in
.htaccessnext to the files, addHeader set Access-Control-Allow-Origin "https://freestlviewer.com" - Amazon S3, Cloudflare R2, Google Cloud Storage: add a CORS rule that
allows
GETfromhttps://freestlviewer.com. - GitHub: "raw" file links (
raw.githubusercontent.com) already allow it.
If the header is missing, the viewer says so instead of showing an empty box. Files can be up to 200 MB, but a few megabytes load much faster for visitors on a phone.
The credit link
The code ends with a short line under the viewer, "3D viewer: Mes3D", linking to this site. It is plain and visible, it names the tool and nothing else, and it is yours to keep, move or remove. If you keep it, thank you: it is how other people find a free viewer they can use too.
What it does not do
The embedded viewer is for showing a model, not editing it. Measuring, mesh analysis, conversion and repair are on the full Mes3D viewer and the tools pages. Animations in FBX or glTF files are not played.
