Don't extrude acute angles

This commit is contained in:
Alessandro Ranellucci 2011-10-01 14:26:54 +02:00
parent 25ea8a0204
commit ea88cad8e3
4 changed files with 52 additions and 5 deletions

View file

@ -8,12 +8,12 @@ use constant X => 0;
use constant Y => 1;
sub factor {
return $Slic3r::resolution * 10;
return $Slic3r::resolution * 100;
}
sub svg {
my ($print) = @_;
$print ||= Slic3r::Print->new(x_length => 200 / $Slic3r::resolution, y_length => 200 / $Slic3r::resolution);
return SVG->new(width => $print->max_length * factor(), height => $print->max_length * factor());
}
@ -56,7 +56,8 @@ sub output_points {
}
sub output_polygons {
my ($print, $filename, $polygons) = @_;
my ($print, $filename, $polygons, $type) = @_;
$type ||= 'polygon';
my $svg = svg($print);
my $g = $svg->group(
@ -72,7 +73,7 @@ sub output_polygons {
'y' => [ map($_->[Y] * factor(), @$polygon) ],
-type => 'polygon',
);
$g->polygon(
$g->$type(
%$path,
);
}
@ -80,6 +81,10 @@ sub output_polygons {
write_svg($svg, $filename);
}
sub output_polylines {
return output_polygons(@_, 'polyline');
}
sub output_lines {
my ($print, $filename, $lines) = @_;