Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Jan 8, 2019
1 parent 3704ea1 commit b91b476
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/libslic3r/Fill/FillRectilinear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void FillRectilinear::_fill_surface_single(
expolygon.rotate(- direction.first);

this->_min_spacing = scale_(this->spacing);
assert(params.density > 0.0001f && params.density <= 1.f);
assert(params.density > 0.0001f);
this->_line_spacing = coord_t(coordf_t(this->_min_spacing) / params.density);
this->_diagonal_distance = this->_line_spacing * 2;
this->_line_oscillation = this->_line_spacing - this->_min_spacing; // only for Line infill
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/Fill/FillRectilinear2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ bool FillRectilinear2::fill_surface_by_lines(const Surface *surface, const FillP
std::pair<float, Point> rotate_vector = this->_infill_direction(surface);
rotate_vector.first += angleBase;

assert(params.density > 0.0001f && params.density <= 1.f);
assert(params.density > 0.0001f);
coord_t line_spacing = coord_t(scale_(this->spacing) / params.density);

// On the polygons of poly_with_offset, the infill lines will be connected.
Expand Down
4 changes: 2 additions & 2 deletions src/libslic3r/Fill/FillRectilinear3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ static bool prepare_infill_hatching_segments(
out.direction.rotate(out.angle + 0.5 * M_PI);
out.segs.clear();

assert(params.density > 0.0001f && params.density <= 1.f);
assert(params.density > 0.0001f);
coord_t line_spacing = coord_t(scale_(fill_dir_params.spacing) / params.density);

// Bounding box around the source contour, aligned with out.angle.
Expand Down Expand Up @@ -1531,7 +1531,7 @@ static bool fill_hatching_segments_legacy(

bool FillRectilinear3::fill_surface_by_lines(const Surface *surface, const FillParams &params, std::vector<FillDirParams> &fill_dir_params, Polylines &polylines_out)
{
assert(params.density > 0.0001f && params.density <= 1.f);
assert(params.density > 0.0001f);

const float INFILL_OVERLAP_OVER_SPACING = 0.45f;
assert(INFILL_OVERLAP_OVER_SPACING > 0 && INFILL_OVERLAP_OVER_SPACING < 0.5f);
Expand Down
5 changes: 3 additions & 2 deletions src/libslic3r/GCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ std::string WipeTowerIntegration::rotate_wipe_tower_moves(const std::string& gco

std::string WipeTowerIntegration::prime(GCode &gcodegen)
{
assert(m_layer_idx == 0);
//assert(m_layer_idx == 0);
std::string gcode;

if (&m_priming != nullptr && ! m_priming.extrusions.empty()) {
Expand Down Expand Up @@ -931,6 +931,7 @@ void GCode::_do_export(Print &print, FILE *file)
m_wipe_tower.reset(new WipeTowerIntegration(print.config(), *print.wipe_tower_data().priming.get(), print.wipe_tower_data().tool_changes, *print.wipe_tower_data().final_purge.get()));
_write(file, m_writer.travel_to_z(first_layer_height + m_config.z_offset.value, "Move to the first layer height"));
if (print.config().single_extruder_multi_material_priming) {
//m_wipe_tower->next_layer();
_write(file, m_wipe_tower->prime(*this));
// Verify, whether the print overaps the priming extrusions.
BoundingBoxf bbox_print(get_print_extrusions_extents(print));
Expand Down Expand Up @@ -2665,7 +2666,7 @@ std::string GCode::retract(bool toolchange)
methods even if we performed wipe, since this will ensure the entire retraction
length is honored in case wipe path was too short. */
gcode += toolchange ? m_writer.retract_for_toolchange() : m_writer.retract();
if (toolchange || !this->m_config.retract_lift_not_last_layer.value || !(this->m_last_extrusion_role == ExtrusionRole::erTopSolidInfill))
if (toolchange || !this->m_config.retract_lift_not_last_layer.get_at(m_writer.extruder()->id()) || !(this->m_last_extrusion_role == ExtrusionRole::erTopSolidInfill))
if (m_writer.extruder()->retract_length() > 0 || m_config.use_firmware_retraction)
gcode += m_writer.lift();

Expand Down
4 changes: 2 additions & 2 deletions src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1823,12 +1823,12 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->default_value = new ConfigOptionFloats { 0. };

def = this->add("retract_lift_not_last_layer", coBool);
def = this->add("retract_lift_not_last_layer", coBools);
def->label = L("Not on top");
def->category = L("Support material");
def->tooltip = L("Select this option to not use the z-lift on a top surface.");
def->mode = comAdvanced;
def->default_value = new ConfigOptionBool(false);
def->default_value = new ConfigOptionBools { false };

def = this->add("retract_restart_extra", coFloats);
def->label = L("Extra length on restart");
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/PrintConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ class GCodeConfig : public StaticPrintConfig
ConfigOptionFloats retract_lift;
ConfigOptionFloats retract_lift_above;
ConfigOptionFloats retract_lift_below;
ConfigOptionBool retract_lift_not_last_layer;
ConfigOptionBools retract_lift_not_last_layer;
ConfigOptionFloats retract_restart_extra;
ConfigOptionFloats retract_restart_extra_toolchange;
ConfigOptionFloats retract_speed;
Expand Down

0 comments on commit b91b476

Please sign in to comment.