From 71a44e253c9abed7f6cfdb250ae99059481d19f0 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 7 Nov 2011 15:49:07 +0100 Subject: [PATCH] Renamed "multiply" to "duplicate". #7 --- README.markdown | 8 ++++---- lib/Slic3r.pm | 6 +++--- lib/Slic3r/Config.pm | 30 +++++++++++++++--------------- lib/Slic3r/GUI/SkeinPanel.pm | 2 +- lib/Slic3r/STL.pm | 18 +++++++++--------- slic3r.pl | 14 +++++++------- 6 files changed, 39 insertions(+), 39 deletions(-) diff --git a/README.markdown b/README.markdown index 120633c61..c1e9a50a5 100644 --- a/README.markdown +++ b/README.markdown @@ -45,7 +45,7 @@ Slic3r current features are: * save configuration profiles; * center print around bed center point; * multiple solid layers near horizontal external surfaces; -* ability to scale, rotate and multiply input object; +* ability to scale, rotate and duplicate input object; * customizable initial and final GCODE (using command line only); * use different speed for bottom layer and perimeters; * experimental support for G2/G3 native arcs. @@ -147,8 +147,8 @@ The author is Alessandro Ranellucci (me). Transform options: --scale Factor for scaling input object (default: 1) --rotate Rotation angle in degrees (0-360, default: 0) - --multiply-x Number of items along X axis (1+, default: 1) - --multiply-y Number of items along Y axis (1+, default: 1) - --multiply-distance Distance in mm between copies (default: 6) + --duplicate-x Number of items along X axis (1+, default: 1) + --duplicate-y Number of items along Y axis (1+, default: 1) + --duplicate-distance Distance in mm between copies (default: 6) diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index e5b2126a7..256085e8e 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm @@ -83,8 +83,8 @@ our $skirt_distance = 6; # mm # transform options our $scale = 1; our $rotate = 0; -our $multiply_x = 1; -our $multiply_y = 1; -our $multiply_distance = 6; # mm +our $duplicate_x = 1; +our $duplicate_y = 1; +our $duplicate_distance = 6; # mm 1; diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 79e3a764e..8db8a2dd4 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -136,16 +136,16 @@ our $Options = { label => 'Rotate (°)', type => 'i', }, - 'multiply_x' => { - label => 'Multiply along X', + 'duplicate_x' => { + label => 'Copies along X', type => 'i', }, - 'multiply_y' => { - label => 'Multiply along Y', + 'duplicate_y' => { + label => 'Copies along Y', type => 'i', }, - 'multiply_distance' => { - label => 'Multiply distance', + 'duplicate_distance' => { + label => 'Distance between copies', type => 'i', }, }; @@ -272,17 +272,17 @@ sub validate { die "Invalid value for --scale\n" if $Slic3r::scale <= 0; - # --multiply-x - die "Invalid value for --multiply-x\n" - if $Slic3r::multiply_x < 1; + # --duplicate-x + die "Invalid value for --duplicate-x\n" + if $Slic3r::duplicate_x < 1; - # --multiply-y - die "Invalid value for --multiply-y\n" - if $Slic3r::multiply_y < 1; + # --duplicate-y + die "Invalid value for --duplicate-y\n" + if $Slic3r::duplicate_y < 1; - # --multiply-distance - die "Invalid value for --multiply-distance\n" - if $Slic3r::multiply_distance < 1; + # --duplicate-distance + die "Invalid value for --duplicate-distance\n" + if $Slic3r::duplicate_distance < 1; } 1; diff --git a/lib/Slic3r/GUI/SkeinPanel.pm b/lib/Slic3r/GUI/SkeinPanel.pm index 53a7a7c22..f45382985 100644 --- a/lib/Slic3r/GUI/SkeinPanel.pm +++ b/lib/Slic3r/GUI/SkeinPanel.pm @@ -45,7 +45,7 @@ sub new { ), transform => Slic3r::GUI::OptionsGroup->new($self, title => 'Transform', - options => [qw(scale rotate multiply_x multiply_y multiply_distance)], + options => [qw(scale rotate duplicate_x duplicate_y duplicate_distance)], ), ); $self->{panels} = \%panels; diff --git a/lib/Slic3r/STL.pm b/lib/Slic3r/STL.pm index bd6834e57..cc1d692ad 100644 --- a/lib/Slic3r/STL.pm +++ b/lib/Slic3r/STL.pm @@ -47,17 +47,17 @@ sub parse_file { $extents[$_][MAX] *= $Slic3r::scale; } - # multiply object - my @multiply_offset = ( - (($extents[X][MAX] - $extents[X][MIN]) + $Slic3r::multiply_distance), - (($extents[Y][MAX] - $extents[Y][MIN]) + $Slic3r::multiply_distance), + # duplicate object + my @duplicate_offset = ( + (($extents[X][MAX] - $extents[X][MIN]) + $Slic3r::duplicate_distance), + (($extents[Y][MAX] - $extents[Y][MIN]) + $Slic3r::duplicate_distance), ); - $extents[X][MAX] += $multiply_offset[X] * ($Slic3r::multiply_x-1); - $extents[Y][MAX] += $multiply_offset[Y] * ($Slic3r::multiply_y-1); + $extents[X][MAX] += $duplicate_offset[X] * ($Slic3r::duplicate_x-1); + $extents[Y][MAX] += $duplicate_offset[Y] * ($Slic3r::duplicate_y-1); my @copies = (); - for (my $i = 0; $i < $Slic3r::multiply_x; $i++) { - for (my $j = 0; $j < $Slic3r::multiply_y; $j++) { - push @copies, [ $multiply_offset[X] * $i, $multiply_offset[Y] * $j ]; + for (my $i = 0; $i < $Slic3r::duplicate_x; $i++) { + for (my $j = 0; $j < $Slic3r::duplicate_y; $j++) { + push @copies, [ $duplicate_offset[X] * $i, $duplicate_offset[Y] * $j ]; } } diff --git a/slic3r.pl b/slic3r.pl index 8af77f704..bd245f714 100755 --- a/slic3r.pl +++ b/slic3r.pl @@ -66,9 +66,9 @@ GetOptions( # transform options 'scale=f' => \$Slic3r::scale, 'rotate=i' => \$Slic3r::rotate, - 'multiply-x=i' => \$Slic3r::multiply_x, - 'multiply-y=i' => \$Slic3r::multiply_y, - 'multiply-distance=i' => \$Slic3r::multiply_distance, + 'duplicate-x=i' => \$Slic3r::duplicate_x, + 'duplicate-y=i' => \$Slic3r::duplicate_y, + 'duplicate-distance=i' => \$Slic3r::duplicate_distance, ); # load configuration @@ -133,7 +133,7 @@ Usage: slic3r.pl [ OPTIONS ] file.stl by all firmwares) Filament options: - --filament-diameter Diameter of your raw filament (default: $Slic3r::filament_diameter) + --filament-diameter Diameter in mm of your raw filament (default: $Slic3r::filament_diameter) --filament-packing-density Ratio of the extruded volume over volume pushed into the extruder (default: $Slic3r::filament_packing_density) @@ -184,9 +184,9 @@ Usage: slic3r.pl [ OPTIONS ] file.stl Transform options: --scale Factor for scaling input object (default: $Slic3r::scale) --rotate Rotation angle in degrees (0-360, default: $Slic3r::rotate) - --multiply-x Number of items along X axis (1+, default: $Slic3r::multiply_x) - --multiply-y Number of items along Y axis (1+, default: $Slic3r::multiply_y) - --multiply-distance Distance in mm between copies (default: $Slic3r::multiply_distance) + --duplicate-x Number of items along X axis (1+, default: $Slic3r::duplicate_x) + --duplicate-y Number of items along Y axis (1+, default: $Slic3r::duplicate_y) + --duplicate-distance Distance in mm between copies (default: $Slic3r::duplicate_distance) EOF exit ($exit_code || 0);