2011-09-04 10:04:01 +00:00
|
|
|
package Slic3r::ExtrusionPath;
|
2013-07-15 10:14:22 +00:00
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
use parent qw(Exporter);
|
2011-09-04 10:04:01 +00:00
|
|
|
|
2012-12-05 09:47:41 +00:00
|
|
|
our @EXPORT_OK = qw(EXTR_ROLE_PERIMETER EXTR_ROLE_EXTERNAL_PERIMETER
|
2013-05-14 18:19:42 +00:00
|
|
|
EXTR_ROLE_CONTOUR_INTERNAL_PERIMETER EXTR_ROLE_OVERHANG_PERIMETER
|
2013-03-16 23:42:53 +00:00
|
|
|
EXTR_ROLE_FILL EXTR_ROLE_SOLIDFILL EXTR_ROLE_TOPSOLIDFILL EXTR_ROLE_BRIDGE
|
|
|
|
EXTR_ROLE_INTERNALBRIDGE EXTR_ROLE_SKIRT EXTR_ROLE_SUPPORTMATERIAL EXTR_ROLE_GAPFILL);
|
2012-05-19 13:40:11 +00:00
|
|
|
our %EXPORT_TAGS = (roles => \@EXPORT_OK);
|
|
|
|
|
2012-02-25 13:46:21 +00:00
|
|
|
sub clip_with_polygon {
|
|
|
|
my $self = shift;
|
|
|
|
my ($polygon) = @_;
|
|
|
|
|
|
|
|
return $self->clip_with_expolygon(Slic3r::ExPolygon->new($polygon));
|
|
|
|
}
|
|
|
|
|
2012-02-19 11:03:36 +00:00
|
|
|
sub clip_with_expolygon {
|
|
|
|
my $self = shift;
|
|
|
|
my ($expolygon) = @_;
|
|
|
|
|
2013-06-20 18:11:46 +00:00
|
|
|
return map $self->clone(polyline => $_),
|
2013-07-16 07:49:34 +00:00
|
|
|
$self->polyline->clip_with_expolygon($expolygon);
|
2013-06-20 18:11:46 +00:00
|
|
|
}
|
|
|
|
|
2013-03-16 17:42:56 +00:00
|
|
|
sub simplify {
|
|
|
|
my $self = shift;
|
2013-07-16 15:13:01 +00:00
|
|
|
$self->polyline($self->polyline->simplify(@_));
|
|
|
|
}
|
|
|
|
|
2011-12-30 18:59:51 +00:00
|
|
|
sub points {
|
|
|
|
my $self = shift;
|
|
|
|
return $self->polyline;
|
|
|
|
}
|
|
|
|
|
2011-09-04 10:04:01 +00:00
|
|
|
1;
|