nx_pcb_cam.nx
buildroot/runtime/nx_pcb_cam.nx
about
nx_pcb_cam.nx -- SOVEREIGN PCB isolation-milling CAM: copper geometry -> CNC G-code toolpaths.
This CLOSES THE IN-HOUSE LOOP of the Omniforge "chips" leg: instead of sending Gerber to an
external fab, we mill the board ourselves on a CNC (or a 3D-printer-derived mill) by cutting
AWAY the copper around each trace/pad so the remaining copper is electrically isolated.
The core operation is geometric OFFSETTING: each trace centreline is offset perpendicular by
(copper_half_width + tool_radius) to both sides; each pad gets a square isolation ring at
(pad_radius + tool_radius). INTEGER-ONLY / NO-FLOAT: coordinates in micrometers, perpendicular
normals via an inlined integer sqrt (proven Newton idiom, exact for axis-aligned segments),
coordinates formatted to decimal mm with the SHARED g_mm6 from nx_pcb_gerber (DRY). Reuses the
same toolpath family as the slicer/CAM. NEVER-BRICK (#26): emits G-code FILES only; no machine
control / firmware writes here. license_tier: ORIGINAL expect_exit: 0
dependencies 3 imports · 1 importers
imports: nx_syscalls.nxnx_pcb_gerber.nxnx_vecmath.nx
imported by: nx_pcb_cam_gate.nx
structs
| none |
consts
| 15 | const K_MAGIC_12000: i64 = 12000 |
functions
| 18 | func cam_isqrt(v: i64) -> i64 { return vm_isqrt(v) } |
| 21 | func cam_z(buf: *u8, len: *i64, z_um: i64) -> i64 |
| 29 | func cam_rapid(buf: *u8, len: *i64, x_um: i64, y_um: i64) -> i64 |
| 37 | func cam_cut(buf: *u8, len: *i64, x_um: i64, y_um: i64, feed: i64) -> i64 |
| 46 | func cam_plunge(buf: *u8, len: *i64, cut_depth_um: i64, plunge: i64) -> i64 |
| 54 | func cam_retract(buf: *u8, len: *i64, safe_z_um: i64) -> i64 |
| 60 | func cam_pass(buf: *u8, len: *i64, x1: i64, y1: i64, x2: i64, y2: i64, |
| 70 | func cam_ring(buf: *u8, len: *i64, x0: i64, y0: i64, x1: i64, y1: i64, |
| 84 | func cam_emit( |