Expand description
An NรN scale-test scene: a sheet wrapping a square grid of identical
Add blocks, fully wired, with no pin left dangling.
cargo xtask autogen scale N out.json serializes what this builds, and
the editorโs test fixtures lower the same Document in-process, so the
file on disk and the scene under test are one scene.
Structsยง
- Grid
Pins ๐ - The four pins every grid block carries: two west inputs, two east outputs. Named once so the wiring and the emitter cannot disagree about which is which.
- PinSpec ๐
- A pin to create.
slotplaces it on its block-as-child;bodyplaces the same pin inside the blockโs own interior view, where the scope draws it as a free-standing port. The two are independent, and the default body is the trap: every boundary port left at it stacks at the origin, and the wires anchored there start from inside whatever block sits over that spot. - Scale ๐
- Every id the grid uses, minted in the order the file numbers them: the sheet, then the grid blocks row-major; the sheetโs boundary ports, then each grid blockโs four.
Constantsยง
- BLOCK ๐
- Grid spacing in grid units: each block is
BLOCKwide/tall and columns/rows are placed on aPITCHlattice, leaving a gap for wires to route through. - MARGIN ๐
- PITCH ๐
- PORT_H ๐
- PORT_W ๐
- A boundary port body, in cells. Wide enough for its name, two cells tall so the anchor (one cell down from the top) sits inside it.
Functionsยง
- build_
scale - The NรN scene as a folded document.
- cells ๐
- east ๐
- port ๐
- port_
body ๐ - A boundary portโs body, on the sheetโs west or east margin and level with the grid row it serves, so its wire leaves along that row instead of crossing the sheet to reach it.
- title ๐
- west ๐
- wiring ๐
- Every wire, as the pins it joins. The scheme leaves no pin dangling: