Welcome! Log In Create A New Profile

Advanced

CuraEngine slicing and Octoprint

Posted by savorywatt 
CuraEngine slicing and Octoprint
July 18, 2013 02:17PM
Slicing through Octoprint coming soon. Powered by the fast slicing engine behind Cura.

[www.youtube.com]

[github.com]

Active PR, I welcome comments. If you have a feature request go ahead and drop it here or in the Octoprint G+ community.
Re: CuraEngine slicing and Octoprint
July 18, 2013 02:55PM
Have you found a way to set the latest version of Cura for "relative E"? I'd love to give it a try via Octoprint or stand-alone, but I need it to output "relative E" gcode.

Fl0yd
Re: CuraEngine slicing and Octoprint
July 22, 2013 10:25AM
Floyd, I have not found a way to do that. I'm sorry I can't help.
Re: CuraEngine slicing and Octoprint
July 24, 2013 03:06PM
You should be able to set your firmware use absolute E even if by default it expects relative E:

M82  - Set E codes absolute (default)
M83  - Set E codes relative while in Absolute Coordinates (G90) mode

So if you have an absolute E gcode, just put M82 in the header. In fact I'd suggest adding M82 or M83 to all gcode files to make sure the E values are evaluated correctly by the firmware.
Re: CuraEngine slicing and Octoprint
July 29, 2013 01:57PM
Savorywatt,

I've cloned your cura-integration branch of Octoprint, and I have to say, I really like it. I still slice some stuff on my main computer when I'm adjusting settings and doing something non-standard, but it's handy to just upload an stl if I'm printing a single object without any need to fuss with parameters. The interface changes you mention in your video sound good, but I think it works pretty well as-is. The only minor thing I noticed is that while stls no longer show up under Uploads, they still exist in the .octoprint/upload folder, and could eventually eat up a lot of space. Oh, and sometimes I have to refresh the page to see the sliced file, but that may be Chromium, which acts a bit weird with Octoprint.

For anyone who's interested, I've also put it on a Raspberry Pi, and it is pretty amazing. Even though I have the old 256Mb RPi, most simple files take a few seconds to slice, though it tended to choke on really massive files (like Yoda--if I scp him over to the pi and slice by command line it works and takes only 10 minutes, but uploading through the sever fails without an error to the octoprint log).

Last thing to note is that installing the full Cura .deb on your server isn't necessary (and the supplied CuraEngine binary doesn't work on the Pi), so I just cloned the engine here: [github.com]. Less clutter, less prereqs, and you'll probably get bleeding-edge updates sooner.
Re: CuraEngine slicing and Octoprint
July 31, 2013 12:17PM
great, this basically works.
but it doesnt use the specified config file. the call to curaengine is reported as

CuraEngine args:['/home/pi/CuraEngine/CuraEngine', '-s', '/home/pi/CuraEngine/cura_garage.ini', '-o', '/home/pi/.octoprint/uploads/18_40.gcode', '/home/pi/.octoprint/uploads/18_40.stl']

while the -s parameter supports single settings only, not a config file as a whole.
like in 'CuraEngine -s print-temperature=230'

or am i mistaken, i cannot find any config file reader in the sources though.

any ideas ?

grtx
Re: CuraEngine slicing and Octoprint
July 31, 2013 12:47PM
42loop,

It looks like you're right. My printer was out of commission until yesterday, so I had been slicing without printing. The problems I was having I assumed came from a mistake on my part, but it wasn't. If you look here it looks like Cura takes the .ini file and splits it up into individual lines and sends each as a -s command. I'll add a note about this on the pull request. It should be a simple change, and I'd do it myself if I knew python at all.
Re: CuraEngine slicing and Octoprint
August 05, 2013 12:04AM
Hey guys,

Thanks for testing this out!!!! I did some more work this weekend to get it slicing and then sending the gcode to the printer's SD card. That is working but I could have sworn the -s option let you point to a config file. I'll have to do some more trouble shooting and if I have to write a quick parser to take your config file and spit it out so the subprocess makes the right call to Cura then them's the breaks. Work in progress!

updated video [www.youtube.com]

savorywatt
Re: CuraEngine slicing and Octoprint
September 20, 2013 10:55AM
Just to keep people updated.

We moved from directly wrapping CuraEngine to wrapping Cura itself. Slice - SD card support is there. Basic instructions are located here

[github.com]

Essentially you need to patch Cura (I added an option to pass in a profile from the command line) and checkout the slicerSupport branch on foosel's repository. It should be merged into the main Devel branch once Gina finishes some reorganization of the project structure.

Here is a video showing slicing different files on a normal desktop vs on a Raspberry Pi so people can get a feel for the speed differences.

[www.youtube.com]

If you test this out and find something that needs to be fixed please open an issue on Octoprint's github repository.

savorywatt
Re: CuraEngine slicing and Octoprint
September 20, 2013 01:42PM
I've been playing around with this and it works well, but I wanted to note something that confused me at first. I compiled Cura from source, so I didn't need the patch. For the "Path to Cura" I originally put /usr/bin/cura (the first result of whereis cura and the command that runs if I just type cura in a terminal), and it didn't work. Uploading an STL on my main computer caused Cura to launch, and on my server caused an error about being unable to access the X display. Instead, if I set it to /usr/share/cura/cura.py it works fine.

Shouldn't any options I pass to /usr/bin/cura get passed on to /usr/share/cura/cura.py? Should I open an issue for Cura, or did I screw something up installing it? I'm using Ubuntu Server edition on my server, and Ubuntu 13.04 on my main computer.
Re: CuraEngine slicing and Octoprint
September 23, 2013 04:43PM
TopherMan,

The issue is how Daid set up command line args being passed to Cura. The command I run internally is actually to call the Cura Python Module itself instead of the Cura executable. The patch was only needed if you couldn't build it from the devel branch (daid merged my patch). So to answer your question, args passed to /usr/bin/cura will not be passed onto /usr/share/cura/cura.py. Time permitting I may try to see why the args are not passed through but for the moment I'm not going to worry too much about it.Thanks again for trying this out.

savorywatt
Re: CuraEngine slicing and Octoprint
November 25, 2013 04:35AM
Just an update, I made a video to show what your settings should look like and your cura install should look like as there have been some people having problems getting everything working.

[www.youtube.com]
Re: CuraEngine slicing and Octoprint
January 29, 2014 10:12PM
Is this in master now for Octoprint? I noticed the patch was merged into Cura, are there current instructions anywhere? (or a pre-baked image...)
Sorry, only registered users may post in this forum.

Click here to login