Allow to skip the sparse infill "perimeters"

This commit is contained in:
supermerill 2018-12-05 15:55:43 +01:00
parent 9b330f4631
commit cb65da2b3a
9 changed files with 29 additions and 14 deletions

View File

@ -279,6 +279,7 @@ void make_fill(LayerRegion &layerm, ExtrusionEntityCollection &out)
params.density = 0.01 * density; params.density = 0.01 * density;
params.dont_adjust = false; params.dont_adjust = false;
params.fill_exactly = layerm.region()->config.enforce_full_fill_volume.getBool(); params.fill_exactly = layerm.region()->config.enforce_full_fill_volume.getBool();
params.dont_connect = layerm.region()->config.infill_not_connected.getBool();
// calculate actual flow from spacing (which might have been adjusted by the infill // calculate actual flow from spacing (which might have been adjusted by the infill
// pattern generator) // pattern generator)

View File

@ -165,7 +165,7 @@ void Fill3DHoneycomb::_fill_surface_single(
polylines = intersection_pl(polylines, (Polygons)expolygon); polylines = intersection_pl(polylines, (Polygons)expolygon);
// connect lines // connect lines
if (! params.dont_connect && ! polylines.empty()) { // prevent calling leftmost_point() on empty collections if (! polylines.empty()) { // prevent calling leftmost_point() on empty collections
ExPolygon expolygon_off; ExPolygon expolygon_off;
{ {
ExPolygons expolygons_off = offset_ex(expolygon, SCALED_EPSILON); ExPolygons expolygons_off = offset_ex(expolygon, SCALED_EPSILON);
@ -180,7 +180,7 @@ void Fill3DHoneycomb::_fill_surface_single(
PolylineCollection::leftmost_point(polylines), false); // reverse allowed PolylineCollection::leftmost_point(polylines), false); // reverse allowed
bool first = true; bool first = true;
for (Polylines::iterator it_polyline = chained.begin(); it_polyline != chained.end(); ++ it_polyline) { for (Polylines::iterator it_polyline = chained.begin(); it_polyline != chained.end(); ++ it_polyline) {
if (! first) { if (!params.dont_connect && !first) {
// Try to connect the lines. // Try to connect the lines.
Points &pts_end = polylines_out.back().points; Points &pts_end = polylines_out.back().points;
const Point &first_point = it_polyline->points.front(); const Point &first_point = it_polyline->points.front();

View File

@ -154,7 +154,7 @@ void FillGyroid::_fill_surface_single(
polylines = intersection_pl(polylines, (Polygons)expolygon); polylines = intersection_pl(polylines, (Polygons)expolygon);
// connect lines // connect lines
if (! params.dont_connect && ! polylines.empty()) { // prevent calling leftmost_point() on empty collections if (! polylines.empty()) { // prevent calling leftmost_point() on empty collections
ExPolygon expolygon_off; ExPolygon expolygon_off;
{ {
ExPolygons expolygons_off = offset_ex(expolygon, (float)SCALED_EPSILON); ExPolygons expolygons_off = offset_ex(expolygon, (float)SCALED_EPSILON);
@ -169,7 +169,7 @@ void FillGyroid::_fill_surface_single(
PolylineCollection::leftmost_point(polylines), false); // reverse allowed PolylineCollection::leftmost_point(polylines), false); // reverse allowed
bool first = true; bool first = true;
for (Polyline &polyline : chained) { for (Polyline &polyline : chained) {
if (! first) { if (!params.dont_connect && !first) {
// Try to connect the lines. // Try to connect the lines.
Points &pts_end = polylines_out.back().points; Points &pts_end = polylines_out.back().points;
const Point &first_point = polyline.points.front(); const Point &first_point = polyline.points.front();

View File

@ -778,7 +778,7 @@ PrintConfigDef::PrintConfigDef()
def->default_value = new ConfigOptionPercent(20); def->default_value = new ConfigOptionPercent(20);
def = this->add("fill_pattern", coEnum); def = this->add("fill_pattern", coEnum);
def->label = L("Fill pattern"); def->label = L("Pattern");
def->category = L("Infill"); def->category = L("Infill");
def->tooltip = L("Fill pattern for general low-density infill."); def->tooltip = L("Fill pattern for general low-density infill.");
def->cli = "fill-pattern=s"; def->cli = "fill-pattern=s";
@ -947,6 +947,13 @@ PrintConfigDef::PrintConfigDef()
def->cli = "infill-dense!"; def->cli = "infill-dense!";
def->default_value = new ConfigOptionBool(false); def->default_value = new ConfigOptionBool(false);
def = this->add("infill_not_connected", coBool);
def->label = ("Do not connect infill lines to each other.");
def->category = L("Infill");
def->tooltip = L("If checked, the infill algorithm will try to not connect the lines near the infill. Can be useful for art or with high infill/perimeter overlap.");
def->cli = "infill-not-connected!";
def->default_value = new ConfigOptionBool(false);
def = this->add("infill_dense_algo", coEnum); def = this->add("infill_dense_algo", coEnum);
def->label = L("Algorithm"); def->label = L("Algorithm");
def->tooltip = L("Choose the way the dense layer is lay out." def->tooltip = L("Choose the way the dense layer is lay out."

View File

@ -461,6 +461,7 @@ public:
ConfigOptionInt infill_every_layers; ConfigOptionInt infill_every_layers;
ConfigOptionFloatOrPercent infill_overlap; ConfigOptionFloatOrPercent infill_overlap;
ConfigOptionFloat infill_speed; ConfigOptionFloat infill_speed;
ConfigOptionBool infill_not_connected;
ConfigOptionBool infill_dense; ConfigOptionBool infill_dense;
ConfigOptionEnum<DenseInfillAlgo> infill_dense_algo; ConfigOptionEnum<DenseInfillAlgo> infill_dense_algo;
ConfigOptionBool infill_first; ConfigOptionBool infill_first;
@ -518,6 +519,7 @@ protected:
OPT_PTR(infill_overlap); OPT_PTR(infill_overlap);
OPT_PTR(infill_speed); OPT_PTR(infill_speed);
OPT_PTR(infill_dense); OPT_PTR(infill_dense);
OPT_PTR(infill_not_connected);
OPT_PTR(infill_dense_algo); OPT_PTR(infill_dense_algo);
OPT_PTR(infill_first); OPT_PTR(infill_first);
OPT_PTR(overhangs); OPT_PTR(overhangs);

View File

@ -206,6 +206,7 @@ bool PrintObject::invalidate_state_by_config_options(const std::vector<t_config_
|| opt_key == "infill_every_layers" || opt_key == "infill_every_layers"
|| opt_key == "solid_infill_every_layers" || opt_key == "solid_infill_every_layers"
|| opt_key == "infill_dense" || opt_key == "infill_dense"
|| opt_key == "infill_not_connected"
|| opt_key == "infill_dense_algo" || opt_key == "infill_dense_algo"
|| opt_key == "bottom_solid_layers" || opt_key == "bottom_solid_layers"
|| opt_key == "top_solid_layers" || opt_key == "top_solid_layers"

View File

@ -309,6 +309,7 @@ const std::vector<std::string>& Preset::print_options()
"infill_dense", "infill_dense_algo", "no_perimeter_unsupported", "min_perimeter_unsupported", "noperi_bridge_only", "infill_dense", "infill_dense_algo", "no_perimeter_unsupported", "min_perimeter_unsupported", "noperi_bridge_only",
"support_material_solid_first_layer", "perimeter_loop", "perimeter_loop_seam", "seam_travel" "support_material_solid_first_layer", "perimeter_loop", "perimeter_loop_seam", "seam_travel"
, "remove_small_gaps" , "remove_small_gaps"
, "infill_not_connected"
}; };
return s_opts; return s_opts;
} }

View File

@ -830,15 +830,18 @@ void TabPrint::build()
line.append_option(optgroup->get_option("perimeter_loop_seam")); line.append_option(optgroup->get_option("perimeter_loop_seam"));
optgroup->append_line(line); optgroup->append_line(line);
page = add_options_page(_(L("Infill")), "infill.png"); page = add_options_page(_(L("Infill")), "infill.png");
optgroup = page->new_optgroup(_(L("Infill"))); optgroup = page->new_optgroup(_(L("Infill")));
optgroup->append_single_option_line("fill_density"); optgroup->append_single_option_line("fill_density");
optgroup->append_single_option_line("fill_pattern"); line = { _(L("Inside")), "" };
optgroup->append_single_option_line("top_fill_pattern"); line.append_option(optgroup->get_option("fill_pattern"));
optgroup->append_single_option_line("bottom_fill_pattern"); line.append_option(optgroup->get_option("infill_not_connected"));
optgroup->append_single_option_line("enforce_full_fill_volume"); optgroup->append_line(line);
optgroup->append_single_option_line("top_fill_pattern");
optgroup->append_single_option_line("bottom_fill_pattern");
optgroup->append_single_option_line("enforce_full_fill_volume");
optgroup = page->new_optgroup(_(L("Reducing printing time"))); optgroup = page->new_optgroup(_(L("Reducing printing time")));
optgroup->append_single_option_line("infill_every_layers"); optgroup->append_single_option_line("infill_every_layers");
optgroup->append_single_option_line("infill_only_where_needed"); optgroup->append_single_option_line("infill_only_where_needed");
line = { _(L("Suporting dense layer")), "" }; line = { _(L("Suporting dense layer")), "" };

View File

@ -330,7 +330,7 @@ public:
size_t m_sys_extruders_count; size_t m_sys_extruders_count;
TabPrinter() {} TabPrinter() {}
TabPrinter(wxNotebook* parent, bool no_controller) : Tab(parent, _(L("Printer Settings")), "printer", no_controller) {} TabPrinter(wxNotebook* parent, bool no_controller) : Tab(parent, _(L("Hardware Settings")), "printer", no_controller) {}
~TabPrinter(){} ~TabPrinter(){}
void build() override; void build() override;