Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
# Camera node layout files
The DSL and placement files the camera board (`Camera_HaLow`, PCB3 in the
EasyEDA project) is laid out from, in the order they are used. The rules
they implement, and why, are in [CAMERA-LAYOUT.md](../CAMERA-LAYOUT.md).
| File | Tool | What it does |
|---|---|---|
| `camera-place.js` | `make_pcb_layout` | The whole-board placement: blocks, edge bands, satellites. Stochastic; six runs were needed and later ones regressed. Assemble the best, then repair by hand below |
| `padgeom.py` | library | Every pad's absolute position and shape, every part's centre and rotation, read from the newest router run under `$TMPDIR/easyeda-copilot-mcp/copilot-router/` (the PCB export has no pads). Any `run_pcb_router_dsl` call writes one, `camera-drc.js` being the cheapest |
| `p4_cluster.py` → `p4_cluster.json`, `p4-local.js` | `make_pcb_layout` on `p4-local.js` through the shim's `@local-placement` route, then `assemble_pcb_layout_on_current_pcbdoc` | The 48 parts pinned to the P4 (decoupling rings on all four sides, both crystals and their loads, the CSI series resistors, the flash, the core buck) at exact coordinates. Turns each two-pad part so its signal pad faces the chip, refuses to write while anything overlaps, prints each capacitor's pad-to-pin distance. Regenerating from the assembled board gives the identical file |
| `periphery.py` → `periphery.json`, `periphery-local.js` | same route as above | The repairs the checker found in the solver's placement outside the P4 cluster: the buttons off the U.FL, the LED boost inductor off its driver, the HaLow series resistors in the column at the module's pads with two straps moved out. Both generators share `Placement` in `padgeom.py` |
| `validate_camera_placement.py` | after every assembly | Measures every C-nn rule a placement can break, from the real pads, and refuses two parts that overlap. Run it on a fresh artifact (`camera-drc.js` first). Watched go red on the solver's placement before it was trusted |
| `csi_tracks.py` → `csi_tracks.json`, `csi-tracks-local.js` | same route as above, after the parts are placed | The seventeen nets the router could not do, drawn from the real pads: the MIPI lanes on both sides of their resistors (two crossings the connector's pin order forces, six vias), the D-PHY reference, both crystals with their loads. Refuses if any pad it relies on has moved, and if any pair's skew over the whole path passes C-20's 3.4 mm. C-20 says why |
| `p4_escape.py` → `p4_escape.json`, `p4-escape-local.js` | same route as above, after the tracks | The P4's escape: a 0.3/0.15 mm via under every signal pin in two staggered rows, a 0.127 mm stub from the pad, a stub from every supply pin to its ring capacitor, each checked against every other pad and the copper already on the board, the reason printed for anything refused. The router's own fanout left 26 pins without a stub; section 7 of the layout document says the rest, including what sixty-six partial nets do to the router's recovery stage |
| `dsn_plane.py` | after EasyEDA Pro's Autorouter DSN export, before freerouting | Makes the export routable by freerouting: the wires' layers renamed from EasyEDA's ids (1, 2, 15, 16) to the names the file declares (without it every hand track loads as "no shape"), Inner1 made a `power` layer with a GND `plane` on it (without it ground is 846 open connections routed as tracks), the escape's vias on the 0.3 mm padstack, and each rail's class width taken from `power_widths.py`: the export writes one class per net and gives all 153 the board default, which is how three 2 A rails came back routed at 0.2 mm |
| `power_widths.py` | on a fresh artifact, after any routing | Each rail of section 5 against the width its row demands, or the IPC-2221 width for its current. Compares the *widest* copper, not the narrowest: a rail thins legitimately at its last hop into one pin, so a minimum flags every escape spur, while a maximum below the rule means no part of it was ever drawn for its current |
| `ses_clean.py` | on freerouting's exported session, before EasyEDA imports it | Drops everything EasyEDA's import would get wrong: the `protect` copies of the hand copper (re-created at the default width on top of the originals), freerouting's own wires on the seventeen hand-routed nets (0.2 mm patches where the export had dropped a segment inside a pad), and any via on a hand-drawn via. It moves the remaining vias out of the session into a `-vias.json` for the shim, each at the size freerouting chose, because the import makes every via 0.6 mm, with the session's quotes stripped from the net names, because a via placed as `"3V3"` sits on a net of its own. Tracks go in through EasyEDA's import, vias through the shim; the import's Inner2 lands on EasyEDA's Inner8 and is moved by hand (Layer Manager to 8 copper layers, Find → Track on Inner8, Property → Inner2, back to 4) |
| `verify_hand_copper.py` | after every routing run or import | Every segment of the two hand files still covered on the board, on its own net and layer, allowing the assembler's splits. Routers rip hand copper as a blocker and importers rewrite it; this is the first number to read |
| `net_islands.py <net>…` | on a fresh artifact | The pieces a net is in, walked by geometry, with the pads and the free ends of each. The DRC names one pad per piece and `inspect_net` one length per piece; neither says which pads sit together, and a 49-pad `3V3` in three pieces was three guesses without this |
| `hand_route.py` | library, and `hand_route.py <net> x0 y0 x1 y1` | Draws one link on Top, Inner2 or Bottom through an A* grid with every other net's pad, track and via inflated by its width and the clearance, a via wherever one clears every layer and the hole-to-hole rule, then measures the result against the exact shapes (`verify`, `check`, `check_via` all return the gap; the rule is `CLEARANCE`). Use it for what freerouting leaves open, sequentially, each result added to the obstacles before the next. It moves nothing: when an escape via's pocket is walled, clear the walls' nets and redraw them after it (`ring_ground.py` is the worked example) |
| `ring_ground.py` → `finish/ripup.json` | `make_pcb_layout` on a `@local-placement` file, after `clearRouting` of the six nets | The rip-up that gave the P4's ring capacitors their ground: six freerouting nets out of the channel, a 0.3/0.15 via under each column capacitor, the top row stubbed to C33's via, the six nets back around it. Computed against the board as it stood before; the JSON is the record |
| `finish/*.json` | `make_pcb_layout` + assemble, in the order the layout document tells | What was drawn by hand after freerouting, as placed: the 3V3 links, the four clean redraws, the 3V3 and ADC_LIGHT rebuilds, I2C_SCL and HALOW_RST, the ground vias and stubs, and the rip-up. The freerouting result is not reproducible; these are |
| `camera-route-full.js`, `camera-route-3-copper.js` | `run_pcb_router_dsl`, in order, after `camera-clear-router.js` and the three hand files | Routing in two transactions: every net at once, with the router's whole budget (the RF run 50 Ω critical, the USB as ordinary nets, the buck's feedback first, the hand-routed nets restated, power by current), then the planes and the stitching (0.6/0.3 vias, island removal on every plane: a pour island that touches no via is a pad the DRC reports connected and is not). The three-pass plan died with the P4's escape: any pass with a shorter list ended in the router's recovery stage completing the escape's partial nets with detours; section 7 of the layout document says the rest |
| `camera-clear-router.js`, `camera-clear-net.js` | `run_pcb_router_dsl` | Remove the router's copper while keeping the hand-routed nets; remove one net's copper so a hand file can redraw it |
| `camera-drc.js` | `run_pcb_router_dsl` | Rules only. Run first when the board's global minimum differs from what the routing file asks, or the routing file is refused with `DSL_RULE_CONFLICT` |
| `camera-clear.js` | `run_pcb_router_dsl` | Removes every track, via and zone the router made. Checkpoint restore does not take on a PCB document; this does |
Placement DSL traps, learned on this board: y is downward in `edgePlace`
and offsets; a block holds at most 12 parts and must share a non-GND net;
`fixed()` and `componentGrid` only with role `connector`; passives of an
edge-placed part must be satellites anchored to its pins or they scatter.
`tools/copilot-shim`, named in several rows above, is a local proxy in front
of the EasyEDA copilot MCP server that serves a `@local-placement` file as if
the model had produced it. It is not published here. Without it the same
JSON has to be pasted into the editor by hand, which is what the generators
write it for.
0f464c36aThis file is pinned to the selected release. Download the original to open it in your design tool.