Permalink
Browse files

Fixed the "Export SVG..." menu item. #399

  • Loading branch information...
1 parent 5eae22f commit 8aa20cd784274906155dadc40dfddfa8a212a81f @alexrj alexrj committed May 30, 2012
Showing with 6 additions and 8 deletions.
  1. +5 −4 lib/Slic3r/GUI/SkeinPanel.pm
  2. +1 −4 lib/Slic3r/Print.pm
@@ -169,6 +169,7 @@ sub new {
our $model_wildcard = "STL files (*.stl)|*.stl;*.STL|OBJ files (*.obj)|*.obj;*.OBJ|AMF files (*.amf)|*.amf;*.AMF;*.xml;*.XML";
our $ini_wildcard = "INI files *.ini|*.ini;*.INI";
our $gcode_wildcard = "G-code files *.gcode|*.gcode;*.GCODE";
+our $svg_wildcard = "SVG files *.svg|*.svg;*.SVG";
sub do_slice {
my $self = shift;
@@ -229,7 +230,7 @@ sub do_slice {
$output_file = $print->expanded_output_filepath($output_file);
$output_file =~ s/\.gcode$/.svg/i if $params{export_svg};
my $dlg = Wx::FileDialog->new($self, 'Save ' . ($params{export_svg} ? 'SVG' : 'G-code') . ' file as:', dirname($output_file),
- basename($output_file), $gcode_wildcard, wxFD_SAVE);
+ basename($output_file), $params{export_svg} ? $svg_wildcard : $gcode_wildcard, wxFD_SAVE);
if ($dlg->ShowModal != wxID_OK) {
$dlg->Destroy;
return;
@@ -246,7 +247,7 @@ sub do_slice {
{
my @warnings = ();
local $SIG{__WARN__} = sub { push @warnings, $_[0] };
- my %params = (
+ my %export_params = (
output_file => $output_file,
status_cb => sub {
my ($percent, $message) = @_;
@@ -256,9 +257,9 @@ sub do_slice {
},
);
if ($params{export_svg}) {
- $print->export_svg(%params);
+ $print->export_svg(%export_params);
} else {
- $print->export_gcode(%params);
+ $print->export_gcode(%export_params);
}
Slic3r::GUI::warning_catcher($self)->($_) for @warnings;
}
View
@@ -332,10 +332,7 @@ sub export_svg {
my $self = shift;
my %params = @_;
- $_->slice for @{$self->objects};
- unless ($params{keep_meshes}) {
- $_->mesh(undef) for @{$self->objects}; # free memory
- }
+ $_->slice(keep_meshes => $params{keep_meshes}) for @{$self->objects};
$self->arrange_objects;
my $output_file = $self->expanded_output_filepath($params{output_file});

0 comments on commit 8aa20cd

Please sign in to comment.