Renamed "multiply" to "duplicate". #7
This commit is contained in:
parent
279bfbb10d
commit
71a44e253c
@ -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)
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 ];
|
||||
}
|
||||
}
|
||||
|
||||
|
14
slic3r.pl
14
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);
|
||||
|
Loading…
Reference in New Issue
Block a user