Good news first – simCNC themes to pretty much follow the FANUC standard, so it works well with the standard post processor shipped with Fusion360.
Nevertheless, some tweaks will help to make the post processor even greater. I have started to add a few helpful functions and will continue to add more:
- Integration of material stock size (done! details below)
- Adding more tool information (wip, coming soon)
But first a few lines on how to make changes to an existing post processor:
How to edit the post processor in Fusion360
Basically, a Fusion post-processor is a JavaScript program which has access to CAM variables and the CAM positioning output of Fusion360. Making changes to any existing post processor is very simple.
In the CAM workarea, select „Post Processor“ from the ribbon, then click the pencil icon next to the slected PP you wish to edit.
On my computer, files are set up to open in Visual Studio code. Don’t let the file size of the PP intimidate or overwhelm you – actually it’s quite logical and well commented!
Before you start making changes to the PP, I reccomend saving it under a new name. This way you will be able to go back to the original version in case something goes wrong.
And yes, it’s quite easy to produce errors in the PP and cause it do stop working. But usually nothing you cannot fix…
Integration of material stock size
For my „enhanced file-open prompt“ project, I wanted to know the size of stock required for a GCode. Luckily you can easily add this information to every post-processor output.
{ // stock - workpiece
var workpiece = getWorkpiece();
var delta = Vector.diff(workpiece.upper, workpiece.lower);
if (delta.isNonZero()) {
var xWorkPiece = Math.abs(workpiece.upper.x-workpiece.lower.x);
var yWorkPiece = Math.abs(workpiece.upper.y-workpiece.lower.y);
var zWorkPiece = Math.abs(workpiece.upper.z-workpiece.lower.z);
writeComment("Stock Size X" + xyzFormat.format(xWorkPiece ) + " Y" + xyzFormat.format(yWorkPiece) + " Z" + xyzFormat.format(zWorkPiece));
}
}
As you want the information to show up in the header of your GCode, place it somewhere after the block „dump tool information“.
[…] some changes to your post processor are requried to post this information in the expected way. I have my settings in a separate article (Fusion360 PP, based on the Fanuc […]