Feature: Ability to change flow ratios by extrusion path types (Code + Docs) (#10641)

This new feature allows users to override flow ratios for the following extrusion path types:

* First layer (excluding Brims and Skirts)
* Outer walls
* Inner walls
* Overhang perimeters
* Sparse infill
* Internal solid infill
* Gap fill
* Support
* Support interfaces
This commit is contained in:
Valerii Bokhan
2025-10-20 15:45:52 +02:00
committed by GitHub
parent 0bdb114881
commit e6a4ddf32d
7 changed files with 158 additions and 7 deletions

View File

@@ -5306,21 +5306,47 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
// We set _mm3_per_mm to effectove flow = Geometric volume * print flow ratio * filament flow ratio * role-based-flow-ratios
auto _mm3_per_mm = path.mm3_per_mm * this->config().print_flow_ratio;
_mm3_per_mm *= filament_flow_ratio;
if (path.role() == erTopSolidInfill)
if (path.role() == erTopSolidInfill) {
_mm3_per_mm *= m_config.top_solid_infill_flow_ratio;
else if (path.role() == erBottomSurface)
} else if (path.role() == erBottomSurface) {
_mm3_per_mm *= m_config.bottom_solid_infill_flow_ratio;
else if (path.role() == erInternalBridgeInfill)
} else if (path.role() == erInternalBridgeInfill) {
_mm3_per_mm *= m_config.internal_bridge_flow;
else if(sloped)
} else if (sloped) {
_mm3_per_mm *= m_config.scarf_joint_flow_ratio;
}
if (m_config.set_other_flow_ratios) {
if (path.role() == erExternalPerimeter) {
_mm3_per_mm *= m_config.outer_wall_flow_ratio;
} else if (path.role() == erPerimeter) {
_mm3_per_mm *= m_config.inner_wall_flow_ratio;
} else if (path.role() == erOverhangPerimeter) {
_mm3_per_mm *= m_config.overhang_flow_ratio;
} else if (path.role() == erInternalInfill) {
_mm3_per_mm *= m_config.sparse_infill_flow_ratio;
} else if (path.role() == erSolidInfill) {
_mm3_per_mm *= m_config.internal_solid_infill_flow_ratio;
} else if (path.role() == erGapFill) {
_mm3_per_mm *= m_config.gap_fill_flow_ratio;
} else if (path.role() == erSupportMaterial) { // Should this condition also cover erSupportTransition?
_mm3_per_mm *= m_config.support_flow_ratio;
} else if (path.role() == erSupportMaterialInterface) {
_mm3_per_mm *= m_config.support_interface_flow_ratio;
}
// Additionally, adjust the value if we are on the first layer (except for brims and skirts)
if (this->on_first_layer() && (path.role() != erBrim && path.role() != erSkirt)) {
_mm3_per_mm *= m_config.first_layer_flow_ratio;
}
}
// Effective extrusion length per distance unit = (filament_flow_ratio/cross_section) * mm3_per_mm / print flow ratio
// m_writer.extruder()->e_per_mm3() below is (filament flow ratio / cross-sectional area)
double e_per_mm = m_writer.extruder()->e_per_mm3() * _mm3_per_mm;
e_per_mm /= filament_flow_ratio;
// set speed
if (speed == -1) {
if (path.role() == erPerimeter) {