3

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>

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

2 Answers2

1

Now, Github renderize STLs inserting the ASCII code in code blocks wit syntax highlighting

https://docs.github.com/en/enterprise-cloud@latest/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams

```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