Running the calculations in the xy plane then converting to other planes is, in general, the approach used for curves. I went through the curve code in some detail while I was sorting out the issues in the rotation code in the interpreter. I have not looked at splines or nurbs.
Bob -----Original Message----- From: l...@pibf.de [mailto:l...@pibf.de] Sent: Monday, August 15, 2022 8:09 AM To: emc-developers@lists.sourceforge.net Subject: Re: [Emc-developers] NURBS in XY, XZ(lathe) and YZ plane The next decision is about the code to change. I would be glad to read your opinions. My suggestion - the easy way - is to keep the code for nurbs calculations. Only change the wording to nubs_plane with coordinates nurbs_X and nurbs_Y to be clear this is still a 2d nurbs (and not machine axes). And then to map the calculation to the active plane. For CANON_PLANE_XY nurbs_X -> X nurbs_Y -> Y For CANON_PLANE_YZ nurbs_X -> Y nurbs_Y -> Z For CANON_PLANE_XZ nurbs_X -> X nurbs_Y -> Z This results for example in file gcodemodule.cc function NURBS_FEED: now: STRAIGHT_FEED(line_number, P1.nurbs_X, P1.nurbs_Y, _pos_z, _pos_a, _pos_b, _pos_c, _pos_u, _pos_v, _pos_w); //original new: if(plane==CANON_PLANE_XY) { STRAIGHT_FEED(line_number, P1.nurbs_X, P1.nurbs_Y, _pos_z, _pos_a, _pos_b, _pos_c, _pos_u, _pos_v, _pos_w); //unchanged } if(plane==CANON_PLANE_YZ) { STRAIGHT_FEED(line_number, P1.nurbs_X, _pos_y, P1.nurbs_Y, _pos_a, _pos_b, _pos_c, _pos_u, _pos_v, _pos_w); // } if(plane==CANON_PLANE_XZ) { STRAIGHT_FEED(line_number, _pos_x, P1.nurbs_X, P1.nurbs_Y, _pos_a, _pos_b, _pos_c, _pos_u, _pos_v, _pos_w); // } In file emccanon.cc each nurbs segment uses the function biarc, which results in two calls to ARC_FEED, which is aware of the active plane. Joachim _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers