Merge branch 'main' into dev/h2d

This commit is contained in:
Noisyfox
2025-10-20 23:15:29 +08:00
committed by GitHub
8 changed files with 165 additions and 12 deletions

View File

@@ -5854,9 +5854,9 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
sloped == nullptr ? DBL_MAX : get_sloped_z(sloped->slope_begin.z_ratio)
);
m_need_change_layer_lift_z = false;
// Orca: force restore Z after unknown last pos
// Orca: ensure Z matches planned layer height
if (_last_pos_undefined && !slope_need_z_travel) {
gcode += this->writer().travel_to_z(m_last_layer_z, "force restore Z after unknown last pos", true);
gcode += this->writer().travel_to_z(m_nominal_z, "ensure Z matches planned layer height", true);
}
}
@@ -5930,21 +5930,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.filament()->e_per_mm3() * _mm3_per_mm;
e_per_mm /= filament_flow_ratio;
// set speed
if (speed == -1) {
if (path.role() == erPerimeter) {