slic3r / Slic3r

Open Source toolpath generator for 3D printers
https://slic3r.org/
GNU Affero General Public License v3.0
3.35k stars 1.29k forks source link

[Feature request] Combine initial Z and XY moves #4256

Open nmaggioni opened 6 years ago

nmaggioni commented 6 years ago

I moved back to Slic3r after having used Cura for some time, and noticed a slightly different behavior when starting a print: with Cura the initial Z and XY moves are combined in a single command, whereas in Slic3r they are separate moves.

Given that I lower my bed (or lift the nozzle, the concept is printer-independent) in my custom start G-code to better inspect the nozzle, this leaves nasty oozing traces on my printbed while it moves from home to the initial printing position.

Wouldn't it be handy if this was done in a single, smooth move? This FR is similar to #964.


Example:

; custom start g-code begins
[...]
G1 Z15 ; move bed downwards
; custom start g-code ends

M109 S200 ; set temperature and wait for it to be reached
[...]
G1 Z0.200 F7200.000 ; move to next layer (0)
G1 E-2.00000 F2400.00000 ; retract
G1 X115.327 Y80.449 F7200.000 ; move to first skirt point
G1 E2.00000 F2400.00000 ; unretract
G1 F3000
G1 X116.806 Y79.659 E0.05678 ; skirt
; custom start g-code begins
[...]
G1 Z15 ; move bed downwards
; custom start g-code ends

M109 S200 ; set temperature and wait for it to be reached
[...]
G1 E-2.00000 F2400.00000 ; retract
G1 X115.327 Y80.449 Z0.200 F7200.000 ; move to next layer (0) and to first skirt point
G1 E2.00000 F2400.00000 ; unretract
G1 F3000
G1 X116.806 Y79.659 E0.05678 ; skirt
BloodBlight commented 6 years ago

I second this! Not being able to do this just ends up making a mess on the print bed (and preventing the first layer from sticking) if you have a more "ozzy" setup. :<

foreachthing commented 6 years ago

Here, use my post process "script". That's what I do: edit those lines to match your request - which was mine as well.

Sample output:

G92 E0 ; reset extrusion distance
;layer:0;
M117 Layer 1/78
G1 E-5.20000 F2400.00000
G92 E0
G1 X108.739 Y95.198 Z0.250 F6000.000 ; move to first skirt point
G1 E5.20000 F2400.00000
G1 F1800
;segType:Skirt
G1 X109.166 Y94.768 E5.20704

Sorry, my repo is a mess - I'm no programmer.

nmaggioni commented 6 years ago

@foreachthing Thanks for the help, but I'm using Linux and I'd rather avoid calling in Mono on this to run an external C# postprocessor.

I'll come up with a little Python script in the meantime, but in an ideal future I'd like to avoid postprocessing at all :)

BloodBlight commented 6 years ago

@nmaggioni Same, was debating it as well, if you do, would you share it?

nmaggioni commented 6 years ago

@BloodBlight Absolutely! I quickly hacked something together: https://github.com/nmaggioni/slic3r-smooth-first-move - it has not been field tested yet but the output file looks good.

At the moment it works for skirts only as that's what I use most of the time; extending it to support other structures (nothing, rafts, etc) should be easy.

foreachthing commented 6 years ago

... but in an ideal future I'd like to avoid postprocessing at all ...

And somebody else want's it different than we do.

OT: .... I hate Python: every software that uses python comes with its own Python distro. So, today, I have 35 python.exe on my c-drive alone.

lordofhyphens commented 6 years ago

@foreachthing sounds like a Windows problem :D

upya4ko commented 5 years ago

I also have issues after moving from cura to slic3r, i not found ready solution so i made my own. I move first Z move to first X and Y move, so it make first move on all directions (and not scrape curved bed...). It written on python so it must work on any platform, tested only on windows. https://github.com/McPcholkin/Slic3rPE