Unfinished work for decoupling GUI from the Print object (goal = more speed for manipulation, less memory usage)

This commit is contained in:
Alessandro Ranellucci 2012-08-29 19:37:27 +02:00
parent f29d455319
commit 191de5d078
5 changed files with 223 additions and 166 deletions

View file

@ -4,7 +4,7 @@ use warnings;
use Math::Clipper qw();
use Scalar::Util qw(reftype);
use Slic3r::Geometry qw(A B polyline_remove_parallel_continuous_edges polyline_remove_acute_vertices
use Slic3r::Geometry qw(A B X Y MIN MAX polyline_remove_parallel_continuous_edges polyline_remove_acute_vertices
polyline_lines move_points same_point);
# the constructor accepts an array(ref) of points
@ -140,6 +140,13 @@ sub bounding_box {
return Slic3r::Geometry::bounding_box($self);
}
sub size {
my $self = shift;
my @extents = $self->bounding_box;
return map $extents[$_][MAX] - $extents[$_][MIN], (X,Y);
}
sub rotate {
my $self = shift;
my ($angle, $center) = @_;