Jump to content

CuraEngine.exe from the command line - slicing - UM3


jeromechrist

Recommended Posts

Posted (edited) · CuraEngine.exe from the command line - slicing - UM3

Hey,

I'm trying to get a GCODE from a STL via invoking CuraEngine.exe.

From cura.log i can see that it's sending a whole bunch of parameters to a socket instead of the command line and returns all the settings value.

I could copy/paste all these parameters but it's way too long for Windows and hit the limit of args for a process.

I also see that it's using fdmprinter.def.json instead of ultimaker3.def.json.

I've tried doing this :

CuraEngine.exe slice -v -j "C:\Program Files\Ultimaker Cura 3.0\resources\definitions\ultimaker3.def.json" -s material_bed_temperature_layer_0="80" -s material_print_temperature_layer_0="235" -s layer_height="0.1" -s layer_height_0="0.27" -s material_diameter="2.85" -e0 -l "C:\Users\***\Desktop\cura\screw.stl" -o "C:\Users\****\Desktop\cura\test.gcode"

But the generated GCODE is pretty different from the one generated by CURA (the UI) ~20k more lines in the one generated by CURA.

Is there a simple way to generate a GCODE equivalent as CURA for the ultimaker 3 for a preset like ABS - Fine - no support - generate build plate adhesion - using CuraEngine.exe ?

Thank you.

Edited by Guest
  • Link to post
    Share on other sites

    Posted · CuraEngine.exe from the command line - slicing - UM3
    I could copy/paste all these parameters but it's way too long for Windows and hit the limit of args for a process.

    That's pretty much why Cura does not use the command line, and instead uses that socket.

    What you could do is create a .def.json file that contains all the values you see being sent to CuraEngine as default_value (in addition to what's in ultimaker3.def.json).

    • Like 2
    Link to post
    Share on other sites

    Posted (edited) · CuraEngine.exe from the command line - slicing - UM3

     

    I could copy/paste all these parameters but it's way too long for Windows and hit the limit of args for a process.

    That's pretty much why Cura does not use the command line, and instead uses that socket.

    What you could do is create a .def.json file that contains all the values you see being sent to CuraEngine as default_value (in addition to what's in ultimaker3.def.json).

     

    I guess that could work if i can create a definition that inherits ultimaker3.def.json with the extra values.

    Edited by Guest
  • Link to post
    Share on other sites

    Posted (edited) · CuraEngine.exe from the command line - slicing - UM3

    The json file references per-extruder json files. Create your own per-extruder json files, based on the UM3 extruder files, and add your settings.

    NB: I never run curaengine from the command line myself, so I don't know if this will work.

    Edited by Guest
    • Like 1
    Link to post
    Share on other sites

    Posted · CuraEngine.exe from the command line - slicing - UM3

    Almost there.

    The gcode produced has invalid headers :

    ;START_OF_HEADER
    ;HEADER_VERSION:0.1
    ;FLAVOR:Griffin
    ;GENERATOR.NAME:Cura_SteamEngine
    ;GENERATOR.VERSION:3.0.4
    ;GENERATOR.BUILD_DATE:2017-10-31
    ;TARGET_MACHINE.NAME:Ultimaker 3
    ;EXTRUDER_TRAIN.0.INITIAL_TEMPERATURE:235
    ;EXTRUDER_TRAIN.0.NOZZLE.DIAMETER:0.4
    ;EXTRUDER_TRAIN.0.NOZZLE.NAME:AA 0.4
    ;BUILD_PLATE.INITIAL_TEMPERATURE:80
    ;PRINT.SIZE.MIN.X:2.14748e+006
    ;PRINT.SIZE.MIN.Y:2.14748e+006
    ;PRINT.SIZE.MIN.Z:2.14748e+006
    ;PRINT.SIZE.MAX.X:-2.14748e+006
    ;PRINT.SIZE.MAX.Y:-2.14748e+006
    ;PRINT.SIZE.MAX.Z:-2.14748e+006
    ;END_OF_HEADER

    this is from the file with -o, what is weird is the output from the console has the correct values :

    ;START_OF_HEADER
    ;HEADER_VERSION:0.1
    ;FLAVOR:Griffin
    ;GENERATOR.NAME:Cura_SteamEngine
    ;GENERATOR.VERSION:3.0.4
    ;GENERATOR.BUILD_DATE:2017-10-31
    ;TARGET_MACHINE.NAME:Ultimaker 3
    ;EXTRUDER_TRAIN.0.INITIAL_TEMPERATURE:235
    ;EXTRUDER_TRAIN.0.MATERIAL.VOLUME_USED:813
    ;EXTRUDER_TRAIN.0.MATERIAL.GUID:60636bb4-518f-42e7-8237-fe77b194ebe0
    ;EXTRUDER_TRAIN.0.NOZZLE.DIAMETER:0.4
    ;EXTRUDER_TRAIN.0.NOZZLE.NAME:AA 0.4
    ;BUILD_PLATE.INITIAL_TEMPERATURE:80
    ;PRINT.TIME:999
    ;PRINT.SIZE.MIN.X:9
    ;PRINT.SIZE.MIN.Y:6
    ;PRINT.SIZE.MIN.Z:0.27
    ;PRINT.SIZE.MAX.X:130.787
    ;PRINT.SIZE.MAX.Y:121.784
    ;PRINT.SIZE.MAX.Z:5.97
    ;END_OF_HEADER

    How do i get the correct headers in the file ?

  • Link to post
    Share on other sites

    Posted · CuraEngine.exe from the command line - slicing - UM3

    The Cura front end fixes the headers for normal prints (not the engine), so this might be a situation of the command line never being used so that part might be broken without anybody noticing...

  • Link to post
    Share on other sites

    Posted · CuraEngine.exe from the command line - slicing - UM3

    The Cura front end fixes the headers for normal prints (not the engine), so this might be a situation of the command line never being used so that part might be broken without anybody noticing...

    Well I noticed :D I've added an issue in the github repo : https://github.com/Ultimaker/CuraEngine/issues/660

    Anyway, i'm now able to generate a gcode for differents settings, thanks for the guidance on this.

    Hopefully this gets fixed so we can fully automate the slicing for UM3 with the command line.

  • Link to post
    Share on other sites

    Posted · CuraEngine.exe from the command line - slicing - UM3

    Anyway, i'm now able to generate a gcode for differents settings, thanks for the guidance on this.

    Hello, Did you created it manually with tons of parameters to set, or did you find a trick to generate if from Cura ?

  • Link to post
    Share on other sites

    Posted · CuraEngine.exe from the command line - slicing - UM3

    One more bit of info. If you invoke CuraEngine with the "-v" parameter, you'll get a valid header *after* slicing. I had the same issue and wrote a script to process the gcode after slicing to cut the header off and insert the new one.

  • Link to post
    Share on other sites

    Posted (edited) · CuraEngine.exe from the command line - slicing - UM3

    If I try capturing the output from the command-line with -v parameter, the valid header *after* slicing is not caught. Although the valid header is displayed on the screen, the captured output contains output only till the "END of Gcode". How could I get the valid header details after running the command.

    Edited by Devang
  • Link to post
    Share on other sites

    Posted (edited) · CuraEngine.exe from the command line - slicing - UM3

    never mind....

    It seems silly that I can't delete a post, but I was incorrect.

    Edited by robinmdh
  • Link to post
    Share on other sites

    Posted · CuraEngine.exe from the command line - slicing - UM3

    @Devang You could capture stdout and parse the header and cut it out. That‘s what I did back then. 

  • Link to post
    Share on other sites

    Posted · CuraEngine.exe from the command line - slicing - UM3

    Thanks @Nikolinux ,it seems the final header is coming in the stderr instead of the stdout, and I was trying to capture it through the stdout.

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.8 beta released
        Another Cura release has arrived and in this 5.8 beta release, the focus is on improving Z seams, as well as completing support for the full Method series of printers by introducing a profile for the UltiMaker Method.
          • Like
        • 1 reply
      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Thanks
          • Like
        • 3 replies
    ×
    ×
    • Create New...