FullControlXYZ / fullcontrol

Python version of FullControl for toolpath design (and more) - the readme below is best source of information
GNU General Public License v3.0
609 stars 64 forks source link

[BUG] duplicated primer procedure #93

Open aavogt opened 4 days ago

aavogt commented 4 days ago

Describe the bug The cura profile draws a doubled back line along the x axis, then fullcontrol adds another one along the y axis. I prefer cura's because I haven't had problems with cura, which leaves a gap between the primer line and the print. Moreover, the generated gcode doesn't repeat identical coordinates, so I can't just comment out the PRIMER PROCEDURE to get rid of it -- I also have to move the Y48.0.

To Reproduce Steps to reproduce the behavior:

myprinter = fc.GcodeControls(printer_name="Cura/Creality Ender-5 S1")
with open("bug.gcode", "w") as file:
    file.write(fc.transform([fc.Point(x=100,y=100,z=100)], 'gcode', myprinter))

This shows the two primer directions, and how the second one is connected to my print:

Screenshot from 2024-06-24 23-24-33

If I leave out the printer_name, I get this:

Screenshot from 2024-06-24 23-38-46

fullcontrol-xyz commented 3 days ago

Ah, this is because the default (FullControl-built-in) primer option is ''front_lines_then_y'.

Can you try adding initialization_data={"primer": "travel"} to your GcodeControls.

E.g. myprinter = fc.GcodeControls(printer_name="Cura/Creality Ender-5 S1", initialization_data={"primer": "travel"})

Let me know if this solves your problem. Once I publicise the Cura profiles more, I'll explain this to users, but it may be better to have 'travel' primer as the default setting for Cura profiles since most will have hard-coded primer lines.

FYI, more info about primer options in FullControl: https://colab.research.google.com/github/FullControlXYZ/fullcontrol/blob/master/tutorials/colab/gcode_controls_colab.ipynb#scrollTo=Gb8OwBjp8C5d