refactor perl to also use the flag system (only one line really use it in suportmaterial.pm)

This commit is contained in:
supermerill 2018-11-29 14:13:37 +01:00
parent 7eb9c6e2bb
commit c221e97ddc
5 changed files with 7 additions and 8 deletions

View File

@ -269,7 +269,7 @@ sub contact_area {
# remove the entire bridges and only support the unsupported edges # remove the entire bridges and only support the unsupported edges
my @bridges = map $_->expolygon, my @bridges = map $_->expolygon,
grep $_->bridge_angle != -1, grep $_->bridge_angle != -1,
@{$layerm->fill_surfaces->filter_by_type(S_TYPE_BOTTOMBRIDGE)}; @{$layerm->fill_surfaces->filter_by_type(S_TYPE_BOTTOM + S_TYPE_BRIDGE)};
$diff = diff( $diff = diff(
$diff, $diff,

View File

@ -4,7 +4,7 @@ use warnings;
require Exporter; require Exporter;
our @ISA = qw(Exporter); our @ISA = qw(Exporter);
our @EXPORT_OK = qw(S_TYPE_TOP S_TYPE_BOTTOM S_TYPE_BOTTOMBRIDGE S_TYPE_INTERNAL S_TYPE_INTERNALSOLID S_TYPE_INTERNALBRIDGE S_TYPE_INTERNALVOID); our @EXPORT_OK = qw(S_TYPE_TOP S_TYPE_BOTTOM S_TYPE_INTERNAL S_TYPE_SOLID S_TYPE_BRIDGE S_TYPE_VOID);
our %EXPORT_TAGS = (types => \@EXPORT_OK); our %EXPORT_TAGS = (types => \@EXPORT_OK);
sub p { sub p {

View File

@ -267,7 +267,7 @@ Layer::make_fills()
/// Initially all slices are of type S_TYPE_INTERNAL. /// Initially all slices are of type S_TYPE_INTERNAL.
/// Slices are compared against the top / bottom slices and regions and classified to the following groups: /// Slices are compared against the top / bottom slices and regions and classified to the following groups:
/// S_TYPE_TOP - Part of a region, which is not covered by any upper layer. This surface will be filled with a top solid infill. /// S_TYPE_TOP - Part of a region, which is not covered by any upper layer. This surface will be filled with a top solid infill.
/// S_TYPE_BOTTOMBRIDGE - Part of a region, which is not fully supported, but it hangs in the air, or it hangs losely on a support or a raft. /// S_TYPE_BOTTOM | S_TYPE_BRIDGE - Part of a region, which is not fully supported, but it hangs in the air, or it hangs losely on a support or a raft.
/// S_TYPE_BOTTOM - Part of a region, which is not supported by the same region, but it is supported either by another region, or by a soluble interface layer. /// S_TYPE_BOTTOM - Part of a region, which is not supported by the same region, but it is supported either by another region, or by a soluble interface layer.
/// S_TYPE_INTERNAL - Part of a region, which is supported by the same region type. /// S_TYPE_INTERNAL - Part of a region, which is supported by the same region type.
/// If a part of a region is of S_TYPE_BOTTOM and S_TYPE_TOP, the S_TYPE_BOTTOM wins. /// If a part of a region is of S_TYPE_BOTTOM and S_TYPE_TOP, the S_TYPE_BOTTOM wins.

View File

@ -524,7 +524,7 @@ PrintObject::bridge_over_infill()
)}; )};
push @new_surfaces, map Slic3r::Surface->new( push @new_surfaces, map Slic3r::Surface->new(
expolygon => $_, expolygon => $_,
surface_type => S_TYPE_INTERNALVOID, surface_type => S_TYPE_INTERNAL + S_TYPE_VOID,
), @{intersection_ex( ), @{intersection_ex(
[ map $_->p, @$group ], [ map $_->p, @$group ],
[ map @$_, @$to_bridge ], [ map @$_, @$to_bridge ],

View File

@ -105,11 +105,10 @@ _constant()
ALIAS: ALIAS:
S_TYPE_TOP = stTop S_TYPE_TOP = stTop
S_TYPE_BOTTOM = stBottom S_TYPE_BOTTOM = stBottom
S_TYPE_BOTTOMBRIDGE = stBottom | stBridge
S_TYPE_INTERNAL = stInternal S_TYPE_INTERNAL = stInternal
S_TYPE_INTERNALSOLID = stInternal | stSolid S_TYPE_SOLID = stSolid
S_TYPE_INTERNALBRIDGE = stInternal | stBridge S_TYPE_BRIDGE = stBridge
S_TYPE_INTERNALVOID = stInternal | stVoid S_TYPE_VOID = stVoid
PROTOTYPE: PROTOTYPE:
CODE: CODE:
RETVAL = ix; RETVAL = ix;