Do not pass the Print object to SVG::output anymore

This commit is contained in:
Alessandro Ranellucci 2012-11-01 11:34:53 +01:00
parent 554d10c854
commit cb4ede7f9e
5 changed files with 8 additions and 11 deletions

View file

@ -51,7 +51,7 @@ sub fill_surface {
if (0) { if (0) {
require "Slic3r/SVG.pm"; require "Slic3r/SVG.pm";
Slic3r::SVG::output(undef, "fill.svg", Slic3r::SVG::output("fill.svg",
polygons => $expolygon, polygons => $expolygon,
polylines => [map $_->p, @paths], polylines => [map $_->p, @paths],
); );

View file

@ -129,7 +129,7 @@ sub make_surfaces {
if (0) { if (0) {
require "Slic3r/SVG.pm"; require "Slic3r/SVG.pm";
Slic3r::SVG::output(undef, "surfaces.svg", Slic3r::SVG::output("surfaces.svg",
polygons => [ map $_->contour, @{$self->slices} ], polygons => [ map $_->contour, @{$self->slices} ],
red_polygons => [ map $_->p, map @{$_->holes}, @{$self->slices} ], red_polygons => [ map $_->p, map @{$_->holes}, @{$self->slices} ],
); );
@ -462,7 +462,7 @@ sub process_bridges {
if (0) { if (0) {
require "Slic3r/SVG.pm"; require "Slic3r/SVG.pm";
Slic3r::SVG::output(undef, "bridge_surfaces.svg", Slic3r::SVG::output("bridge_surfaces.svg",
green_polygons => [ map $_->p, @supporting_surfaces ], green_polygons => [ map $_->p, @supporting_surfaces ],
red_polygons => [ @$expolygon ], red_polygons => [ @$expolygon ],
); );
@ -494,7 +494,7 @@ sub process_bridges {
if (0) { if (0) {
require "Slic3r/SVG.pm"; require "Slic3r/SVG.pm";
Slic3r::SVG::output(undef, "bridge_edges.svg", Slic3r::SVG::output("bridge_edges.svg",
polylines => [ map $_->p, @edges ], polylines => [ map $_->p, @edges ],
); );
} }

View file

@ -595,7 +595,7 @@ sub generate_support_material {
if (0) { if (0) {
require "Slic3r/SVG.pm"; require "Slic3r/SVG.pm";
Slic3r::SVG::output(undef, "support_$_.svg", Slic3r::SVG::output("support_$_.svg",
polylines => [ map $_->polyline, map @$_, $support_patterns->[$_] ], polylines => [ map $_->polyline, map @$_, $support_patterns->[$_] ],
polygons => [ map @$_, @support_material_areas ], polygons => [ map @$_, @support_material_areas ],
) for 0 .. $#$support_patterns; ) for 0 .. $#$support_patterns;

View file

@ -12,10 +12,7 @@ sub factor {
} }
sub svg { sub svg {
my ($print) = @_;
$print ||= Slic3r::Print->new(x_length => 200 / &Slic3r::SCALING_FACTOR, y_length => 200 / &Slic3r::SCALING_FACTOR);
my $svg = SVG->new(width => 200 * 10, height => 200 * 10); my $svg = SVG->new(width => 200 * 10, height => 200 * 10);
my $marker_end = $svg->marker( my $marker_end = $svg->marker(
id => "endArrow", id => "endArrow",
viewBox => "0 0 10 10", viewBox => "0 0 10 10",
@ -35,9 +32,9 @@ sub svg {
} }
sub output { sub output {
my ($print, $filename, %things) = @_; my ($filename, %things) = @_;
my $svg = svg($print); my $svg = svg();
foreach my $type (qw(polygons polylines white_polygons green_polygons red_polygons red_polylines)) { foreach my $type (qw(polygons polylines white_polygons green_polygons red_polygons red_polylines)) {
if ($things{$type}) { if ($things{$type}) {

View file

@ -240,7 +240,7 @@ sub make_loops {
Slic3r::debugf " this shouldn't happen and should be further investigated\n"; Slic3r::debugf " this shouldn't happen and should be further investigated\n";
if (0) { if (0) {
require "Slic3r/SVG.pm"; require "Slic3r/SVG.pm";
Slic3r::SVG::output(undef, "same_point.svg", Slic3r::SVG::output("same_point.svg",
lines => [ map $_->line, grep !defined $_->[I_FACET_EDGE], @lines ], lines => [ map $_->line, grep !defined $_->[I_FACET_EDGE], @lines ],
red_lines => [ map $_->line, grep defined $_->[I_FACET_EDGE], @lines ], red_lines => [ map $_->line, grep defined $_->[I_FACET_EDGE], @lines ],
#points => [ $self->vertices->[$point_id] ], #points => [ $self->vertices->[$point_id] ],