Skip to content

Commit

Permalink
Fix wipe_tower_brim_width % values
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Aug 7, 2022
1 parent 77a7c0e commit cd8ee42
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/libslic3r/GCode/WipeTower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,6 @@ WipeTower::WipeTower(const PrintConfig& config, const PrintObjectConfig& default
m_wipe_tower_pos(config.wipe_tower_x, config.wipe_tower_y),
m_wipe_tower_width(float(config.wipe_tower_width)),
m_wipe_tower_rotation_angle(float(config.wipe_tower_rotation_angle)),
m_wipe_tower_brim_width(float(config.wipe_tower_brim_width)),
m_y_shift(0.f),
m_z_pos(0.f),
m_bridging(float(config.wipe_tower_bridging)),
Expand Down Expand Up @@ -1408,9 +1407,9 @@ WipeTower::ToolChangeResult WipeTower::finish_layer()
(float)m_layer_height,
(m_current_tool < m_config->nozzle_diameter.values.size()) ? m_object_config->get_computed_value("filament_max_overlap", m_current_tool) : 1
);
const coordf_t spacing = brim_flow.spacing();
const double spacing = brim_flow.spacing();
// How many perimeters shall the brim have?
size_t loops_num = (m_wipe_tower_brim_width + spacing / 2) / spacing;
size_t loops_num = (m_config->wipe_tower_brim_width.get_abs_value(m_nozzle_diameter) + spacing / 2) / spacing;


writer.set_extrusion_flow(brim_flow.mm3_per_mm() / filament_area())
Expand Down
1 change: 0 additions & 1 deletion src/libslic3r/GCode/WipeTower.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ class WipeTower
Vec2f m_wipe_tower_pos; // Left front corner of the wipe tower in mm.
float m_wipe_tower_width; // Width of the wipe tower.
float m_wipe_tower_depth = 0.f; // Depth of the wipe tower
float m_wipe_tower_brim_width = 0.f; // Width of brim (mm) from config
float m_wipe_tower_brim_width_real = 0.f; // Width of brim (mm) after generation
float m_wipe_tower_rotation_angle = 0.f; // Wipe tower rotation angle in degrees (with respect to x axis)
float m_internal_rotation = 0.f;
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,7 @@ const WipeTowerData& Print::wipe_tower_data(size_t extruders_cnt, double nozzle_
const_cast<Print*>(this)->m_wipe_tower_data.brim_width = unscaled_brim_width;
}

return m_wipe_tower_data;
return this->m_wipe_tower_data;
}

void Print::_make_wipe_tower()
Expand Down
5 changes: 3 additions & 2 deletions src/slic3r/GUI/GCodeViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2224,8 +2224,9 @@ void GCodeViewer::load_shells(const Print& print, bool initialized)
const size_t extruders_count = config.nozzle_diameter.size();
if (extruders_count > 1 && config.wipe_tower && !config.complete_objects) {
//FIXME using first nozzle diameter instead of the "right" one.
const float depth = print.wipe_tower_data(extruders_count, config.nozzle_diameter.values.front()).depth;
const float brim_width = print.wipe_tower_data(extruders_count, config.nozzle_diameter.values.front()).brim_width;
const WipeTowerData& wipe_tower_data = print.wipe_tower_data(extruders_count, config.nozzle_diameter.values.front());
const float depth = wipe_tower_data.depth;
const float brim_width = wipe_tower_data.brim_width;

m_shells.volumes.load_wipe_tower_preview(1000, config.wipe_tower_x, config.wipe_tower_y, config.wipe_tower_width, depth, max_z, config.wipe_tower_rotation_angle,
!print.is_step_done(psWipeTower), brim_width, initialized);
Expand Down

0 comments on commit cd8ee42

Please sign in to comment.