PadLex / SvgToGcode

MIT License
46 stars 27 forks source link

ENHANCEMENT Add minor "overshoot" at the end to finish the cut #27

Open adam-ah opened 1 year ago

adam-ah commented 1 year ago

PROBLEM

When using SVG to GCODE the generated GCODE assumes that ending on the exact position as the cut started on will finish the cut perfectly.

However, when using this to drive less accurate lasers or blades, the cut will not finish - rather, a tiny piece of material is left uncut.

Example

Cutting a box generates (pseudocode)

MOVE 0,0
START CUT
MOVE 0,1
MOVE 1,1
MOVE 1,0
MOVE 0,0

SOLUTION

Add a tiny (configurable?) overshoot at the end - similar to starting a second pass, but only for a tiny cut (approx. 1mm or even less).

I had a look at the code briefly and it may belong to append_curves in compiler?

Fixed example

Cutting a box should generate (pseudocode)

MOVE 0.0, 0.0
START CUT
MOVE 0.0, 1.0
MOVE 1.0, 1.0
MOVE 1.0, 0.0
MOVE 0.0, 0.0
MOVE 0.0, 0.1 # Overshoot cut
johannesnoordanus commented 11 months ago

You can create a second svg in another layer - for example using Inkscape - that you save separately. Say box_outline.svg and box_start_1mm.svg. Then use svgtogcode to convert both. Add the gcode of box_start_1mm.gc to the end of box_outline.gc and the laser machine will draw the extra mm you asked for.