From 74f25ef52fc3a15eb84ee37a397cfdc873f28a6e Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 21 Dec 2014 23:43:53 +0100 Subject: [PATCH] Consolidated all PlanePath classes in a single file --- lib/Slic3r/Fill.pm | 4 --- lib/Slic3r/Fill/ArchimedeanChords.pm | 7 ----- lib/Slic3r/Fill/Flowsnake.pm | 18 ------------- lib/Slic3r/Fill/HilbertCurve.pm | 7 ----- lib/Slic3r/Fill/OctagramSpiral.pm | 9 ------- lib/Slic3r/Fill/PlanePath.pm | 38 ++++++++++++++++++++++++++++ 6 files changed, 38 insertions(+), 45 deletions(-) delete mode 100644 lib/Slic3r/Fill/ArchimedeanChords.pm delete mode 100644 lib/Slic3r/Fill/Flowsnake.pm delete mode 100644 lib/Slic3r/Fill/HilbertCurve.pm delete mode 100644 lib/Slic3r/Fill/OctagramSpiral.pm diff --git a/lib/Slic3r/Fill.pm b/lib/Slic3r/Fill.pm index 97c49419c..780717586 100644 --- a/lib/Slic3r/Fill.pm +++ b/lib/Slic3r/Fill.pm @@ -3,14 +3,10 @@ use Moo; use Slic3r::ExtrusionPath ':roles'; use Slic3r::Fill::3DHoneycomb; -use Slic3r::Fill::ArchimedeanChords; use Slic3r::Fill::Base; use Slic3r::Fill::Concentric; -use Slic3r::Fill::Flowsnake; -use Slic3r::Fill::HilbertCurve; use Slic3r::Fill::Honeycomb; use Slic3r::Fill::Line; -use Slic3r::Fill::OctagramSpiral; use Slic3r::Fill::PlanePath; use Slic3r::Fill::Rectilinear; use Slic3r::Flow ':roles'; diff --git a/lib/Slic3r/Fill/ArchimedeanChords.pm b/lib/Slic3r/Fill/ArchimedeanChords.pm deleted file mode 100644 index 3c71f0e36..000000000 --- a/lib/Slic3r/Fill/ArchimedeanChords.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Slic3r::Fill::ArchimedeanChords; -use Moo; - -extends 'Slic3r::Fill::PlanePath'; -use Math::PlanePath::ArchimedeanChords; - -1; diff --git a/lib/Slic3r/Fill/Flowsnake.pm b/lib/Slic3r/Fill/Flowsnake.pm deleted file mode 100644 index c852b81c7..000000000 --- a/lib/Slic3r/Fill/Flowsnake.pm +++ /dev/null @@ -1,18 +0,0 @@ -package Slic3r::Fill::Flowsnake; -use Moo; - -extends 'Slic3r::Fill::PlanePath'; - -use Math::PlanePath::Flowsnake; -use Slic3r::Geometry qw(X); - -# Sorry, this fill is currently broken. - -sub process_polyline { - my $self = shift; - my ($polyline, $bounding_box) = @_; - - $_->[X] += $bounding_box->center->[X] for @$polyline; -} - -1; diff --git a/lib/Slic3r/Fill/HilbertCurve.pm b/lib/Slic3r/Fill/HilbertCurve.pm deleted file mode 100644 index eff1a44ac..000000000 --- a/lib/Slic3r/Fill/HilbertCurve.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Slic3r::Fill::HilbertCurve; -use Moo; - -extends 'Slic3r::Fill::PlanePath'; -use Math::PlanePath::HilbertCurve; - -1; diff --git a/lib/Slic3r/Fill/OctagramSpiral.pm b/lib/Slic3r/Fill/OctagramSpiral.pm deleted file mode 100644 index 9c1272444..000000000 --- a/lib/Slic3r/Fill/OctagramSpiral.pm +++ /dev/null @@ -1,9 +0,0 @@ -package Slic3r::Fill::OctagramSpiral; -use Moo; - -extends 'Slic3r::Fill::PlanePath'; -use Math::PlanePath::OctagramSpiral; - -sub multiplier () { sqrt(2) } - -1; diff --git a/lib/Slic3r/Fill/PlanePath.pm b/lib/Slic3r/Fill/PlanePath.pm index dd942aba9..bf61a70e0 100644 --- a/lib/Slic3r/Fill/PlanePath.pm +++ b/lib/Slic3r/Fill/PlanePath.pm @@ -59,4 +59,42 @@ sub fill_surface { return { flow => $flow }, @paths; } + +package Slic3r::Fill::ArchimedeanChords; +use Moo; +extends 'Slic3r::Fill::PlanePath'; +use Math::PlanePath::ArchimedeanChords; + + +package Slic3r::Fill::Flowsnake; +use Moo; +extends 'Slic3r::Fill::PlanePath'; +use Math::PlanePath::Flowsnake; +use Slic3r::Geometry qw(X); + +# Sorry, this fill is currently broken. + +sub process_polyline { + my $self = shift; + my ($polyline, $bounding_box) = @_; + + $_->[X] += $bounding_box->center->[X] for @$polyline; +} + + +package Slic3r::Fill::HilbertCurve; +use Moo; +extends 'Slic3r::Fill::PlanePath'; +use Math::PlanePath::HilbertCurve; + + +package Slic3r::Fill::OctagramSpiral; +use Moo; +extends 'Slic3r::Fill::PlanePath'; +use Math::PlanePath::OctagramSpiral; + +sub multiplier () { sqrt(2) } + + + 1;