From 8d6acd2aec6f2ac9129d9ba55bf0f51fb6ffd3b7 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Sun, 12 Feb 2017 00:51:53 +0100 Subject: [PATCH] Fix of "no support generated" https://github.com/prusa3d/Slic3r/issues/114 when a first layer height was set in percents. --- xs/src/libslic3r/Print.cpp | 2 +- xs/src/libslic3r/SupportMaterial.cpp | 10 +++++----- xs/src/libslic3r/SupportMaterial.hpp | 4 ---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/xs/src/libslic3r/Print.cpp b/xs/src/libslic3r/Print.cpp index 132eb560d..1619f8c7b 100644 --- a/xs/src/libslic3r/Print.cpp +++ b/xs/src/libslic3r/Print.cpp @@ -655,7 +655,7 @@ Print::validate() const // are of the same diameter. if (nozzle_diameters.size() > 1) return "Printing with multiple extruders of differing nozzle diameters. " - "If support is to be printed with the current extruder (support_material_extruder == 0 or support_material_interface_extruder == 0), ", + "If support is to be printed with the current extruder (support_material_extruder == 0 or support_material_interface_extruder == 0), " "all nozzles have to be of the same diameter."; } diff --git a/xs/src/libslic3r/SupportMaterial.cpp b/xs/src/libslic3r/SupportMaterial.cpp index f6ad3f4eb..2bab6d5b0 100644 --- a/xs/src/libslic3r/SupportMaterial.cpp +++ b/xs/src/libslic3r/SupportMaterial.cpp @@ -749,7 +749,7 @@ PrintObjectSupportMaterial::MyLayersPtr PrintObjectSupportMaterial::top_contact_ // Don't want to print a layer below the first layer height as it may not stick well. //FIXME there may be a need for a single layer support, then one may decide to print it either as a bottom contact or a top contact // and it may actually make sense to do it with a thinner layer than the first layer height. - if (new_layer.print_z < this->first_layer_height() + m_support_layer_height_min) + if (new_layer.print_z < m_slicing_params.first_print_layer_height + m_support_layer_height_min) continue; #if 0 @@ -1046,7 +1046,7 @@ PrintObjectSupportMaterial::MyLayersPtr PrintObjectSupportMaterial::raft_and_int assert(intermediate_layers.empty()); MyLayer &layer_new = layer_allocate(layer_storage, sltIntermediate); layer_new.bottom_z = 0.; - layer_new.print_z = extr1z = this->first_layer_height(); + layer_new.print_z = extr1z = m_slicing_params.first_print_layer_height; layer_new.height = extr1z; intermediate_layers.push_back(&layer_new); // Continue printing the other layers up to extr2z. @@ -1067,17 +1067,17 @@ PrintObjectSupportMaterial::MyLayersPtr PrintObjectSupportMaterial::raft_and_int extr2.layer->height = step; extr2.layer->bottom_z = extr2z = extr2.layer->print_z - step; -- n_layers_extra; - if (extr2.layer->bottom_z < this->first_layer_height()) { + if (extr2.layer->bottom_z < m_slicing_params.first_print_layer_height) { // Split the span into two layers: the top layer up to the first layer height, // and the new intermediate layer below. // 1) Adjust the bottom of this top layer. assert(n_layers_extra == 0); - extr2.layer->bottom_z = extr2z = this->first_layer_height(); + extr2.layer->bottom_z = extr2z = m_slicing_params.first_print_layer_height; extr2.layer->height = extr2.layer->print_z - extr2.layer->bottom_z; // 2) Insert a new intermediate layer. MyLayer &layer_new = layer_allocate(layer_storage, sltIntermediate); layer_new.bottom_z = extr1z; - layer_new.print_z = this->first_layer_height(); + layer_new.print_z = m_slicing_params.first_print_layer_height; layer_new.height = layer_new.print_z - layer_new.bottom_z; assert(intermediate_layers.empty() || intermediate_layers.back()->print_z <= layer_new.print_z); intermediate_layers.push_back(&layer_new); diff --git a/xs/src/libslic3r/SupportMaterial.hpp b/xs/src/libslic3r/SupportMaterial.hpp index 13b2b5e50..4c6dab877 100644 --- a/xs/src/libslic3r/SupportMaterial.hpp +++ b/xs/src/libslic3r/SupportMaterial.hpp @@ -127,10 +127,6 @@ public: public: PrintObjectSupportMaterial(const PrintObject *object, const SlicingParameters &slicing_params); - // Height of the 1st layer is user configured as it is important for the print - // to stick to he print bed. - coordf_t first_layer_height() const { return m_object_config->first_layer_height.value; } - // Is raft enabled? bool has_raft() const { return m_slicing_params.has_raft(); } // Has any support?