Reply To: Laser gcode

#3931

ductsoup
Participant

Hmm, crickets. Ok then … found a decent plugin for Inkscape. The only problem is it’s generating code for the LinuxCNC dialect, not Marlin (MPCNC).

KnoxMakers/KM-Laser

The Inkscape extensions are written in Python so I lightly modified the KM code. Needs a couple hours work but it looks promising. Below is a teaser.

BEFORE

%
M64 P0 ( M64 OFF/ M62 ON)
G01 Z-0.000001 F10000
(Header)
G21 (All units in mm)

(Start cutting path id: path4379)
M68 E0 Q0.65
S10000 (PULSERATE) F400 (FEEDRATE)
G00 X455.641130 Y9.141111
M3 (UNLOCK)
M62 P0 (BURN ON MOVE)
G01 X455.641130 Y18.836110 Z-0.000001 F400.000000
G01 X458.641124 Y18.836110 Z-0.000001
G01 X458.641124 Y31.546112 Z-0.000001
G01 X455.641130 Y31.546112 Z-0.000001
G01 X455.641130 Y44.236111 Z-0.000001
G01 X458.641124 Y44.236111 Z-0.000001
G01 X458.641124 Y56.946113 Z-0.000001
G01 X455.641130 Y56.946113 Z-0.000001
G01 X455.641130 Y69.636112 Z-0.000001
G01 X458.641124 Y69.636112 Z-0.000001
G01 X458.641124 Y82.346112 Z-0.000001
G01 X455.641130 Y82.346112 Z-0.000001
G01 X455.641130 Y92.041113 Z-0.000001
G00 Z0.000001 (LASER OFF)
M64 P0
M5 (LOCK)

(End cutting path id: path4379)

AFTER

G90 ; set absolute positioning
G92 X0 Y0 ; set the current position as home
;G00 Z43 ; set the Z axis focal point
G21 ; set units to mm

; Start cutting path id: path5187
G00 F1000
G00 X455.641130 Y9.141111
M106 S255 ; Laser ON
G4P0
G01 X455.641130 Y18.836110 Z-0.000001 F400.000000
G01 X458.641124 Y18.836110 Z-0.000001
G01 X458.641124 Y31.546112 Z-0.000001
G01 X455.641130 Y31.546112 Z-0.000001
G01 X455.641130 Y44.236111 Z-0.000001
G01 X458.641124 Y44.236111 Z-0.000001
G01 X458.641124 Y56.946113 Z-0.000001
G01 X455.641130 Y56.946113 Z-0.000001
G01 X455.641130 Y69.636112 Z-0.000001
G01 X458.641124 Y69.636112 Z-0.000001
G01 X458.641124 Y82.346112 Z-0.000001
G01 X455.641130 Y82.346112 Z-0.000001
G01 X455.641130 Y92.041113 Z-0.000001
G4 P0 ; Laser OFF
M107 S0

; End cutting path id: path5187