GitHub can host and render 3D files with the .stl extension.
When looking directly at an STL file on GitHub you can:
- Click and drag to spin the model.
- Right click and drag to translate the view.
- Scroll to zoom in and out.
- Click the different view modes to change the view.
When looking at a commit or set of changes which includes an STL file, you'll be able to see a before and after diff of the file.
By default, you'll get a view where everything unchanged is in wireframe. Additions are colored in green, and removed parts are colored in red.
You can also select the Revision Slider option, which lets you use a slider at the top of the file to transition between the current and previous revisions.
Fixing slow performance
If you see this icon in the corner of the viewer, then the WebGL technology is not available on your browser:
Error: "Unable to display"
If your model is invalid, GitHub may not be able to display the file. In addition, files that are larger than 10 MB are too big for GitHub to display.
Embedding your model elsewhere
For example, if your model's URL is github.com/skalnik/secret-bear-clip/blob/master/stl/clip.stl, your embed code would be:
By default, the embedded renderer is 420 pixels wide by 620 pixels high, but you can customize the output by passing height and width variables as parameters at the end of the URL, such as
ref can be a branch (like
master), or the hash to an individual commit (like