Jump to content

Help understanding cura.log and CuraEngine


mersault

Recommended Posts

Posted · Help understanding cura.log and CuraEngine

Hello, I'm trying to get CuraEngine to slice my stl files the same way it slice stl files through Cura.

I know this is not easy since using CuraEngine through the command line is mainly used for testing (so I've been told). I started by looking at all the "-s settings" generated in cura.log for a slice and noticed that some settings are passed with "-s" twice. Why is that?

Are these all the settings I pass to CuraEngine through the command line to get the same slice as the one produced by Cura?

And also, what does "-g" and "-e" do exactly? I'm not that familiar with 3D printing so an explanation would be appreciated.

 

"-g
    Switch setting focus to the current mesh group only.
    Used for one-at-a-time printing.
  -e<extruder_nr>
    Switch setting focus to the extruder train with the given number."


These are the descriptions in CuraEngine help.

 

  • Link to post
    Share on other sites

    Posted · Help understanding cura.log and CuraEngine
    6 hours ago, mersault said:

    I know this is not easy since using CuraEngine through the command line is mainly used for testing (so I've been told). I started by looking at all the "-s settings" generated in cura.log for a slice and noticed that some settings are passed with "-s" twice. Why is that?

     

     

    Because certain settings are set per extruder. If you have two extruders, you need to set it twice.
     

    6 hours ago, mersault said:

    Are these all the settings I pass to CuraEngine through the command line to get the same slice as the one produced by Cura?

     

    Yep, should be the same.

     

    6 hours ago, mersault said:

    And also, what does "-g" and "-e" do exactly? I'm not that familiar with 3D printing so an explanation would be appreciated.

     

    "-g
        Switch setting focus to the current mesh group only.
        Used for one-at-a-time printing.
      -e<extruder_nr>
        Switch setting focus to the extruder train with the given number."


    These are the descriptions in CuraEngine help.

     

    This has to do with the first question again (at least the -e<extruder_nr> does). If you give a setting without telling the engine on what extruder it needs to be applied, it will use it as a global setting (Layer height is a setting that should only be set globally, since both extruders must use the same value). If you want to change a setting for a certain extruder, you can use -e0 -s setting_to_change="foo" to do this.

    One at a time printing is even more complicated. When printing multiple objects, it's possible for certain objects to have a subset of settings changed.

    • Like 1
    Link to post
    Share on other sites

    Posted · Help understanding cura.log and CuraEngine

    Thanks for the response. My printer is only ever using one extruder for the print. From looking at the "-s" settings in cura.log I can only surmise that it first sets all the settings globally and then after the "-g -e0" starts setting "-s" settings for the actual print. Is this for calibration? Like the printer settings are first set globally and then when it's time to print with the extruder the "-s" settings passed to the extruder overrides the global settings set.

  • Link to post
    Share on other sites

    Posted · Help understanding cura.log and CuraEngine
    On 9/5/2018 at 8:35 PM, mersault said:

    Is this for calibration? Like the printer settings are first set globally and then when it's time to print with the extruder the "-s" settings passed to the extruder overrides the global settings set.

    2


    It's not for calibration. Some settings can be set globally *and* per extruder. Infill density can be set globally and per extruder. This means that if the extruder does not provide a value, it uses the global value. If it does provide a value, that one is used instead.

    • Like 1
    Link to post
    Share on other sites

    Posted · Help understanding cura.log and CuraEngine

    Alright, that makes sense. Is there a way to see if certain settings need to be set per extruder? Or is it one of those things I'm supposed to reason out, like settings that are obviously for an extruder and settings that are not just by their description.

  • Link to post
    Share on other sites

    Posted · Help understanding cura.log and CuraEngine

    If you are only slicing for single extrusion, you don’t have to specify any setting for that extruder except for those in fdmextruder.def.json, because the engine should always fall back to the global value (or the default if there isn’t a global setting) if you don’t specify a value for the extruder.

     

    You don’t have to specify values that equal the “default_value” in fdmprinter.def.json, but the engine ignores the “value” that is set in fdmprintet.def.json.

    • Like 1
    Link to post
    Share on other sites

    Posted · Help understanding cura.log and CuraEngine
    On 9/11/2018 at 11:28 AM, ahoeben said:

    If you are only slicing for single extrusion, you don’t have to specify any setting for that extruder except for those in fdmextruder.def.json, because the engine should always fall back to the global value (or the default if there isn’t a global setting) if you don’t specify a value for the extruder.

     

    You don’t have to specify values that equal the “default_value” in fdmprinter.def.json, but the engine ignores the “value” that is set in fdmprintet.def.json.

     

     

    Thanks, that really clears things up. Just one more thing though just to be sure I'm doing this right. Since the engine ignores the "value" attribute in fdmprinter.def.json its up to me then to calculate these values in my program so I can set them correctly?

  • Link to post
    Share on other sites

    Posted · Help understanding cura.log and CuraEngine

    Correct.

     

    The "value" property in .def.json files is always a string which can be interpreted by Python, and as such it can be a formula or any legal Python statement/structure. The frontend is written in Python, the backend (CuraEngine) is written in C++. CuraEngine does not contain a Python interpreter, and hence it can not interpret the "value" property. The "default_value" is always a literal.

    • Like 1
    Link to post
    Share on other sites

    Posted · Help understanding cura.log and CuraEngine
    On 9/12/2018 at 12:48 PM, ahoeben said:

    Correct.

     

    The "value" property in .def.json files is always a string which can be interpreted by Python, and as such it can be a formula or any legal Python statement/structure. The frontend is written in Python, the backend (CuraEngine) is written in C++. CuraEngine does not contain a Python interpreter, and hence it can not interpret the "value" property. The "default_value" is always a literal.

     

    I suspected that's how it worked but it's really nice to get confirmation.

    When exactly does "value" get evaluated? Meaning when would the frontend calculate the value instead of taking the default value? Is it when a setting's value is changed from the default and that affects another setting's value?

  • Link to post
    Share on other sites

    Posted · Help understanding cura.log and CuraEngine

    Basically the “value” is what is shown and overridden in the frontend. If there’s no “value” in the definition or in the profile, the “default_value” is shown to the user. If “value” is a formula/function, it is inspected to see what other settings it depends on, so if those settings change value the function gets reevaluated.

     

    If a setting has an (evaluated) “value”, be it set in the definition, by a profile, or edited in the sidebar, then that value gets sent to CuraEngine as a literal (ie: evaluated).

    • Thanks 1
    Link to post
    Share on other sites

    Posted (edited) · Help understanding cura.log and CuraEngine

    Yooo guys, been a while but I'm close to finishing a little python program to calculate settings to send to CuraEngine. Just a little bit more help is needed. What are the "extruderValue", "extruderValues" and "resolve" function doing exactly? I have an idea looking at the source code in Cura but would like to know for sure. Thanks.

    Edited by mersault
  • Link to post
    Share on other sites

    Posted · Help understanding cura.log and CuraEngine

    A "resolve function" is used when a setting is defined per extruder, but a global value is needed. An example of such a setting is the material_bed_temperature; each extruder can have a different material, and each material prescribes a bed temperature. So which temperature should be used if the material need a different temperature?

     

    extruderValues is a function which returns a list of (evaluated) values, one for each extruder. You would have to pick one of these values.

  • 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

      • Introducing Universal Cura Projects in the UltiMaker Cura 5.7 beta
        Strap in for the first Cura release of 2024! This 5.7 beta release brings new material profiles as well as cloud printing for Method series printers, and introduces a powerful new way of sharing print settings using printer-agnostic project files! Also, if you want to download the cute dinosaur card holder featured below, it was specially designed for this release and can be found on Thingiverse! 
          • Like
        • 10 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
          • Like
        • 0 replies
    ×
    ×
    • Create New...