Toolpath G-code: how to use
← Back to the generator
1 · Finished part
- STEP (.step / .stp): any solid. It works in 2.5D and full 3D. Units are converted to mm.
- DXF: closed outlines (lines, arcs, circles, polylines, splines, blocks). Set the part's top Z and thickness. The outermost outline is the profile. For each inner outline, give a floor Z (a pocket) or tick Through. Outlines inside pockets are islands with their own top Z.
2 · Blank
- Box around the part: the part's bounding box plus the margins you set.
- Blank from a file: a separate STEP solid, or a DXF outline. A DXF blank needs a Top Z and Bottom Z.
- Part position: As drawn if the part and blank share coordinates. Otherwise centre the part and line up the tops or bottoms, then shift it as needed.
3 · Feeds and speeds
- Pick the material (the same list as the lathe program), HSS or carbide, and the flutes. The prime cutter's type and diameter come from card 4. The slider goes from a lighter to a more aggressive cut.
- The recommended speed is the fastest of the mill's speeds (with back gear 67–550 rpm, without 550–4600 rpm) that doesn't run the cutter more than 10% over the published cutting speed. Choose another speed from the list and the feeds are worked out from it.
- Tick These look right to copy the stepovers, stepdowns and feeds into card 4. They then follow any change to the material or the cutter, until you type one of them in card 4 by hand. The speed is set by hand on the mill and written as a comment at the top of the G-code.
4 · Machining
- 2.5D: the material between the blank and the part is cleared in Z levels. There is never more than one stepdown per level, and a level lands exactly on every flat floor. Each level is cleared with concentric offsets from the outside in. Closed pockets are cut from the centre out, with a ramp or plunge entry. With a wall or floor allowance, a finishing pass follows.
- Full 3D (STEP only): Z-level roughing leaves the stock allowance. A parallel raster pass then drops the finishing cutter onto the surface to within the tolerance. A ball nose is recommended. Enter the stepover in mm or as a scallop height. Cross passes at +90° improve steep walls.
- The cutter never goes under an overhang. Anything below an overhang is left uncut, as it must be on a 3-axis mill.
5 · Program
- Work zero X/Y can be the blank's front-left corner, its centre or the drawing origin. Z0 can be the top or bottom of the blank, or the drawing Z0.
- The output matches the drill program:
G21 G90 G17 G94, G0/G1 only, M0 to load each tool, optional M3 S…/M5 and N numbers. Z is the tool tip.
- Always dry-run above the work first.