docs / workbenches / CAM Workbench

CAM Workbench

Id: cam · Twelfth entry in the workbench dropdown

CAM (computer-aided manufacturing) programs the machining of the modelled part — what Fusion 360 calls the Manufacture workspace and SOLIDWORKS its CAM add-in. A setup fixes how the part sits on the machine (its work coordinate system, the stock around it and the clearance heights); tools are the cutters in the document's library; operations are machining strategies against picked geometry, each in one setup with one tool; and NC programs are ordered groups of operations posted to a machine. The public capability matrix summarizes supported functions and current limits; this page describes the workbench controls.

Walkthrough

CAM walkthrough

Roughing the seed part (a 20 mm block with a 12 mm hole through it) from start to finish: switch to CAM, add a setup and pick its top face as the machine's Z axis, grow the stock 6 mm around the sides and set the safe heights, add a 6 mm flat end mill, add an operation and choose adaptive3D (adaptive clearing) from its Strategy list, pick the block as the body to machine, set a 1.5 mm load and a 5 mm step-down, Generate, then drag the simulator's timeline through the program and Compare to part: the stock is the part within the 0.05 mm tolerance everywhere. The stock offsets follow the model's axes, not the re-picked Z, so here the sides are X and the model's Z (Top/Bottom offset).

Recorded from the running app by BREP_mcp/tests/videos/cam.json; regenerate every walkthrough with ./build.sh docs-videos.

What it offers

CAM creates no features: the Add-feature palette is empty here, and the history stays fully editable, because what a setup machines is the model the history already built. It adds:

Where the data lives

The part file's cam block, in the shared CAM model's form (the BREP_cam crate's Setup, Tool and Operation, camelCase, every newer field defaulting): { setups: [{ id, name, modelToMachine, wcs, stock, heights, targets, … }], tools: [{ id, number, name, kind, geometry, holder?, coolant, feeds, … }], operations: [{ id, name, setup, tool, enabled, targets, strategy: { kind, … }, tolerance, stockToLeave, linking, … }], ncPrograms: [{ id, name, number?, post, operations }], idCounter }. Operations are a flat list naming their setup; the tree nests them under it. A new operation carries every parameter of its strategy kind at the model's default (cam_state lists the kinds under strategies); a new tool is a flat end mill of the default geometry; both are edited in their dialogs. An NC program is an ordered group of operations and the post that writes them — user input the post lane assembles at post time.

One counter mints every id (SETUP1, T2, OP3, NC4): monotonic, never reused, rewound by undo with the block it lives in. Every add and delete is its own undo step; the block is saved with the document and comes back on reopen byte for byte; a document without CAM data carries no block. A block the app cannot read (a file edited by hand, a newer format) is reported, never emptied: the pane shows why under its header and every edit is refused until the document is repaired, so saving never drops what was there. Toolpaths, mesh snapshots, spatial indexes and stock states are derived and are never written here — they are regenerated.

The setup dialog

Double-click a setup row (or Edit setup… in its menu, or cam_open) and the pane draws the setup's dialog in place of the tree: one schema-driven form in five groups.

While a setup is selected or open, the viewport draws its stock box (grey) and its frame triad at the origin (X red, Y green, Z blue), sized from the stock. The same geometry is reported under frames in cam_state (origin, axes, stock bounds, or frameError), which is what the scripts assert.

Machines

A setup is posted for a machine: the setup dialog's Machine group chooses none, one of the built-in machines (a 3-axis VMC, a 4th-axis A table, A/C and B/C trunnions, head-head, head-table, a lathe and a mill-turn, each with its limits, default post and collision solids) or a document machine; generation, the simulation player and an NC program without its own post use it.

The Machines section lists the document's own machines — copies of a built-in made from New machine (one entry per built-in) or from the setup dialog's custom choice. Double-click one (or its menu's Edit machine…) for its editor: name, kind (a change starts the new kind's conventional axis layout), the post, the tool-change time, spindle and feed limits, optional acceleration and travel limits, a 5-axis machine's layout (table-table, head-head, head-table, keeping its two axes), every rotary axis (name, direction, origin, optional angle limits) and a mill-turn's Y axis; the collision solids are counted there. Every value is checked by the model's own rules (a mill-turn's C axis stays on +Z) and a refusal names its field with nothing applied. A machine a setup names cannot be deleted; a built-in is never edited or removed in place — copy it first.

The tool dialog and the libraries

Double-click a tool row (or Edit tool… in its menu, or cam_open) for the tool's dialog, one form in five groups: Tool (name, number, kind — the model's 21 kinds from flat and ball to tap, boring bar and lathe insert — description, tool material), Geometry (diameter, cutting length, shaft, overall length, and the kind's own dimensions: a bull's corner radius, a chamfer's angle and tip, a lollipop's ball, a tap's pitch; the others are hidden), Holder (none, or a family — ER16/25/32, side-lock, shrink-fit, hydraulic — with its bore and height, designed through the holder library), Feeds (spindle speed and direction, cutting and plunge feed, a work material and Calculate feeds from the material, which runs the feeds calculator on a 3-axis mill and writes the result) and Coolant. Every edit is validated the way the library validates a tool, and a refusal names the field with nothing applied.

A tool's row menu also offers Duplicate (a copy under a fresh id and the next number) and Save to user library. The document's tools are its own library, saved with it; the user library is kept across documents on this machine (in the app's settings directory, or the browser's storage), not in a PLM — a PLM-served per-user library is a later PLM slice. The Tool Library section's buttons: Add from user library (a menu of its tools; one comes in under a fresh id and number), Import… (a Fusion 360 .json / .tools export, a .csv sheet or a library file, through the file chooser; rows the importer skips are listed), Export (the document's tools as a library file) and Export user library.

The operation dialog

Double-click an operation row (or Edit operation…, or cam_open) for its dialog, laid out the way Fusion 360 lays out an operation's tabs:

Every edit is read back as the model's types and validated by the strategy's own rules; a refusal names the field or the group with nothing applied. cam_update_operation takes the same keys as a nested patch (strategy.depths.stepDown, linking.leadIn.kind); a chain is targets.chains.<index>.side and the like, remove: true drops it, and cam_set_ref with the field chainEdges or chainProfile adds one by entity names without a pointer.

Typical workflow

  1. Switch to CAM and press New setup. The setup is selected; double-click it to pick its Z face, X edge and origin, choose the stock and set the heights.
  2. Press New tool for each cutter the program needs (or add one from the user library, or import a library file). The tool is selected; double-click it to set its kind, geometry, holder and feeds.
  3. Select the setup (or leave it as the only one), select a tool, and press New operation. With no setup or no tool the pane says which is missing — no tool yet: press New tool first — and writes nothing. Double-click the operation to pick its bodies and faces and set its passes.
  4. Press Generate. Every enabled operation with targets is queued on the background runner, one at a time; the line under the header shows the operation generating, its phase and count, and the queue, with a Cancel beside it. Each operation's row leads with its status mark ( idle, ◔ queued, running, generated, ◑ stale, failed; hover for the count or the reason). An operation whose inputs change after it was generated reads stale until it is generated again. Each job meshes its bodies at a quarter of the operation's tolerance (half for scallop, which checks the mesh against half the tolerance itself), whatever the part's size: a tolerance whose chord falls below 0.0001 is refused by name (raise the operation's tolerance), and so is a part mesh over four million triangles. A finer tolerance on a curved part costs time.
  5. The generated toolpaths draw in the viewport, each segment coloured by its kind (rapids and retracts, plunges and drill cycles, cuts and arcs, leads, links), the selected operation's at full strength and the others dimmed, each taken back to the model through its setup's frame; an operation's row menu hides or shows its toolpath. cam_scrub (0..1 along the selected operation's segments) stands the tool's wireframe — cutting part, shank and holder from the tool's own profile — on the toolpath at that point.
  6. Right-click a row for Delete: a setup takes its operations with it; a tool in use by an operation is refused until that operation goes.

Simulation player

Under the tree, the Simulation section plays the generated operations of the selected setup against its stock (lane C17). Load assembles the setup's generated operations into one program (the operations in document order, each with its tool) and seeds the stock from the setup: a box, a cylinder or a solid on screen becomes the Z-dexel grid for a 3-axis stream, or the tri-dexel when any operation tilts the tool axis (3+2, rotary, swarf, contour, multi-axis finishing). The stock is drawn in the viewport in model coordinates; the tool stands at the scrub position with its shank and holder, along the motion's tool axis.

Toolbar buttons

ButtonIdOfferedWhat it does
New setupcam.new_setupalwaysAdds a setup (work coordinate system, stock and heights) and selects it
New toolcam.new_toolalwaysAdds a tool to the document's library with the next free tool number and selects it
New operationcam.new_operationalwaysAdds an operation to the selected setup with the selected tool, or says which is missing
Generatecam.generatealwaysQueues every enabled operation on the background runner; the pane shows progress, Cancel and each operation's status

Automation

Every action is a command: cam_state, cam_add_setup, cam_add_tool, cam_add_operation, cam_add_program, cam_remove, cam_select, cam_open, cam_update_setup (a patch of the dialog's keys), cam_set_ref (a setup's or an operation's picker field by entity name, no pointer), cam_update_tool, cam_duplicate_tool, cam_calculate_feeds, cam_library (list / save / add / remove / import / export), cam_update_operation (a nested patch of the operation form's keys), cam_generate (every enabled operation or ids; returns what was queued and what was refused and why), cam_cancel, cam_toolpath (one operation's generated motion stream and report), cam_toolpath_visible (the row menu's Hide / Show toolpath), cam_scrub, cam_add_machine and cam_update_machine (a nested patch of the machine editor's keys), beside workbench_button for the four buttons. The __brepCam state blob carries the block with the pane's selection and last notice, generation (busy, the operation in flight, the queue, progress, every result's summary) and statuses (each operation's idle / queued / running / ok / stale / error); __brepCamHit carries the pane's rects (cam:*). A toolpath is never written to the document: wait_state on /__brepCam/generation/busy eq false waits for a generation. The cam-workbench, cam-setup, cam-orientation, cam-axis-orientation, cam-tools, cam-operation, cam-containment, cam-generate, cam-chains, cam-machines and cam-broken-block scripts in the MCP suite drive all of it.

The simulation player: cam_sim_load, cam_sim_state (also the __brepCamSim blob), cam_sim_play, cam_sim_scrub, cam_sim_step, cam_sim_set, cam_sim_deviation, cam_sim_export, cam_sim_unload; its widgets are the cam:sim:* hit keys of the CAM pane.