Jump to content
UltiMaker Community of 3D Printing Experts

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

      • UltiMaker Cura 5.3 stable released
        In this stable release, Cura 5.3 achieves yet another huge leap forward in 3D printing thanks to material interlocking! As well as introducing an expanded recommended print settings menu and lots of print quality improvements. Not to mention, a whole bunch of new printer profiles for non-UltiMaker printers!
          • Thanks
          • Like
        • 26 replies
      • Here it is. The new UltiMaker S7
        The UltiMaker S7 is built on the success of the UltiMaker S5 and its design decisions were heavily based on feedback from customers.
         
         
        So what’s new?
        The obvious change is the S7’s height. It now includes an integrated Air Manager. This filters the exhaust air of every print and also improves build temperature stability. To further enclose the build chamber the S7 only has one magnetically latched door.
         
        The build stack has also been completely redesigned. A PEI-coated flexible steel build plate makes a big difference to productivity. Not only do you not need tools to pop a printed part off. But we also don’t recommend using or adhesion structures for UltiMaker materials (except PC, because...it’s PC). Along with that, 4 pins and 25 magnets make it easy to replace the flex plate perfectly – even with one hand.
         
        The re-engineered print head has an inductive sensor which reduces noise when probing the build plate. This effectively makes it much harder to not achieve a perfect first layer, improving overall print success. We also reversed the front fan direction (fewer plastic hairs, less maintenance), made the print core door magnets stronger, and add a sensor that helps avoid flooding.
         

         
        The UltiMaker S7 also includes quality of life improvements:
        Reliable bed tilt compensation (no more thumbscrews) 2.4 and 5 GHz Wi-Fi A 1080p camera (mounted higher for a better view) Compatibility with 280+ Marketplace materials Compatibility with S5 project files (no reslicing needed) And a whole lot more  
        Curious to see the S7 in action?
        We’re hosting a free tech demo on February 7.
        It will be live and you can ask any questions to our CTO, Miguel Calvo.
        Register here for the Webinar
          • Like
        • 18 replies
      • UltiMaker Cura Alpha 🎄 Tree Support Spotlight 🎄
        Are you a fan of tree support, but dislike the removal process and the amount of filament it uses? Then we would like to invite you to try this special release of UltiMaker Cura. Brought to you by our special community contributor @thomasrahm
         
        We generated a special version of Cura 5.2 called 5.3.0 Alpha + Xmas. The only changes we introduced compared to UltiMaker Cura 5.2.1 are those which are needed for the new supports. So keep in mind, this is not a sneak peek for Cura 5.3 (there are some really cool new features coming up) but a spotlight release highlighting this new version of tree supports.  
          • Like
        • 22 replies
    ×
    ×
    • Create New...