fragmuffin / pygcode

GCODE Parser for Python
GNU General Public License v3.0
123 stars 38 forks source link

decimal points #19

Open swinman opened 4 years ago

swinman commented 4 years ago

In general it is important to include a decimal point on many numbers in gcode (particularly those following A, B, C, F, I, J, K, Q, R, U, V, W, X, Y, Z). On many machines (e.g. haas see https://www.haascnc.com/content/dam/haascnc/en/service/manual/operator/english---mill-ngc---operator's-manual---2017.pdf Section 6.14.5), an integer is interpreted as either 1 thousandth or ten thousandth of the default unit.. so Z50 moves the Z axis to 0.05 mm above the WCS zero instead of 50 mm above the zero, potentially crashing the spindle (not fun!).

the code print(Line('G0 Z50.').block) results in G0 Z50, massively changing the meaning of a move to the 50 mm clearance plane!

How hard is this going to be to fix? I need to parse some G code and using a tool like this could really help - but I cannot use if it does the equivalent of dividing my positions and feed rates by 1000!!