diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 59c2b20de..ada5ab060 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2061,7 +2061,7 @@ void PrintConfigDef::init_fff_params() def->ratio_over = "perimeter_extrusion_width"; def->min = 0; def->mode = comExpert; - def->set_default_value(new ConfigOptionFloatOrPercent(100, true)); + def->set_default_value(new ConfigOptionFloatOrPercent(200, true)); def = this->add("min_print_speed", coFloats); def->label = L("Min print speed"); @@ -3530,7 +3530,9 @@ void PrintConfigDef::init_fff_params() def = this->add("z_step", coFloat); def->label = L("Z full step"); def->tooltip = L("Set this to the height moved when your Z motor (or equivalent) turns one step." - "If your motor needs 200 steps to move your head/plater by 1mm, this field have to be 1/200 = 0.005"); + "If your motor needs 200 steps to move your head/plater by 1mm, this field have to be 1/200 = 0.005." + "\nThe gcode can't write a value below 0.001 so any value below or equal that is equivalent to disabling the feature." + "\n0 to disable."); def->cli = "z-step=f"; def->sidetext = L("mm"); def->min = 0.0001; diff --git a/src/libslic3r/Slicing.cpp b/src/libslic3r/Slicing.cpp index 06080116c..f71ea23c1 100644 --- a/src/libslic3r/Slicing.cpp +++ b/src/libslic3r/Slicing.cpp @@ -25,12 +25,14 @@ static const coordf_t MIN_LAYER_HEIGHT = 0.01; static const coordf_t MIN_LAYER_HEIGHT_DEFAULT = 0.07; inline coordf_t check_z_step(coordf_t val, coordf_t z_step) { + if (z_step <= EPSILON) return val; uint64_t valint = uint64_t(val * 100000. + 0.1); uint64_t stepint = uint64_t(z_step * 100000. + 0.1); return (((valint + (stepint/2)) / stepint) * stepint) / 100000.; //return int((val + z_step * 0.5) / z_step) * z_step; } inline bool test_z_step(coordf_t val, coordf_t z_step) { + if (z_step <= EPSILON) return val; uint64_t valint = uint64_t(val * 100000. + 0.1); uint64_t stepint = uint64_t(z_step * 100000. + 0.1); return valint % stepint == 0; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index e0c77fd02..8800b98d4 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -45,7 +45,10 @@ namespace GUI { wxDEFINE_EVENT(EVT_TAB_VALUE_CHANGED, wxCommandEvent); wxDEFINE_EVENT(EVT_TAB_PRESETS_CHANGED, SimpleEvent); +//same as the slicing.cpp method, but it's easier to redefine it here +// maybe i should have written it in the header. inline coordf_t check_z_step_temp(coordf_t val, coordf_t z_step) { + if (z_step <= EPSILON) return val; uint64_t valint = uint64_t(val * 100000. + 0.1); uint64_t stepint = uint64_t(z_step * 100000. + 0.1); return (((valint + (stepint / 2)) / stepint) * stepint) / 100000.;