Polyline.pm 558 B

12345678910111213141516171819
  1. #/|/ Copyright (c) Prusa Research 2018 Vojtěch Bubník @bubnikv
  2. #/|/ Copyright (c) Slic3r 2011 - 2014 Alessandro Ranellucci @alranel
  3. #/|/ Copyright (c) 2012 Mark Hindess
  4. #/|/
  5. #/|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
  6. #/|/
  7. package Slic3r::Polyline;
  8. use strict;
  9. use warnings;
  10. use Slic3r::Geometry qw(X Y);
  11. sub new_scale {
  12. my $class = shift;
  13. my @points = map { ref($_) eq 'Slic3r::Point' ? $_->pp : $_ } @_;
  14. return $class->new(map [ Slic3r::Geometry::scale($_->[X]), Slic3r::Geometry::scale($_->[Y]) ], @points);
  15. }
  16. 1;