Browse Source

Further Perl eradication

Vojtech Bubnik 2 years ago
parent
commit
2eb0417018

+ 0 - 6
lib/Slic3r.pm

@@ -32,18 +32,12 @@ use Moo 1.003001;
 
 use Slic3r::XS;   # import all symbols (constants etc.) before they get parsed
 use Slic3r::Config;
-use Slic3r::ExPolygon;
-use Slic3r::ExtrusionLoop;
-use Slic3r::ExtrusionPath;
 use Slic3r::GCode::Reader;
-use Slic3r::Layer;
 use Slic3r::Line;
 use Slic3r::Model;
 use Slic3r::Point;
 use Slic3r::Polygon;
 use Slic3r::Polyline;
-use Slic3r::Print::Object;
-use Slic3r::Surface;
 our $build = eval "use Slic3r::Build; 1";
 
 # Scaling between the float and integer coordinates.

+ 0 - 12
lib/Slic3r/ExPolygon.pm

@@ -1,12 +0,0 @@
-package Slic3r::ExPolygon;
-use strict;
-use warnings;
-
-# an ExPolygon is a polygon with holes
-
-sub bounding_box {
-    my $self = shift;
-    return $self->contour->bounding_box;
-}
-
-1;

+ 0 - 12
lib/Slic3r/ExtrusionLoop.pm

@@ -1,12 +0,0 @@
-package Slic3r::ExtrusionLoop;
-use strict;
-use warnings;
-
-use parent qw(Exporter);
-
-our @EXPORT_OK = qw(EXTRL_ROLE_DEFAULT
-    EXTRL_ROLE_CONTOUR_INTERNAL_PERIMETER EXTRL_ROLE_SKIRT);
-our %EXPORT_TAGS = (roles => \@EXPORT_OK);
-
-
-1;

+ 0 - 13
lib/Slic3r/ExtrusionPath.pm

@@ -1,13 +0,0 @@
-package Slic3r::ExtrusionPath;
-use strict;
-use warnings;
-
-use parent qw(Exporter);
-
-our @EXPORT_OK = qw(EXTR_ROLE_PERIMETER EXTR_ROLE_EXTERNAL_PERIMETER EXTR_ROLE_OVERHANG_PERIMETER
-    EXTR_ROLE_FILL EXTR_ROLE_SOLIDFILL EXTR_ROLE_TOPSOLIDFILL EXTR_ROLE_GAPFILL EXTR_ROLE_BRIDGE 
-    EXTR_ROLE_SKIRT EXTR_ROLE_SUPPORTMATERIAL EXTR_ROLE_SUPPORTMATERIAL_INTERFACE
-    EXTR_ROLE_NONE);
-our %EXPORT_TAGS = (roles => \@EXPORT_OK);
-
-1;

+ 0 - 17
lib/Slic3r/Geometry.pm

@@ -34,21 +34,4 @@ sub scaled_epsilon () { epsilon / &Slic3r::SCALING_FACTOR }
 sub scale   ($) { $_[0] / &Slic3r::SCALING_FACTOR }
 sub unscale ($) { $_[0] * &Slic3r::SCALING_FACTOR }
 
-# 2D
-sub bounding_box {
-    my ($points) = @_;
-    
-    my @x = map $_->x, @$points;
-    my @y = map $_->y, @$points;    #,,
-    my @bb = (undef, undef, undef, undef);
-    for (0..$#x) {
-        $bb[X1] = $x[$_] if !defined $bb[X1] || $x[$_] < $bb[X1];
-        $bb[X2] = $x[$_] if !defined $bb[X2] || $x[$_] > $bb[X2];
-        $bb[Y1] = $y[$_] if !defined $bb[Y1] || $y[$_] < $bb[Y1];
-        $bb[Y2] = $y[$_] if !defined $bb[Y2] || $y[$_] > $bb[Y2];
-    }
-    
-    return @bb[X1,Y1,X2,Y2];
-}
-
 1;

+ 0 - 18
lib/Slic3r/Layer.pm

@@ -1,18 +0,0 @@
-# Extends the C++ class Slic3r::Layer.
-
-package Slic3r::Layer;
-use strict;
-use warnings;
-
-# the following two were previously generated by Moo
-sub print {
-    my $self = shift;
-    return $self->object->print;
-}
-
-sub config {
-    my $self = shift;
-    return $self->object->config;
-}
-
-1;

+ 0 - 9
lib/Slic3r/Print/Object.pm

@@ -1,9 +0,0 @@
-package Slic3r::Print::Object;
-# extends c++ class Slic3r::PrintObject (Print.xsp)
-use strict;
-use warnings;
-
-use List::Util qw(min max sum first);
-use Slic3r::Surface ':types';
-
-1;

+ 0 - 15
lib/Slic3r/Surface.pm

@@ -1,15 +0,0 @@
-package Slic3r::Surface;
-use strict;
-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_TAGS = (types => \@EXPORT_OK);
-
-sub p {
-    my $self = shift;
-    return @{$self->polygons};
-}
-
-1;

+ 6 - 6
t/geometry.t

@@ -2,7 +2,7 @@ use Test::More;
 use strict;
 use warnings;
 
-plan tests => 11;
+plan tests => 10;
 
 BEGIN {
     use FindBin;
@@ -57,11 +57,11 @@ my $polygons = [
 
 #==========================================================
 
-{
-    my $bb = Slic3r::Geometry::BoundingBox->new_from_points([ map Slic3r::Point->new(@$_), [0, 1], [10, 2], [20, 2] ]);
-    $bb->scale(2);
-    is_deeply [ $bb->min_point->pp, $bb->max_point->pp ], [ [0,2], [40,4] ], 'bounding box is scaled correctly';
-}
+#{
+#    my $bb = Slic3r::Geometry::BoundingBox->new_from_points([ map Slic3r::Point->new(@$_), [0, 1], [10, 2], [20, 2] ]);
+#    $bb->scale(2);
+#    is_deeply [ $bb->min_point->pp, $bb->max_point->pp ], [ [0,2], [40,4] ], 'bounding box is scaled correctly';
+#}
 
 #==========================================================
 

+ 0 - 1
xs/CMakeLists.txt

@@ -43,7 +43,6 @@ set(XS_MAIN_XS ${CMAKE_CURRENT_BINARY_DIR}/main.xs)
 set(XSP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/xsp)
 #FIXME list the dependecies explicitely, add dependency on the typemap.
 set(XS_XSP_FILES
-    ${XSP_DIR}/BoundingBox.xsp
     ${XSP_DIR}/Config.xsp
     ${XSP_DIR}/ExPolygon.xsp
     ${XSP_DIR}/Geometry.xsp

Some files were not shown because too many files changed in this diff