是否可以在类似于图像的github自述文件中查看STL文件



你好,我正试图在README文件中显示github repo中STL文件的预览?到目前为止,我已经尝试使用
<script src="https://embed.github.com/view/3d/<username>/<repo>/<ref>/<path_to_file>"></script>
例如,我的文件将是
<script src="https://github.com/view/3d/UNCG-DAISY/SediNetCam/blob/main/hardware/cameracover.stl"></script>

现在,Github通过语法高亮显示来渲染在代码块中插入ASCII代码的STL

https://docs.github.com/en/enterprise-cloud@最新/开始/在github上写作/使用高级格式/创建图表

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

下载MeshLab,导入您的stl文件,当您取消选中二进制编码时将其导出为stl文件

下载FreeCAD,导入stl文件,导出为ast文件

用文本编辑器打开导出的文件,并将其复制到您的README.md文件中,位于:

```stl
```

更多信息:

  • https://vanderveer.io/github-markdown-render-stl
  • https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams#creating-stl-3d模型

相关内容

最新更新