From c221e97ddcc95f10ff1e81b43a45ea1a3be13fbb Mon Sep 17 00:00:00 2001 From: supermerill Date: Thu, 29 Nov 2018 14:13:37 +0100 Subject: [PATCH] refactor perl to also use the flag system (only one line really use it in suportmaterial.pm) --- lib/Slic3r/Print/SupportMaterial.pm | 2 +- lib/Slic3r/Surface.pm | 2 +- xs/src/libslic3r/Layer.cpp | 2 +- xs/src/libslic3r/PrintObject.cpp | 2 +- xs/xsp/Surface.xsp | 7 +++---- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/Slic3r/Print/SupportMaterial.pm b/lib/Slic3r/Print/SupportMaterial.pm index 5c7324d65..0fcfecf2f 100644 --- a/lib/Slic3r/Print/SupportMaterial.pm +++ b/lib/Slic3r/Print/SupportMaterial.pm @@ -269,7 +269,7 @@ sub contact_area { # remove the entire bridges and only support the unsupported edges my @bridges = map $_->expolygon, 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 --git a/lib/Slic3r/Surface.pm b/lib/Slic3r/Surface.pm index 0c5bb5d23..2b1814120 100644 --- a/lib/Slic3r/Surface.pm +++ b/lib/Slic3r/Surface.pm @@ -4,7 +4,7 @@ use warnings; require 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); sub p { diff --git a/xs/src/libslic3r/Layer.cpp b/xs/src/libslic3r/Layer.cpp index 26c766890..044f14f58 100644 --- a/xs/src/libslic3r/Layer.cpp +++ b/xs/src/libslic3r/Layer.cpp @@ -267,7 +267,7 @@ Layer::make_fills() /// 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: /// 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_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. diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index 9de82f268..05330814e 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -524,7 +524,7 @@ PrintObject::bridge_over_infill() )}; push @new_surfaces, map Slic3r::Surface->new( expolygon => $_, - surface_type => S_TYPE_INTERNALVOID, + surface_type => S_TYPE_INTERNAL + S_TYPE_VOID, ), @{intersection_ex( [ map $_->p, @$group ], [ map @$_, @$to_bridge ], diff --git a/xs/xsp/Surface.xsp b/xs/xsp/Surface.xsp index d3fef5336..76cd20644 100644 --- a/xs/xsp/Surface.xsp +++ b/xs/xsp/Surface.xsp @@ -105,11 +105,10 @@ _constant() ALIAS: S_TYPE_TOP = stTop S_TYPE_BOTTOM = stBottom - S_TYPE_BOTTOMBRIDGE = stBottom | stBridge S_TYPE_INTERNAL = stInternal - S_TYPE_INTERNALSOLID = stInternal | stSolid - S_TYPE_INTERNALBRIDGE = stInternal | stBridge - S_TYPE_INTERNALVOID = stInternal | stVoid + S_TYPE_SOLID = stSolid + S_TYPE_BRIDGE = stBridge + S_TYPE_VOID = stVoid PROTOTYPE: CODE: RETVAL = ix;