From 8605969dc55772826f878bbfbffce28bc0f6fd5d Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Fri, 30 Jan 2015 18:45:30 +0100 Subject: [PATCH] Don't output slic3r:z attribute in SVG for raft layers --- lib/Slic3r/Print.pm | 7 +++++-- lib/Slic3r/Print/SupportMaterial.pm | 2 +- xs/src/libslic3r/Print.hpp | 2 +- xs/src/libslic3r/PrintObject.cpp | 5 ++--- xs/xsp/Print.xsp | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index b08d4fc46..fd2c19c44 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -140,8 +140,11 @@ EOF my @previous_layer_slices = (); for my $layer (@layers) { $layer_id++; - # TODO: remove slic3r:z for raft layers - printf $fh qq{ \n}, $layer_id, unscale($layer->slice_z); + if ($layer->slice_z == -1) { + printf $fh qq{ \n}, $layer_id; + } else { + printf $fh qq{ \n}, $layer_id, unscale($layer->slice_z); + } my @current_layer_slices = (); # sort slices so that the outermost ones come first diff --git a/lib/Slic3r/Print/SupportMaterial.pm b/lib/Slic3r/Print/SupportMaterial.pm index 483491ba5..4d3e05a9d 100644 --- a/lib/Slic3r/Print/SupportMaterial.pm +++ b/lib/Slic3r/Print/SupportMaterial.pm @@ -76,7 +76,7 @@ sub generate { $i, # id ($i == 0) ? $support_z->[$i] : ($support_z->[$i] - $support_z->[$i-1]), # height $support_z->[$i], # print_z - -1); # slice_z + ); if ($i >= 1) { $object->support_layers->[-2]->set_upper_layer($object->support_layers->[-1]); $object->support_layers->[-1]->set_lower_layer($object->support_layers->[-2]); diff --git a/xs/src/libslic3r/Print.hpp b/xs/src/libslic3r/Print.hpp index 2e557dcc0..ff93c0704 100644 --- a/xs/src/libslic3r/Print.hpp +++ b/xs/src/libslic3r/Print.hpp @@ -126,7 +126,7 @@ class PrintObject size_t support_layer_count() const; void clear_support_layers(); SupportLayer* get_support_layer(int idx); - SupportLayer* add_support_layer(int id, coordf_t height, coordf_t print_z, coordf_t slice_z); + SupportLayer* add_support_layer(int id, coordf_t height, coordf_t print_z); void delete_support_layer(int idx); // methods for handling state diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index c37c4437d..9c7c9ed82 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -190,10 +190,9 @@ PrintObject::get_support_layer(int idx) } SupportLayer* -PrintObject::add_support_layer(int id, coordf_t height, coordf_t print_z, - coordf_t slice_z) +PrintObject::add_support_layer(int id, coordf_t height, coordf_t print_z) { - SupportLayer* layer = new SupportLayer(id, this, height, print_z, slice_z); + SupportLayer* layer = new SupportLayer(id, this, height, print_z, -1); support_layers.push_back(layer); return layer; } diff --git a/xs/xsp/Print.xsp b/xs/xsp/Print.xsp index 37876ee68..ad240d282 100644 --- a/xs/xsp/Print.xsp +++ b/xs/xsp/Print.xsp @@ -95,7 +95,7 @@ _constant() size_t support_layer_count(); void clear_support_layers(); Ref get_support_layer(int idx); - Ref add_support_layer(int id, coordf_t height, coordf_t print_z, coordf_t slice_z); + Ref add_support_layer(int id, coordf_t height, coordf_t print_z); void delete_support_layer(int idx); bool invalidate_state_by_config_options(std::vector opt_keys);