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

@@ -2,10 +2,25 @@
桌面斜立分体外壳,适配 **ESP32-2432S028R(CYD)** + **DHT11(CN1 / GPIO22)**。
## 浏览器预览
不要直接双击 HTML(`file://` 无法加载 STL)。在项目根目录执行:
```bash
python -m http.server 8765 --directory cad
```
然后打开:**http://localhost:8765/viewer.html**
可旋转 / 缩放,切换仅前框、仅后盖,或分解视图。
其它查看方式:用 [Bambu Studio](https://bambulab.com/)、Cura、PrusaSlicer 直接打开 `export/*.stl`;或把 STL 拖进 [viewstl.com](https://www.viewstl.com/) / [3dviewer.net](https://3dviewer.net/)。
## 零件
| 文件 | 说明 |
|------|------|
| `viewer.html` | 浏览器 3D 预览 |
| `export/front.stl` | 前框(屏窗 + 压边) |
| `export/back.stl` | 后盖 + 斜立支脚 + DHT11 通风仓 |
| `cyd_climate_case.scad` | 参数化源文件(OpenSCAD,可改尺寸) |