diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2011-10-01 16:26:54 +0400 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2011-10-01 16:26:54 +0400 |
commit | ea88cad8e3cff262ad951ea5086fc937e2bba2e4 (patch) | |
tree | 72285ac1b90da5da377805dc1ac48454154a0553 /lib/Slic3r/SVG.pm | |
parent | 25ea8a0204ad614d871a979107a69500ffb548f4 (diff) |
Don't extrude acute angles
Diffstat (limited to 'lib/Slic3r/SVG.pm')
-rw-r--r-- | lib/Slic3r/SVG.pm | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Slic3r/SVG.pm b/lib/Slic3r/SVG.pm index 40ea5ab14..d66dca3ff 100644 --- a/lib/Slic3r/SVG.pm +++ b/lib/Slic3r/SVG.pm @@ -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) = @_; |