Fixed regression causing rotation from plater to also translate the resulting G-code. #1191

This commit is contained in:
Alessandro Ranellucci 2013-05-31 19:41:31 +02:00
parent c62b49d1af
commit 49531f6f78
4 changed files with 5 additions and 6 deletions

View file

@ -324,14 +324,14 @@ sub make_loops {
sub rotate {
my $self = shift;
my ($deg) = @_;
my ($deg, $center) = @_;
return if $deg == 0;
my $rad = Slic3r::Geometry::deg2rad($deg);
# transform vertex coordinates
foreach my $vertex (@{$self->vertices}) {
@$vertex = (@{ +(Slic3r::Geometry::rotate_points($rad, undef, [ $vertex->[X], $vertex->[Y] ]))[0] }, $vertex->[Z]);
@$vertex = (@{ +(Slic3r::Geometry::rotate_points($rad, $center, [ $vertex->[X], $vertex->[Y] ]))[0] }, $vertex->[Z]);
}
}