Commit 3dc1594
authored
Add THR export and segment subsampling pipeline stage (#166)
## Summary
- Add THR (Theta-Rho) serializer for polar sand tables (Sisyphus, Oasis,
Dune Weaver) with `atan2(x,y)` convention, continuous theta unwinding,
rho normalization to [0,1], metadata comment headers, and 5-decimal
precision matching Sandify
- Add segment subsampling as pipeline stage 9 (after join) to subdivide
long Cartesian line segments before polar conversion, preventing
unexpected arcs in THR output
- Enable THR checkbox in the export panel with download wiring
## Details
### New files
- **`crates/mujou-export/src/thr.rs`** — THR serializer with ~20 unit
tests + 1 end-to-end test
- **`crates/mujou-pipeline/src/subsample.rs`** — `subsample()` function
with 18 unit tests
### Pipeline changes
- `STAGE_COUNT` bumped to 10 with new `Subsampled` typed stage
- `PipelineConfig.subsample_max_length` (default 2.0 px)
- `StagedResult.subsampled` field; `final_polyline()` returns subsampled
output
- `StageMetrics::Subsample` variant in diagnostics
- Cache resume support for the new stage
### UI changes
- THR checkbox enabled in export panel with Blob download
- `StageId` mapping updated for new pipeline index
### Tests
- ~40 new unit tests across `thr.rs` and `subsample.rs`
- 2 cherry blossoms integration tests
(`cherry_blossoms_pipeline_to_thr`,
`cherry_blossoms_pipeline_to_thr_with_mask`)
- All 380 tests pass, zero clippy warnings
### Docs
- THR format spec added to `formats.md`
- Implementation checklist updated (Phases 0–5 checked off)File tree
18 files changed
+1669
-229
lines changed- crates
- mujou-export
- src
- tests
- mujou-io/src
- components
- mujou-pipeline/src
- mujou-worker/src
- docs/src/project
18 files changed
+1669
-229
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
0 commit comments