Am 19.12.22 um 02:23 schrieb andy pugh:
On Thu, 15 Dec 2022 at 19:04, <l...@pibf.de> wrote:

Hi,
here is my little christmas present for you:
nurbs in xy, yz and zx plane is working for me.

I suspect that NURBS isn't used very much (none of the CAM packages
know how to use it) so the risk of putting this straight into master
is small.

It would be nice if it could support all planes, if that isn't too
much of a stretch? I think there are 30 possible planes if you include
UVW. (Yes, I know, arcs don't work in, for example, the XV plane).
Without looking at the code (sorry, catching up on a 7 day email
backlog)  I don't know how you did the expansion, but other parts of
the code are written in XY and then just substitute at the end to the
actual plane coordinates.


The task was an easy one: I only have to look for lines of code
where the calculated nurbs coordinates (x,y) are mapped to real (x,y) 
coordinates.

Example gcodemodule.c function NURBS_FEED(...):

Original line:
            STRAIGHT_FEED(line_number, P1.X,P1.Y, _pos_z, _pos_a, _pos_b, 
_pos_c, _pos_u, _pos_v, _pos_w);

Replaced by:
        if(plane==CANON_PLANE_XY) {
            STRAIGHT_FEED(line_number, P1.X, P1.Y, _pos_z, _pos_a, _pos_b, 
_pos_c, _pos_u, _pos_v, _pos_w);
            }
        if(plane==CANON_PLANE_YZ) {
            STRAIGHT_FEED(line_number, _pos_x, P1.X, P1.Y, _pos_a, _pos_b, 
_pos_c, _pos_u, _pos_v, _pos_w);
            }
        if(plane==CANON_PLANE_XZ) {
            STRAIGHT_FEED(line_number, P1.Y, _pos_y, P1.X, _pos_a, _pos_b, 
_pos_c, _pos_u, _pos_v, _pos_w);
            }

Changes Files: canon.hh, emccanon.cc, gcodemodule.cc interp_convert.cc, 
nurbs_additional_functions.cc, saicanon.cc
I do not know what seicanon.cc is for!

This method can easily be continued for planes where the function
static void arc(int lineno, double x0, double y0, double x1, double y1, double 
dx, double dy)
in emccanon.cc works.

Looking to the code for arc(...) I see:
    switch(canon.activePlane) {
        case CANON_PLANE_XY:
            shift_ind = 0;
            break;
        case CANON_PLANE_XZ:
            shift_ind = -2;
            break;
        case CANON_PLANE_YZ:
            shift_ind = -1;
            break;
        case CANON_PLANE_UV:
        case CANON_PLANE_VW:
        case CANON_PLANE_UW:
            CANON_ERROR("Can't set plane in UVW axes, assuming XY");
            break;
    }
So first arc() has to be expanded to UVW planes?


Regarding UV plane:
For foam cutting setups (x,y,u,v) how looks a gcode programm?
Something like this?
G5.2 P1 L3
     X0 Y1 P1 U1 V2 Q1
     X2 Y2 P1 U3 V3 Q2
     X2 Y0 P1 U3 V1 Q1
     X0 Y0 P2 U1 V1 Q2
G5.3

Or different G numbers (G5.4 and G5.5) ?

Joachim



_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to