cad/gcode.tsimport { BIT_DIA, cutSize, holeXY, type Cabinet } from "./model";// CAM for the BobsCNC KL744 (GRBL): turns a Cabinet's board nest into// G-code ready for Universal Gcode Sender. Same single source of truth —// toolpaths are derived from the cabinet definition, never hand-edited.//// Setup assumed by the output:// - units: inches (G20), absolute (G90)// - X0 Y0 at the board's lower-left corner, Z0 at the TOP of the stock// - 1/4" upcut bit; router speed is set by hand on the KL744//// Order of operations per board: POCKETS first (parts still fully captive),// then outside PROFILES with holding tabs on the final passes so freed// parts can't shift into the bit. Cut the tabs free with a chisel.export const CAM = {bitDia: BIT_DIA, // 1/4" upcut end mill — ONE tool for everything (model.ts owns the size)// shallow-and-fast: belt-driven machines like the KL744 cut cleanest with// small bites at a brisk feed (the classic hobby-CAM recipe is ~0.03" @ 250)feed: 80, // cutting feed, in/min
Showing the first 20 lines.
Get full code