Skip to content

Commit

Permalink
Renamed "multiply" to "duplicate". #7
Browse files Browse the repository at this point in the history
  • Loading branch information
alranel committed Nov 7, 2011
1 parent 279bfbb commit 71a44e2
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 39 deletions.
8 changes: 4 additions & 4 deletions README.markdown
Expand Up @@ -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.
Expand Down Expand Up @@ -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)

6 changes: 3 additions & 3 deletions lib/Slic3r.pm
Expand Up @@ -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;
30 changes: 15 additions & 15 deletions lib/Slic3r/Config.pm
Expand Up @@ -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',
},
};
Expand Down Expand Up @@ -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;
2 changes: 1 addition & 1 deletion lib/Slic3r/GUI/SkeinPanel.pm
Expand Up @@ -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;
Expand Down
18 changes: 9 additions & 9 deletions lib/Slic3r/STL.pm
Expand Up @@ -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 ];
}
}

Expand Down
14 changes: 7 additions & 7 deletions slic3r.pl
Expand Up @@ -66,9 +66,9 @@ BEGIN
# 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
Expand Down Expand Up @@ -133,7 +133,7 @@ sub usage {
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)
Expand Down Expand Up @@ -184,9 +184,9 @@ sub usage {
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);
Expand Down

0 comments on commit 71a44e2

Please sign in to comment.