Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Matena <lukasmatena@seznam.cz>2019-11-14 12:37:04 +0300
committerLukas Matena <lukasmatena@seznam.cz>2019-11-14 12:37:04 +0300
commit88514eeb0e335e42932d0b0b3a9bec6cc042ea69 (patch)
tree904869e97591c982ecf08cf4b86906e735965c9b /src/libslic3r/GCode
parent050a9adf36bb85220f3e3bdee59c399bf495c85a (diff)
parent53cdb8ef539bedef38367c5f0136c38ce93a3458 (diff)
Merge branch 'lm_low_wipe_tower'
Diffstat (limited to 'src/libslic3r/GCode')
-rw-r--r--src/libslic3r/GCode/WipeTower.cpp13
-rw-r--r--src/libslic3r/GCode/WipeTower.hpp1
2 files changed, 10 insertions, 4 deletions
diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp
index 73dc91c40..cd326b9a0 100644
--- a/src/libslic3r/GCode/WipeTower.cpp
+++ b/src/libslic3r/GCode/WipeTower.cpp
@@ -474,6 +474,7 @@ WipeTower::WipeTower(const PrintConfig& config, const std::vector<std::vector<fl
m_z_pos(0.f),
m_is_first_layer(false),
m_bridging(float(config.wipe_tower_bridging)),
+ m_no_sparse_layers(config.wipe_tower_no_sparse_layers),
m_gcode_flavor(config.gcode_flavor),
m_current_tool(initial_tool),
wipe_volumes(wiping_matrix)
@@ -1145,9 +1146,10 @@ WipeTower::ToolChangeResult WipeTower::finish_layer()
writer.set_initial_position((m_left_to_right ? fill_box.ru : fill_box.lu), // so there is never a diagonal travel
m_wipe_tower_width, m_wipe_tower_depth, m_internal_rotation);
+ bool toolchanges_on_layer = m_layer_info->toolchanges_depth() > WT_EPSILON;
box_coordinates box = fill_box;
for (int i=0;i<2;++i) {
- if (m_layer_info->toolchanges_depth() < WT_EPSILON) { // there were no toolchanges on this layer
+ if (! toolchanges_on_layer) {
if (i==0) box.expand(m_perimeter_width);
else box.expand(-m_perimeter_width);
}
@@ -1201,9 +1203,12 @@ WipeTower::ToolChangeResult WipeTower::finish_layer()
m_depth_traversed = m_wipe_tower_depth-m_perimeter_width;
- // Ask our writer about how much material was consumed:
- if (m_current_tool < m_used_filament_length.size())
- m_used_filament_length[m_current_tool] += writer.get_and_reset_used_filament_length();
+
+ // Ask our writer about how much material was consumed.
+ // Skip this in case the layer is sparse and config option to not print sparse layers is enabled.
+ if (! m_no_sparse_layers || toolchanges_on_layer)
+ if (m_current_tool < m_used_filament_length.size())
+ m_used_filament_length[m_current_tool] += writer.get_and_reset_used_filament_length();
ToolChangeResult result;
result.priming = false;
diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp
index c1ea3f2b5..311490055 100644
--- a/src/libslic3r/GCode/WipeTower.hpp
+++ b/src/libslic3r/GCode/WipeTower.hpp
@@ -220,6 +220,7 @@ private:
float m_parking_pos_retraction = 0.f;
float m_extra_loading_move = 0.f;
float m_bridging = 0.f;
+ bool m_no_sparse_layers = false;
bool m_set_extruder_trimpot = false;
bool m_adhesion = true;
GCodeFlavor m_gcode_flavor;