From 69a92c10f0d9e0023b6bc03c39e3447741eb23ef Mon Sep 17 00:00:00 2001 From: Jose Luis Perez Diez Date: Tue, 10 Sep 2013 17:14:49 +0200 Subject: [PATCH 1/2] Round results when rotating to minimize errors & pass the tests --- xs/src/Point.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xs/src/Point.cpp b/xs/src/Point.cpp index 612d7b0b0..f496c70ba 100644 --- a/xs/src/Point.cpp +++ b/xs/src/Point.cpp @@ -22,8 +22,8 @@ Point::rotate(double angle, Point* center) { double cur_x = (double)this->x; double cur_y = (double)this->y; - this->x = (long)( (double)center->x + cos(angle) * (cur_x - (double)center->x) - sin(angle) * (cur_y - (double)center->y) ); - this->y = (long)( (double)center->y + cos(angle) * (cur_y - (double)center->y) + sin(angle) * (cur_x - (double)center->x) ); + this->x = (long)round( (double)center->x + cos(angle) * (cur_x - (double)center->x) - sin(angle) * (cur_y - (double)center->y) ); + this->y = (long)round( (double)center->y + cos(angle) * (cur_y - (double)center->y) + sin(angle) * (cur_x - (double)center->x) ); } bool From fdbd62e62d59055e440db201fa84c306a8e5c65f Mon Sep 17 00:00:00 2001 From: Jose Luis Perez Diez Date: Wed, 11 Sep 2013 13:23:50 +0200 Subject: [PATCH 2/2] clean use XXX --- lib/Slic3r/Geometry.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Slic3r/Geometry.pm b/lib/Slic3r/Geometry.pm index 93b0924d8..abe00f209 100644 --- a/lib/Slic3r/Geometry.pm +++ b/lib/Slic3r/Geometry.pm @@ -657,7 +657,7 @@ sub _line_intersection2 { # 2D sub bounding_box { my ($points) = @_; - use XXX; ZZZ "not" if ref($points->[0]) eq 'ARRAY'; + my @x = map $_->x, @$points; my @y = map $_->y, @$points; #,, my @bb = (undef, undef, undef, undef);