vase mode fix:

* if the object is hollow and has only thin walls loops, the orientation must be enforced on gcode.cpp
 * add extra_perimeters as unwanted setting for spiral vase.
 * add dense infill as unwanted setting for spiral vase.
This commit is contained in:
supermerill 2019-02-14 11:00:03 +01:00
parent bf487225cc
commit d7141abcb4
3 changed files with 20 additions and 5 deletions

View File

@ -1323,7 +1323,7 @@ void GCode::process_layer(
m_spiral_vase->enable = enable; m_spiral_vase->enable = enable;
} }
// If we're going to apply spiralvase to this layer, disable loop clipping // If we're going to apply spiralvase to this layer, disable loop clipping
m_enable_loop_clipping = ! m_spiral_vase || ! m_spiral_vase->enable; m_enable_loop_clipping = !m_spiral_vase || !m_spiral_vase->enable;
std::string gcode; std::string gcode;
@ -2021,6 +2021,10 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
// extrude all loops ccw // extrude all loops ccw
//no! this was decided in perimeter_generator //no! this was decided in perimeter_generator
bool was_clockwise = false;// loop.make_counter_clockwise(); bool was_clockwise = false;// loop.make_counter_clockwise();
//if spiral vase, we have to ensure that all loops are in the same orientation.
if (this->m_config.spiral_vase) {
was_clockwise = loop.make_counter_clockwise();
}
SeamPosition seam_position = m_config.seam_position; SeamPosition seam_position = m_config.seam_position;
if (loop.loop_role() == elrSkirt) if (loop.loop_role() == elrSkirt)
@ -2088,7 +2092,6 @@ std::string GCode::extrude_loop(ExtrusionLoop loop, std::string description, dou
} }
//TODO: ignore the angle penalty if the new point is not in an external path (bot/top/ext_peri) //TODO: ignore the angle penalty if the new point is not in an external path (bot/top/ext_peri)
for (size_t i = 0; i < polygon.points.size(); ++i) { for (size_t i = 0; i < polygon.points.size(); ++i) {
//std::cout << "check point @" << unscale(polygon.points[i].x) << ":" << unscale(polygon.points[i].y);
float ccwAngle = penalties[i]; float ccwAngle = penalties[i];
if (was_clockwise) if (was_clockwise)
ccwAngle = - ccwAngle; ccwAngle = - ccwAngle;

View File

@ -3231,8 +3231,10 @@ void DynamicPrintConfig::normalize()
this->opt<ConfigOptionPercent>("fill_density", true)->value = 0; this->opt<ConfigOptionPercent>("fill_density", true)->value = 0;
this->opt<ConfigOptionBool>("support_material", true)->value = false; this->opt<ConfigOptionBool>("support_material", true)->value = false;
this->opt<ConfigOptionInt>("support_material_enforce_layers")->value = 0; this->opt<ConfigOptionInt>("support_material_enforce_layers")->value = 0;
this->opt<ConfigOptionBool>("exact_last_layer_height", true)->value = false; this->opt<ConfigOptionBool>("exact_last_layer_height", true)->value = false;
this->opt<ConfigOptionBool>("ensure_vertical_shell_thickness", true)->value = false; this->opt<ConfigOptionBool>("ensure_vertical_shell_thickness", true)->value = false;
this->opt<ConfigOptionBool>("infill_dense", true)->value = false;
this->opt<ConfigOptionBool>("extra_perimeters", true)->value = false;
} }
} }
} }
@ -3390,6 +3392,10 @@ std::string FullPrintConfig::validate()
return "Spiral vase mode is not compatible with top solid layers"; return "Spiral vase mode is not compatible with top solid layers";
if (this->support_material || this->support_material_enforce_layers > 0) if (this->support_material || this->support_material_enforce_layers > 0)
return "Spiral vase mode is not compatible with support material"; return "Spiral vase mode is not compatible with support material";
if (this->infill_dense)
return "Spiral vase mode can only print hollow objects and have no top surface, so you don't need any dense infill";
if (this->extra_perimeters)
return "Can't make more than one perimeter when spiral vase mode is enabled";
} }
// extrusion widths // extrusion widths

View File

@ -1228,6 +1228,8 @@ void TabPrint::update()
&& m_config->opt_int("support_material_enforce_layers") == 0 && m_config->opt_int("support_material_enforce_layers") == 0
&& m_config->opt_bool("exact_last_layer_height") == false && m_config->opt_bool("exact_last_layer_height") == false
&& m_config->opt_bool("ensure_vertical_shell_thickness") == false && m_config->opt_bool("ensure_vertical_shell_thickness") == false
&& m_config->opt_bool("infill_dense") == false
&& m_config->opt_bool("extra_perimeters") == false
)) { )) {
wxString msg_text = _(L("The Spiral Vase mode requires:\n" wxString msg_text = _(L("The Spiral Vase mode requires:\n"
"- one perimeter\n" "- one perimeter\n"
@ -1236,6 +1238,8 @@ void TabPrint::update()
"- no support material\n" "- no support material\n"
"- no ensure_vertical_shell_thickness\n" "- no ensure_vertical_shell_thickness\n"
"- unchecked 'exact last layer height'\n" "- unchecked 'exact last layer height'\n"
"- unchecked 'dense infill'\n"
"- unchecked 'extra perimeters'\n"
"\nShall I adjust those settings in order to enable Spiral Vase?")); "\nShall I adjust those settings in order to enable Spiral Vase?"));
auto dialog = new wxMessageDialog(parent(), msg_text, _(L("Spiral Vase")), wxICON_WARNING | wxYES | wxNO); auto dialog = new wxMessageDialog(parent(), msg_text, _(L("Spiral Vase")), wxICON_WARNING | wxYES | wxNO);
is_msg_dlg_already_exist = true; is_msg_dlg_already_exist = true;
@ -1247,7 +1251,9 @@ void TabPrint::update()
new_conf.set_key_value("support_material", new ConfigOptionBool(false)); new_conf.set_key_value("support_material", new ConfigOptionBool(false));
new_conf.set_key_value("support_material_enforce_layers", new ConfigOptionInt(0)); new_conf.set_key_value("support_material_enforce_layers", new ConfigOptionInt(0));
new_conf.set_key_value("exact_last_layer_height", new ConfigOptionBool(false)); new_conf.set_key_value("exact_last_layer_height", new ConfigOptionBool(false));
new_conf.set_key_value("ensure_vertical_shell_thickness", new ConfigOptionBool(false)); new_conf.set_key_value("ensure_vertical_shell_thickness", new ConfigOptionBool(false));
new_conf.set_key_value("infill_dense", new ConfigOptionBool(false));
new_conf.set_key_value("extra_perimeters", new ConfigOptionBool(false));
fill_density = 0; fill_density = 0;
} }
else { else {