mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-31 13:31:58 +08:00
Bugfix: --rotate did not support decimal values and interpreted them as radians. #3460
This commit is contained in:
parent
8f0d8f2096
commit
6575a15cf7
@ -14,6 +14,7 @@ use Getopt::Long qw(:config no_auto_abbrev);
|
||||
use List::Util qw(first);
|
||||
use POSIX qw(setlocale LC_NUMERIC);
|
||||
use Slic3r;
|
||||
use Slic3r::Geometry qw(deg2rad);
|
||||
use Time::HiRes qw(gettimeofday tv_interval);
|
||||
$|++;
|
||||
binmode STDOUT, ':utf8';
|
||||
@ -45,7 +46,7 @@ my %cli_options = ();
|
||||
'info' => \$opt{info},
|
||||
|
||||
'scale=f' => \$opt{scale},
|
||||
'rotate=i' => \$opt{rotate},
|
||||
'rotate=f' => \$opt{rotate},
|
||||
'duplicate=i' => \$opt{duplicate},
|
||||
'duplicate-grid=s' => \$opt{duplicate_grid},
|
||||
'print-center=s' => \$opt{print_center},
|
||||
@ -203,7 +204,7 @@ if (@ARGV) { # slicing from command line
|
||||
|
||||
my $sprint = Slic3r::Print::Simple->new(
|
||||
scale => $opt{scale} // 1,
|
||||
rotate => $opt{rotate} // 0,
|
||||
rotate => deg2rad($opt{rotate} // 0),
|
||||
duplicate => $opt{duplicate} // 1,
|
||||
duplicate_grid => $opt{duplicate_grid} // [1,1],
|
||||
print_center => $opt{print_center} // Slic3r::Pointf->new(100,100),
|
||||
|
@ -88,7 +88,7 @@ main(const int argc, const char **argv)
|
||||
(*o)->scale_to_fit(cli_config.scale_to_fit.value);
|
||||
|
||||
(*o)->scale(cli_config.scale.value);
|
||||
(*o)->rotate(cli_config.rotate.value, Z);
|
||||
(*o)->rotate(deg2rad(cli_config.rotate.value), Z);
|
||||
}
|
||||
|
||||
// TODO: handle --merge
|
||||
|
Loading…
x
Reference in New Issue
Block a user