Skip to content

Post-Processor Library

G-Code Translation & Intermediate CLData During CAM simulation, Fusion 360 calculates coordinates relative to the defined Work Coordinate System (WCS).

Theoretical Background & CPS Architecture

G-Code Translation & Intermediate CLData

During CAM simulation, Fusion 360 calculates coordinates relative to the defined Work Coordinate System (WCS). These coordinates represent the tool tip center (or contact point) trajectory. The internal output is a list of sequential cutter locations:

Post-Processor Customization & Callback Functions

Modifying .cps files requires editing the JavaScript code. The most common customizations are located inside the onSection(), onClose(), and coolant configuration functions.

Modifying Tool Change Scripts (onSection)

The onSection() callback is executed at the start of every operation. This is where the post-processor output matches the tool parameters defined in CAM.

A standard tool change implementation looks like this in JavaScript:

function onSection() {
  var insertToolCall = isFirstSection() || 
                       (tool.number != getPreviousSection().getTool().number);
  
  if (insertToolCall) {
    retracted = true;
    writeBlock(gFormat.format(0), "Z" + xyzFormat.format(properties.retractPositionSET)); // Safe Z retract
    
    // Optional M01 stop before tool change
    if (properties.showOptionalStop) {
      writeBlock(mFormat.format(1));
    }
    
    // Output Tool Call
    writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6));
    
    // Output Tool Comment
    if (tool.comment) {
      writeComment(tool.comment);
    }
  }
}

Customizing Stage Tooling (Preload Tool)

For CNC machines equipped with a carousel tool changer (such as Haas or Fanuc), preloading the next tool while the current tool is cutting reduces cycle times. We can modify onSection() to scan ahead:

Post Properties in Fusion 360

Post Properties are user-configurable variables that appear in the right-hand panel of the Post Process dialog box in Fusion 360. Developers expose these variables in the .cps file so users can adjust settings without editing the code.

CategoryFusion360 CAM
LibraryCAM library

Engineer, author of The Big Book of 3D Printing and additive manufacturing expert