diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 5eeddceca..527034f39 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3199,8 +3199,9 @@ void GCode::split_at_seam_pos(ExtrusionLoop& loop, std::unique_ptrlast_pos(); - if (m_config.spiral_vase) { - loop.split_at(last_pos, false); + //for first spiral, choose the seam, as the position will be very relevant. + if (m_config.spiral_vase && !m_spiral_vase->is_transition_layer()) { + loop.split_at(last_pos, false); } else { const EdgeGrid::Grid* edge_grid_ptr = (lower_layer_edge_grid && *lower_layer_edge_grid) ? lower_layer_edge_grid->get() diff --git a/src/libslic3r/GCode/SpiralVase.cpp b/src/libslic3r/GCode/SpiralVase.cpp index acb6ad034..b012acd73 100644 --- a/src/libslic3r/GCode/SpiralVase.cpp +++ b/src/libslic3r/GCode/SpiralVase.cpp @@ -55,9 +55,12 @@ std::string SpiralVase::process_layer(const std::string &gcode) // Tapering the absolute extruder distances requires to process every extrusion value after the first transition // layer. bool transition = m_transition_layer && m_config->use_relative_e_distances.value; + if (transition) + new_gcode += "; Began spiral\n"; + bool keep_first_travel = m_transition_layer; float layer_height_factor = layer_height / total_layer_length; float len = 0.f; - m_reader.parse_buffer(gcode, [&new_gcode, &z, total_layer_length, layer_height_factor, transition, &len] + m_reader.parse_buffer(gcode, [&keep_first_travel , &new_gcode, &z, total_layer_length, layer_height_factor, transition, &len] (GCodeReader &reader, GCodeReader::GCodeLine line) { if (line.cmd_is("G1")) { if (line.has_z()) { @@ -71,12 +74,16 @@ std::string SpiralVase::process_layer(const std::string &gcode) if (dist_XY > 0) { // horizontal move if (line.extruding(reader)) { + keep_first_travel = false; len += dist_XY; line.set(reader, Z, z + len * layer_height_factor); if (transition && line.has(E)) // Transition layer, modulate the amount of extrusion from zero to the final value. line.set(reader, E, line.value(E) * len / total_layer_length); new_gcode += line.raw() + '\n'; + } else if (keep_first_travel) { + //we can travel until the first spiral extrusion + new_gcode += line.raw() + '\n'; } return; diff --git a/src/libslic3r/GCode/SpiralVase.hpp b/src/libslic3r/GCode/SpiralVase.hpp index 5353901fe..877ddb271 100644 --- a/src/libslic3r/GCode/SpiralVase.hpp +++ b/src/libslic3r/GCode/SpiralVase.hpp @@ -19,7 +19,9 @@ public: m_enabled = en; } - std::string process_layer(const std::string &gcode); + std::string process_layer(const std::string& gcode); + + bool is_transition_layer() { return m_transition_layer; } private: const PrintConfig *m_config;