Visualizer 2

This commit is contained in:
Vignesh Suresh
2026-06-06 20:43:01 +02:00
parent a4b9a311dd
commit 29dfbf99a5
7 changed files with 1063 additions and 10 deletions
+19 -2
View File
@@ -16,8 +16,10 @@ visualizer/
│ ├── __init__.py # lightweight; no heavy imports
│ ├── __main__.py # CLI: `python -m wired3d_viewer view|serve`
│ ├── parser.py # NC dialect reader (standard library only)
│ ├── viewer.py # Plotly figure builder + HTML writer
│ ├── server.py # drag-and-drop local web front end
│ ├── viewer.py # NC Plotly figure builder + HTML writer
│ ├── server.py # NC drag-and-drop local web front end
│ ├── stl_viewer.py # STL mesh figure builder + HTML writer
│ ├── server2.py # STL drag-and-drop local web front end
│ └── assets/
│ └── wired3d.avif # logo, embedded into the HTML as a data URI
```
@@ -50,6 +52,21 @@ python -m wired3d_viewer serve 9000 # custom port
wired3d serve # same, if installed
```
### STL mesh viewer ("server 2")
View a raw `.stl` part in 3D *before* slicing — rotate/zoom with the mouse. Once
a part is loaded a **Slice & Visualize** button (with layer-height / infill
inputs) runs `stl_slicer` and shows the resulting toolpath with the NC viewer on
the same page; "Back to mesh" flips back. (Per-coordinate direction vectors are
the next feature and are not drawn yet.)
```bash
python -m wired3d_viewer view-stl path/to/part.stl # writes <stem>_stl_viewer.html
python -m wired3d_viewer serve-stl # http://127.0.0.1:8766
python -m wired3d_viewer serve-stl 9001 # custom port
wired3d view-stl part.stl / wired3d serve-stl # same, if installed
```
Parse only (no visualisation, no third-party deps):
```python