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.*/
this removes duplicated code and fixes toolchange retraction
The ooze prevention part needs further work, now it does not
work as advertised (the tall skirt)
Co-authored-by: supermerill <merill@free.fr>
Based on the unfinished idea of @supermerill, defining ExtrusionRole
as a bit mask of ExtrusionRoleModifier.
Because the ExtrusionRole was used for both ExtrusionEntity and
G-code export / G-code viewer, the original ExtrusionRole had to be split
to ExtrusionRole and GCodeExtrusionRole to support bitmask attributes
for the former while keeing a low number of ordinary values for the latter.
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.
1) Flipped the order of "discover_vertical_shells" and "process_external_surfaces",
now the external surfaces are expanded after "discover_vertical_shells"
aka "ensure vertical wall thickness" is solved.
2) Reworked LayerRegion::process_external_surfaces() to only expand into
"ensure vertical wall thickness" regions, also the expansion is done
in small steps to avoid overflowing into neighbor regions.
also:
Utility functions reserve_more(), reserve_power_of_2(), reserve_more_power_of_2()
Various SurfaceCollecion::filter_xxx() modified to accept an initializer list of surface types.
New bridges detector refactored to accept overhang boundaries.
BoundingBoxWrapper was moved from RetractCrossingPerimeters to AABBTreeIndirect.
1) New region expansion code to propagate wave from a boundary
of a region inside of it.
2) get_extents() extended with a template attribute to work with
zero area data sets.
3) ClipperZUtils.hpp for handling Clipper operation with Z coordinate
(for source contour identification)