GregValiant 1,110
@MariMakes are there plans to include math functions and if statements in StartUp gcode?
@MariMakes are there plans to include math functions and if statements in StartUp gcode?
Oh! I wasn't aware that that wasn't the case yet. 😦
I'll have to ask the team! 💪
@itsMrJimbo at this time the "replacement patterns" in the StartUp and Ending gcodes are only replacements. There is no math or logic performed by Cura. In your case the sequence "(layer < 2 ? 0 : 15 + 45.0 * (layer - 2) / 297)" within the curly brackets isn't recognized as a valid Replacement Pattern and so it is passed on verbatim to the gcode.
What you are trying to do I think can be done in PrusaSlicer. Cura does not (yet) have this capability.
5 hours ago, MariMakes said:Hey @itsMrJimbo,
Welcome to the Ultimaker Community 🎉
I recognize your issue.
It's also been reported on our Github
It seems to be related to the {}, we've added a ticket to the backlog with the intent to improve this.
What version of Cura are you running? Because it has been reported as working as expected on Cura 5.2.1
Thanks for the help Mari, confirm I'm on 5.2.1
Oddly enough the { and } work within my start Gcode just fine (e.g.:
M140 S{material_bed_temperature_layer_0}
M104 S{material_print_temperature_layer_0}
as this was one of the first things that PrusaSlicer complained about when I tried to configure it using my existing start code.
4 hours ago, GregValiant said:@itsMrJimbo at this time the "replacement patterns" in the StartUp and Ending gcodes are only replacements. There is no math or logic performed by Cura. In your case the sequence "(layer < 2 ? 0 : 15 + 45.0 * (layer - 2) / 297)" within the curly brackets isn't recognized as a valid Replacement Pattern and so it is passed on verbatim to the gcode.
What you are trying to do I think can be done in PrusaSlicer. Cura does not (yet) have this capability.
I was wondering if this might be the case. I can confirm it works in PrusaSlicer as my example above, the function generates an F value based on the calculations and inserts at each layer.
As a work around I may try to slice it like a temperature tower just with a range of M593 F values rather than temperature changes.
I think PrusaSlicer uses square brackets and Cura uses Curly brackets. The Prusa keywords are different as well so you can't just copy and paste back and forth from Prusa StartUp to Cura StartUp.
Recommended Posts
MariMakes 178
Hey @itsMrJimbo,
Welcome to the Ultimaker Community 🎉
I recognize your issue.
It's also been reported on our Github
It seems to be related to the {}, we've added a ticket to the backlog with the intent to improve this.
What version of Cura are you running? Because it has been reported as working as expected on Cura 5.2.1
Link to post
Share on other sites