{if condition then block elsif}
The "then" keyword is now mandatory.
On the other hand, "then" keyword must NOT be used using old syntax:
{if condition}...{endif}
{if cond1}{expr1}{elsif cond2}{expr2}{else}{expr3}{endif}
could be written as
{if cond1;expr1;elsif cond2;expr2;else;expr3;endif}
the first semicolon after else is not manadtory, thus the following is valid
{if cond1;expr1;elsif cond2;expr2;else expr3;endif}
each expression could be also empty or contain multiple expressions:
{if cond1;elsif cond2;else endif}
Implements #4048#7196
Syntax:
(global|local) variable_name =
(scalar_expression|vector_variable|array_expr|initializer_list)
array_expr := array(repeat, value)
initializer_list := (value, value, value, ...)
The type of the newly created variable is defined by the type
of the right hand side intitializer.
Newly declared variable must not override an existing variable.
Variable may be assigned with global|local expression, but its type
must not be changed.
Newly the assignment operator also accepts the same right hand expressions
as the global|local variable definition.
1st parameter is the text to match against,
the rest of the parameters are pattern to be matched:
either strings, then the match is exact,
or regex enclosed in //
or regex string starting with ~
For example
one_of("a", "a", "b")
finds a in "a", "b"
one_of("abc", /.*a.*/)
matches "abc" using regular expression /.*a.*/
1) Implemented access to coEnum values, they are returned as strings.
2) Fixed some possible memory leaks.
3) Fixed some possible union type punning issues.
round() rounds to an integer.
This is a popular request, for example #3472
digits(value, num_digits, num_decimals) rounds to num_digits and
num_decimals, left filled with spaces.
digits(value, num_digits) the same as digits(value, num_digits, 0)
Neither decimal separator nor any decimals after decimal separator
are emitted.
zdigits(...) is the same as digits(...) only left filled with zeros.
If the result does not fit num_digits, the result is never trimmed.
config bundles, project files (3MFs, AMFs). When loading these files,
the caller may decide whether to substitute some of the configuration
values the current PrusaSlicer version does not understand with
some reasonable default value, and whether to report it. If substitution
is disabled, an exception is being thrown as before this commit.
If substitution is enabled, list of substitutions is returned by the
API to be presented to the user. This allows us to introduce for example
new firmware flavor key in PrusaSlicer 2.4 while letting PrusaSlicer
2.3.2 to fall back to some default and to report it to the user.
When slicing from command line, substutions are performed by default
and reported into the console, however substitutions may be either
disabled or made silent with the new "config-compatibility" command
line option.
Substitute enums and bools only. Allow booleans to be parsed as
true: "1", "enabled", "on" case insensitive
false: "0", "disabled", "off" case insensitive
This will allow us in the future for example to switch the draft_shield
boolean to an enum with the following values: "disabled" / "enabled" / "limited".
Added "enum_bitmask.hpp" - support for type safe sets of options.
See for example PresetBundle::load_configbundle(...
LoadConfigBundleAttributes flags) for an example of intended usage.
WIP: GUI for reporting the list of config substitutions needs to be
implemented by @YuSanka.
by the PlaceholderParser.
Namely, all the options with the "ratio_over" reference are now handled
correctly by the PlaceholderParser with the exception
of the "first_layer_extrusion_width", which overrides speed of extrusions
by their respective extrusion type.
Also the various extrusion widths (extrusion_width, first_layer_extrusion_width,
external_perimeter_extrusion_width etc.) produce the same numbers
as if ran through the back-end, with the assumption of not overriding
layer height by the variable layer height editing tool or layer height
modifiers.