Jump to content
Ultimaker Community of 3D Printing Experts
mersault

Help understanding cura.log and CuraEngine

Recommended Posts

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.

 

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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

Share this post


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

×

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!