add bridge_overlap #131

This commit is contained in:
supermerill 2019-12-18 19:12:40 +01:00
parent e491165208
commit 7c6fac781a
6 changed files with 35 additions and 2 deletions

View File

@ -332,6 +332,11 @@ void make_fill(LayerRegion &layerm, ExtrusionEntityCollection &out)
}
params.flow = &flow;
//apply bridge_overlap if needed
if (is_bridge && density > 99 && layerm.region()->config().bridge_overlap.get_abs_value(1) != 1) {
params.density *= layerm.region()->config().bridge_overlap.get_abs_value(1);
}
f->fill_surface_extrusion(&surface, params, out.entities);
}

View File

@ -258,6 +258,15 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloatOrPercent(100, true));
def = this->add("bridge_overlap", coFloatOrPercent);
def->label = L("Bridge overlap");
def->full_label = L("Bridge overlap");
def->category = OptionCategory::width;
def->tooltip = L("Amount of overlap between lines of the bridge. If your bridge flow ratio is low, it may be useful to increaase this setting to let lines touch each other. Default to 100%. A value of 200% will create two times more lines.");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloatOrPercent(105, true));
def = this->add("bridge_speed", coFloat);
def->label = L("Bridges");
def->full_label = L("Bridge speed");

View File

@ -603,9 +603,10 @@ public:
ConfigOptionInt bottom_solid_layers;
ConfigOptionFloatOrPercent bridge_flow_ratio;
ConfigOptionFloatOrPercent over_bridge_flow_ratio;
ConfigOptionFloatOrPercent bridge_overlap;
ConfigOptionEnum<InfillPattern> bottom_fill_pattern;
ConfigOptionFloatOrPercent bridged_infill_margin;
ConfigOptionFloat bridge_speed;
ConfigOptionFloat bridge_speed;
ConfigOptionFloat curve_smoothing_precision;
ConfigOptionFloat curve_smoothing_cutoff_dist;
ConfigOptionFloat curve_smoothing_angle_convex;
@ -674,6 +675,7 @@ protected:
OPT_PTR(bottom_solid_layers);
OPT_PTR(bridge_flow_ratio);
OPT_PTR(over_bridge_flow_ratio);
OPT_PTR(bridge_overlap);
OPT_PTR(bottom_fill_pattern);
OPT_PTR(bridged_infill_margin);
OPT_PTR(bridge_speed);

View File

@ -1753,6 +1753,20 @@ void PrintObject::bridge_over_infill()
printf("Bridging " PRINTF_ZU " internal areas at layer " PRINTF_ZU "\n", to_bridge.size(), layer->id());
#endif
//add a bit of overlap for the internal bridge, note that this can only be useful in inverted slopes and with extra_perimeters_odd_layers
coord_t overlap_width = 0;
// if extra_perimeters_odd_layers, fill the void if possible
if (region.config().extra_perimeters_odd_layers.value) {
overlap_width = layerm->flow(frPerimeter).scaled_width();
}
else
{
//half a perimeter should be enough for most of the cases.
overlap_width = layerm->flow(frPerimeter).scaled_width() /2;
}
if (overlap_width > 0)
to_bridge = offset_ex(to_bridge, overlap_width);
// compute the remaning internal solid surfaces as difference
ExPolygons not_to_bridge = diff_ex(internal_solid, to_polygons(to_bridge), true);
to_bridge = intersection_ex(to_polygons(to_bridge), internal_solid, true);

View File

@ -451,7 +451,9 @@ const std::vector<std::string>& Preset::print_options()
"perimeter_extrusion_width", "external_perimeter_extrusion_width", "infill_extrusion_width", "solid_infill_extrusion_width",
"top_infill_extrusion_width", "support_material_extrusion_width", "infill_overlap", "bridge_flow_ratio",
"clip_multipart_objects",
"over_bridge_flow_ratio", "clip_multipart_objects", "enforce_full_fill_volume", "external_infill_margin", "bridged_infill_margin",
"over_bridge_flow_ratio",
"bridge_overlap",
"clip_multipart_objects", "enforce_full_fill_volume", "external_infill_margin", "bridged_infill_margin",
"elefant_foot_compensation", "xy_size_compensation", "hole_size_compensation",
"hole_to_polyhole",
"threads", "resolution",

View File

@ -1272,6 +1272,7 @@ void TabPrint::build()
optgroup = page->new_optgroup(_(L("Flow")));
line = { _(L("Flow ratio")), "" };
line.append_option(optgroup->get_option("bridge_flow_ratio"));
line.append_option(optgroup->get_option("bridge_overlap"));
line.append_option(optgroup->get_option("over_bridge_flow_ratio"));
line.append_option(optgroup->get_option("fill_top_flow_ratio"));
optgroup->append_line(line);