Portable weaving draft simulation, liftplan compilation and periodic float analysis
git clone https://github.com/chenliyi-cly/moonweave.git
cd moonweave
moon version --all
moon fmt --check
moon check --target wasm-gc --deny-warn
moon test --target wasm-gc
moon run examples/plainmoon run examples/plain#.#.#.#.
.#.#.#.#
#.#.#.#.
.#.#.#.#
#.#.#.#.
.#.#.#.#
#.#.#.#.
.#.#.#.#moon run examples/loommoon run examples/reconstructmoon run cmd/moonweave -- help
moon run cmd/moonweave -- plain 2 2
moon run cmd/moonweave -- twill 2 2 report
moon run cmd/moonweave -- satin 5 2 json
moon run cmd/moonweave -- twill 2 2 svg| 能力 | API | 约定 |
|---|---|---|
| 验证草稿 | draft | 综框和踏板 ID 从 1 开始;去重/越界错误不静默修复 |
| 踩踏模拟 | from_treadles | 多个踏板提升综框取并集;下降式一次性取补集 |
| 交织图 | drawdown | [pick][warp];true 是正面经纱在上 |
| 浮线 | floats / periodic_floats | 有限边界/周期边界;back=true 切换反面 |
| 织机检查 | check_loom | 容量、全开/全闭交织、未用综框、长浮线/不交织纱线 |
| 生成 | plain / twill / satin | 缎纹步长须与综框数互质且非相邻 |
| 变换 | other_face / reverse_warp / reverse_picks / shift | 有等价性与双次变换测试 |
| 采样 | tile / crop / reduce_repeat | 有限裁剪不自动成为合理周期 |
| 反推与比较 | from_drawdown / direct_tieup / differences | 精确图样反推;显式拒绝容量不足/尺寸不同 |
| 交换/展示 | read_json / write_json / read_grid / write_grid / svg | 版本化 JSON、自定义网格、纯 SVG |
python scripts/verify.py --target wasm-gc
python scripts/verify.py --target wasm
python scripts/verify.py --target js
python scripts/verify.py --target nativepub(all) struct Analysis {
width : Int
height : Int
shafts : Int
repeat_size : RepeatSize
front : Array[PeriodicFloat]
back : Array[PeriodicFloat]
bindings : BindingCounts
} derive(Eq, ToJson, Debug, FromJson)fn Draft::periodic_floats(self : Draft, min_length : Int, back? : Bool) -> Result[Array[PeriodicFloat], String]Install
Download zipPortable weaving draft simulation, liftplan compilation and periodic float analysis