Enhancement: Enable separate internal bridge fan speed control (#7906)

* Separate internal bridge fan speed control

* Merge branch 'SoftFever:main' into Allow-separate-internal-bridge-fan-control

* Merge branch 'main' into Allow-separate-internal-bridge-fan-control

* Merge branch 'SoftFever:main' into Allow-separate-internal-bridge-fan-control

* Merge branch 'main' into Allow-separate-internal-bridge-fan-control

* Merge remote-tracking branch 'upstream/main' into Allow-separate-internal-bridge-fan-control

* Merge branch 'main' into Allow-separate-internal-bridge-fan-control

* Merge branch 'main' into Allow-separate-internal-bridge-fan-control

* Merge branch 'main' into Allow-separate-internal-bridge-fan-control

* Merge branch 'main' into Allow-separate-internal-bridge-fan-control
This commit is contained in:
Ioannis Giannakas 2025-02-09 13:53:57 +00:00 committed by GitHub
parent 2eed82ed81
commit 4e74aaf144
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 104 additions and 20 deletions

View file

@ -1829,6 +1829,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
m_max_layer_z = 0.f;
m_last_width = 0.f;
m_is_overhang_fan_on = false;
m_is_internal_bridge_fan_on = false;
m_is_supp_interface_fan_on = false;
#if ENABLE_GCODE_VIEWER_DATA_CHECKING
m_last_mm3_per_mm = 0.;
@ -5489,7 +5490,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
// { "75%", Overhang_threshold_4_4 },
// { "95%", Overhang_threshold_bridge }
auto check_overhang_fan = [&overhang_fan_threshold](float overlap, ExtrusionRole role) {
if (is_bridge(role)) {
if (role == erBridgeInfill || role == erOverhangPerimeter) { // ORCA: Split out bridge infill to internal and external to apply separate fan settings
return true;
}
switch (overhang_fan_threshold) {
@ -5582,7 +5583,8 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
int overhang_threshold = overhang_fan_threshold == Overhang_threshold_none ? Overhang_threshold_none
: overhang_fan_threshold - 1;
if ((overhang_fan_threshold == Overhang_threshold_none && is_external_perimeter(path.role())) ||
(path.get_overhang_degree() > overhang_threshold || is_bridge(path.role()))) {
(path.get_overhang_degree() > overhang_threshold ||
(path.role() == erBridgeInfill || path.role() == erOverhangPerimeter))) { // ORCA: Add support for separate internal bridge fan speed control
if (!m_is_overhang_fan_on) {
gcode += ";_OVERHANG_FAN_START\n";
m_is_overhang_fan_on = true;
@ -5593,6 +5595,17 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
gcode += ";_OVERHANG_FAN_END\n";
}
}
if (path.role() == erInternalBridgeInfill) { // ORCA: Add support for separate internal bridge fan speed control
if (!m_is_internal_bridge_fan_on) {
gcode += ";_INTERNAL_BRIDGE_FAN_START\n";
m_is_internal_bridge_fan_on = true;
}
} else {
if (m_is_internal_bridge_fan_on) {
m_is_internal_bridge_fan_on = false;
gcode += ";_INTERNAL_BRIDGE_FAN_END\n";
}
}
}
if (supp_interface_fan_speed >= 0 && path.role() == erSupportMaterialInterface) {
if (!m_is_supp_interface_fan_on) {
@ -5727,6 +5740,9 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
bool cur_fan_enabled = false;
if( m_enable_cooling_markers && enable_overhang_bridge_fan)
pre_fan_enabled = check_overhang_fan(new_points[0].overlap, path.role());
if(path.role() == erInternalBridgeInfill) // ORCA: Add support for separate internal bridge fan speed control
pre_fan_enabled = true;
double path_length = 0.;
for (size_t i = 1; i < new_points.size(); i++) {
@ -5750,6 +5766,19 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
}
pre_fan_enabled = cur_fan_enabled;
}
// ORCA: Add support for separate internal bridge fan speed control
if (path.role() == erInternalBridgeInfill) {
if (!m_is_internal_bridge_fan_on) {
gcode += ";_INTERNAL_BRIDGE_FAN_START\n";
m_is_internal_bridge_fan_on = true;
}
} else {
if (m_is_internal_bridge_fan_on) {
gcode += ";_INTERNAL_BRIDGE_FAN_END\n";
m_is_internal_bridge_fan_on = false;
}
}
if (supp_interface_fan_speed >= 0 && path.role() == erSupportMaterialInterface) {
if (!m_is_supp_interface_fan_on) {
gcode += ";_SUPP_INTERFACE_FAN_START\n";