Howdy I am trying to show a preview of an STL file from my github repo in the README file is there anyway to do this?
So far I have tried using
<script src="https://embed.github.com/view/3d/<username>/<repo>/<ref>/<path_to_file>"></script>
For example my file would be
<script src="https://github.com/view/3d/UNCG-DAISY/SediNetCam/blob/main/hardware/cameracover.stl"></script>
Asked
Active
Viewed 438 times
3

273K
- 29,503
- 10
- 41
- 64

StasiewiczJacob
- 51
- 5
-
JavaScript won't be included when the README is rendered for security reasons. – bk2204 Jul 20 '21 at 00:58
-
Did you ever find a way to embed a STL in a readme? I'm also trying to figure this out. – spuder Dec 20 '21 at 04:14
2 Answers
1
Now, Github renderize STLs inserting the ASCII code in code blocks wit syntax highlighting
```stl
solid cube_corner
facet normal 0.0 -1.0 0.0
outer loop
vertex 0.0 0.0 0.0
vertex 1.0 0.0 0.0
vertex 0.0 0.0 1.0
endloop
endfacet
facet normal 0.0 0.0 -1.0
outer loop
vertex 0.0 0.0 0.0
vertex 0.0 1.0 0.0
vertex 1.0 0.0 0.0
endloop
endfacet
facet normal -1.0 0.0 0.0
outer loop
vertex 0.0 0.0 0.0
vertex 0.0 0.0 1.0
vertex 0.0 1.0 0.0
endloop
endfacet
facet normal 0.577 0.577 0.577
outer loop
vertex 1.0 0.0 0.0
vertex 0.0 1.0 0.0
vertex 0.0 0.0 1.0
endloop
endfacet
endsolid
```

273K
- 29,503
- 10
- 41
- 64

cychitivav
- 11
- 2
0
Download MeshLab, Import your stl file, Export it as an stl file when you uncheck binary encoding
OR
Download FreeCAD, Import your stl file, Export it as an ast file
Open the exported file with a text editor, and copy it to your README.md file, inside:
```stl
```
For more information:

Y.S.
- 157
- 1
- 11