Code: Select all
H DX=3050 DY=1220 DZ=18
Moderator: andrew
Code: Select all
H DX=3050 DY=1220 DZ=18
What is send as the header can be included in ....
Code: Select all
this.header = [...]
Code: Select all
// G21: Millimeter
// G64 P#: Tolerance. Fine tune system for best compromise between speed and accuracy
this.header = [
"%",
"(FILE: [FILENAME])",
"G21",
"G64 P0.025"
];
Please elaborate 'determination', on what are those values based?
I'm pretty sure you didn't have to define the material size or thickness anywhere in the drawing.
Code: Select all
include("GCodeMM.js");
function MyGCode(cadDocumentInterface, camDocumentInterface) {
GCodeMM.call(this, cadDocumentInterface, camDocumentInterface);
// register variable (this.thickness will be output for the [THICKNESS] placeholder:
this.registerVariable("thickness", "THICKNESS", true, "", 0);
// define header to contain placeholder for thickness:
this.header = [ "# Thickness: [THICKNESS]" ];
}
MyGCode.prototype = new GCodeMM();
MyGCode.displayName = "My G-Code [mm]";
MyGCode.prototype.writeFile = function(fileName) {
// set variable to value from CAM config dialog
// "MyThickness" corresponds to the objectName of the GUI element:
this.thickness = this.getGlobalOption("MyThickness", "0.0");
return GCodeMM.prototype.writeFile.call(this, fileName);
};
MyGCode.prototype.initConfigDialog = function(dialog) {
var group = dialog.findChild("GroupCustom");
var vBoxLayout = group.layout();
// add row:
var hBoxLayout = new QHBoxLayout(null);
vBoxLayout.addLayout(hBoxLayout, 0);
// add label:
var lThickness = new QLabel(qsTr("Thickness:"));
hBoxLayout.addWidget(lThickness, 0,0);
// add text input field:
var leThickness = new RMathLineEdit();
leThickness.objectName = "MyThickness";
hBoxLayout.addWidget(leThickness, 0,0);
// add next row...
};
I do understand ... Rather common is to define your Z=zero at the top of the material.Dacicusan wrote: ↑Tue Feb 01, 2022 10:53 amIt is not the same if I make a groove of 17mm deep into a 18mm board or a 3mm board. And the machine needs to know this information because it is referencing from the TOP part of the material, so if I apply a 17mm cut into a 3mm sheet the machine will cut the bed of the machine
I'm lost. I dont know what to do with this piece of code.andrew wrote: ↑Tue Feb 01, 2022 11:14 amHere's a minimalistic example post processor demonstrating how you can add an input field for the thickness in the CAM configuration dialog and then use that value in your header:
I hope that helps.Code: Select all
include("GCodeMM.js"); function MyGCode(cadDocumentInterface, camDocumentInterface) { GCodeMM.call(this, cadDocumentInterface, camDocumentInterface); // register variable (this.thickness will be output for the [THICKNESS] placeholder: this.registerVariable("thickness", "THICKNESS", true, "", 0); // define header to contain placeholder for thickness: this.header = [ "# Thickness: [THICKNESS]" ]; } MyGCode.prototype = new GCodeMM(); MyGCode.displayName = "My G-Code [mm]"; MyGCode.prototype.writeFile = function(fileName) { // set variable to value from CAM config dialog // "MyThickness" corresponds to the objectName of the GUI element: this.thickness = this.getGlobalOption("MyThickness", "0.0"); return GCodeMM.prototype.writeFile.call(this, fileName); }; MyGCode.prototype.initConfigDialog = function(dialog) { var group = dialog.findChild("GroupCustom"); var vBoxLayout = group.layout(); // add row: var hBoxLayout = new QHBoxLayout(null); vBoxLayout.addLayout(hBoxLayout, 0); // add label: var lThickness = new QLabel(qsTr("Thickness:")); hBoxLayout.addWidget(lThickness, 0,0); // add text input field: var leThickness = new RMathLineEdit(); leThickness.objectName = "MyThickness"; hBoxLayout.addWidget(leThickness, 0,0); // add next row... };
Code: Select all
this.header = [
"H DX=[X_MAX] DY=[Y_MIN] DZ=[THICKNESS] ",
];