alvarogimenez / g-code-utils

G-Code Calibration Software
http://gomezgimenez.com
MIT License
41 stars 7 forks source link

Support modality of G0 and G1 #11

Closed ronindev closed 1 year ago

ronindev commented 1 year ago

Hello!

G00 and G01 are modal commands, so they can me omitted in gcode file if mode does not changed. CAM that I currently using to make PCBs GGEasy use that approach. For example:

;              Tool: Engraver (30° 0.2 mm tip)
;     Tool Stepover: 0.1
;    Feed Rate mm/s: 1.33333
;   Tool Pass Depth: 0.1
;             Depth: 0.03
;              Side: Bottom
G21 G17 G90
M3 S1000
G0Z6
X65.541Y23.855
Z1
G1Z-0.03F80
X65.523
X65.332Y23.872
X65.313Y23.875
X65.128Y23.925

g-code-utils does not support such GCode for now.

I've tried to solve that issue, in my fork. It's ugly code, because scala and FP too complex for me. Just have a look, it's like a proof-of-concept of modifying coordinates instead of generating new GCode commands.

alvarogimenez commented 1 year ago

Hi there! I'm sorry that it took me so long to tackle this one, I've been very busy in the past few months. I've just released a new version (1.2.1) with a lot of improvements in G-Code parsing which include supporting omitted and incremental/partial commands. That kind of g-code shouldn't be a problem anymore 😄 Thanks!