Page 1 of 1

Cut Direction

Posted: Sat Oct 26, 2013 2:32 pm
by jthornton
When I select Forced Orientation: Clockwise or Counterclockwise it does not change the cut direction for my profile. Both G codes cut in the Clockwise direction as viewed from the Z axis.

Thanks
JT

Re: Cut Direction

Posted: Sat Oct 26, 2013 5:10 pm
by andrew
I cannot reproduce that problem here at the moment. Could you please attach or mail the DXF file?
Is the contour closed (i.e. each element connects to exactly one end point of another element)?

Re: Cut Direction

Posted: Sun Oct 27, 2013 1:29 pm
by jthornton
It is just a square drawn with the rectangle tool.

JT

Re: Cut Direction

Posted: Sun Oct 27, 2013 1:41 pm
by andrew
Thanks. I still cannot reproduce though.
Could you attach your latest version of your machine configuration file?

Re: Cut Direction

Posted: Sun Oct 27, 2013 1:48 pm
by jthornton
Here is what I have so far for a LinuxCNC mill.

Code: Select all

include("GCode.js");

// Machine Configuration for LinuxCNC Mill type machines in Inch

function Lcnc_Mill(documentInterface, newDocumentInterface) {
    GCode.call(this, documentInterface, newDocumentInterface);

    // set output unit:
    this.unit = RS.Inch;
}

Lcnc_Mill.prototype = new GCode();

// change file extension from nc to ngc
Lcnc_Mill.prototype.getFileExtensions = function() {
    // set output file extension:
    return ["ngc"];
};

// change default to inch
Lcnc_Mill.prototype.initGlobalOptionWidget = function(w) {
    switch (w.objectName) {
    case "ZSafety":
        w.addItems(["2", "1", "0.5"]);         // available options in combo box
        w.setEditText("0.5");                    // preselected default option
        break;
    case "ZClear":
        w.addItems(["0.25", "0.5", "1"]);
        w.setEditText("0.25");
        break;
    case "ZCutting":
        w.addItems(["-0.125", "-0.25", "-0.5"]);
        w.setEditText("-0.125");
        break;
    }
};

// change default to inch
Lcnc_Mill.prototype.initLayerOptionWidget = function(w) {
    switch (w.objectName) {
    case "ZCutting":
        w.addItems(["default", "-0.125", "-0.250", "-0.375"]);
        w.currentText = "default";
        break;
    }
};

// change G00 to G0
Lcnc_Mill.prototype.getRapidMoveCode = function() {
    return "G0";
};

// change G01 to G1
Lcnc_Mill.prototype.getLinearMoveCode = function() {
    return "G1";
};

// change G02 to G2
Lcnc_Mill.prototype.getCircularCWMoveCode = function() {
    return "G2";
};

// change G03 to G3
Lcnc_Mill.prototype.getCircularCCWMoveCode = function() {
    return "G3";
};

// add preamble
GCode.prototype.writeHeader = function() {
    this.writeLine("G20 G17 G40 G49 G54 G64 P0.005 G80 G90 G94");
    this.writeRapidZMove(this.getSafetyZLevel());
    this.toolPosition = GCode.ToolPosition.Clear;
};

// change M30 to M2
Lcnc_Mill.prototype.writeFooter = function() {
    this.writeToolUp();
    this.writeRapidZMove(this.getSafetyZLevel());
    this.toolPosition = GCode.ToolPosition.Clear;
    this.writeLine("M2");
};

// turn off line numbers
Lcnc_Mill.prototype.getLineNumberCode = function() {
    return "";
};

Re: Cut Direction

Posted: Sun Oct 27, 2013 2:09 pm
by jthornton
Here is a test circle with both outputs using G3 even though I selected CW for one the CCW for the second one. I also attached the log files for each one if that helps.

JT

Re: Cut Direction

Posted: Sun Oct 27, 2013 2:32 pm
by jthornton
Is it possible my hack to remove the line numbers caused the direction not to work? Changing from my hack to your fix and now the direction is correct in a test with a square object. The circle still uses G3 for both CW and CCW.

JT

Re: Cut Direction

Posted: Sun Oct 27, 2013 2:53 pm
by jthornton
I just tested a rectangle object with radius corners and the CW CCW works fine. Seems like a circle is the only one that does not work.

JT