Add browser Three.js viewer for case STL preview.

Serve with python http.server under cad/ and open viewer.html locally.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-17 15:01:24 +08:00
parent c35ed7a7a9
commit 4898087dc7
3 changed files with 247 additions and 0 deletions

View File

@@ -44,9 +44,15 @@ pio device monitor -b 115200
桌面斜立分体壳(前框 + 后盖支架 + DHT11 通风仓),可直接打印:
- STL:[`cad/export/front.stl`](cad/export/front.stl)、[`cad/export/back.stl`](cad/export/back.stl)
- 浏览器预览:[`cad/viewer.html`](cad/viewer.html)(需本地 HTTP,见下)
- 参数源 / 说明:[`cad/README.md`](cad/README.md)
```bash
# 浏览器查看
python -m http.server 8765 --directory cad
# 打开 http://localhost:8765/viewer.html
# 重新导出 STL
pip install trimesh manifold3d numpy
python cad/generate_stl.py
```
@@ -82,3 +88,4 @@ README.md # 本文档
| 2026-10-17 | 曾加入 ECO 熄屏休眠,后改回常亮正常版 |
| 2026-10-17 | 初始化 Git,补充 README 与提交约定 |
| 2026-10-17 | 新增 CYD+DHT11 桌面斜立 3D 外壳(OpenSCAD / STL) |
| 2026-10-17 | 增加浏览器 Three.js STL 预览页 `cad/viewer.html` |