Browse Source

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

supermerill 6 years ago
parent
commit
c221e97ddc

+ 1 - 1
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,

+ 1 - 1
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 {

+ 1 - 1
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.

+ 1 - 1
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 ],

+ 3 - 4
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;