mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-15 04:57:34 +00:00
Print Belt Brim Aprons in Each Object's Brim Filament
Apron-only layers printed every band with the first tool, so objects with different brim filaments at the same apron Z shared one filament. Emit each brim filament's bands with its own toolchange.
This commit is contained in:
@@ -5374,7 +5374,12 @@ LayerResult GCode::process_belt_brim_layer(
|
||||
print.config().layer_change_gcode.value, m_writer->filament()->id(), &config) + "\n";
|
||||
}
|
||||
|
||||
gcode += this->emit_belt_brim_bands(print, layers, single_object_instance_idx);
|
||||
// Objects sharing this apron Z may use different brim filaments; print each in its own tool.
|
||||
for (const unsigned int brim_extruder : layer_tools.extruders) {
|
||||
if (m_writer->filament() == nullptr || m_writer->filament()->id() != brim_extruder)
|
||||
gcode += this->set_extruder(brim_extruder, print_z);
|
||||
gcode += this->emit_belt_brim_bands(print, layers, single_object_instance_idx, brim_extruder);
|
||||
}
|
||||
|
||||
result.gcode = std::move(gcode);
|
||||
return result;
|
||||
@@ -5389,7 +5394,7 @@ LayerResult GCode::process_belt_brim_layer(
|
||||
std::string GCode::emit_belt_brim_bands(const Print &print,
|
||||
const std::vector<LayerToPrint> &layers,
|
||||
const size_t single_object_instance_idx,
|
||||
const std::optional<unsigned int> extruder_id)
|
||||
const unsigned int extruder_id)
|
||||
{
|
||||
std::string gcode;
|
||||
for (const LayerToPrint <p : layers) {
|
||||
@@ -5397,8 +5402,8 @@ std::string GCode::emit_belt_brim_bands(const Print &print,
|
||||
if (band == nullptr || band->fills.empty() || ltp.original_object == nullptr)
|
||||
continue;
|
||||
const PrintObject &object = *ltp.original_object;
|
||||
// No filter prints every band; belt_brim_filament() is 1-based.
|
||||
if (extruder_id && (! object.has_belt_brim() || static_cast<unsigned int>(object.belt_brim_filament() - 1) != *extruder_id))
|
||||
// belt_brim_filament() is 1-based.
|
||||
if (! object.has_belt_brim() || static_cast<unsigned int>(object.belt_brim_filament() - 1) != extruder_id)
|
||||
continue;
|
||||
// Speeds, flow and retraction all read m_config.
|
||||
m_config.apply(print.default_region_config());
|
||||
|
||||
@@ -418,15 +418,14 @@ protected:
|
||||
const bool last_layer,
|
||||
const size_t single_object_instance_idx);
|
||||
|
||||
// Emit the apron bands carried by these layers, only those whose brim filament is
|
||||
// extruder_id (0-based) when given. Called from both the brim-only branch and the
|
||||
// ordinary path, since a band's print_z can coincide with another object's layer on a
|
||||
// multi-object belt.
|
||||
// Emit the apron bands carried by these layers whose brim filament is extruder_id
|
||||
// (0-based). Called from both the brim-only branch and the ordinary path, since a
|
||||
// band's print_z can coincide with another object's layer on a multi-object belt.
|
||||
std::string emit_belt_brim_bands(
|
||||
const Print &print,
|
||||
const std::vector<LayerToPrint> &layers,
|
||||
const size_t single_object_instance_idx,
|
||||
const std::optional<unsigned int> extruder_id = std::nullopt);
|
||||
const unsigned int extruder_id);
|
||||
|
||||
LayerResult process_layer(
|
||||
const Print &print,
|
||||
|
||||
Reference in New Issue
Block a user