LinuxCNC G-code assumes that the programmer wanted a full circle if
the coordinates of the start and end points in the plane are "the
same".

Currently both the preview interpreter and motion use the angle
between the start and end points of an arc to decide if the start and
end coordinates are “identical” and if so it is assumed that a full
turn was wanted.

https://github.com/LinuxCNC/linuxcnc/blob/master/src/libnml/posemath/_posemath.c#L1824
https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/rs274ngc/gcodemodule.cc#L1002

They calculate the angle in different ways and get slightly different
results. (ie, if you carefully tweak the code, you can have the
preview and actual motion give different results.

This probably doesn't matter very often.

A problem arises if a _very_ large radius is computed to generate a
nearly-straight line.
(In the example in issue 1528 one of the problem arcs is 5mm long, but
has a 7km radius. The coordinates are very different, but the included
angle is very, very small)

Given that arcs are programmed in terms of XY coordinates, I think it
makes no sense to judge the smallness of an arc by internal angle. I
propose doing it purely on the basis of hypotenuse distance in the
plane.

(Incidentally, part of the reason that the preview and motion differ
is because motion is  in metric and preview is in imperial! At least
with a metric config and metric G-code. I will need to test the 4
combinations)

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1912


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

Reply via email to