mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-15 21:17:41 +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";
|
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);
|
result.gcode = std::move(gcode);
|
||||||
return result;
|
return result;
|
||||||
@@ -5389,7 +5394,7 @@ LayerResult GCode::process_belt_brim_layer(
|
|||||||
std::string GCode::emit_belt_brim_bands(const Print &print,
|
std::string GCode::emit_belt_brim_bands(const Print &print,
|
||||||
const std::vector<LayerToPrint> &layers,
|
const std::vector<LayerToPrint> &layers,
|
||||||
const size_t single_object_instance_idx,
|
const size_t single_object_instance_idx,
|
||||||
const std::optional<unsigned int> extruder_id)
|
const unsigned int extruder_id)
|
||||||
{
|
{
|
||||||
std::string gcode;
|
std::string gcode;
|
||||||
for (const LayerToPrint <p : layers) {
|
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)
|
if (band == nullptr || band->fills.empty() || ltp.original_object == nullptr)
|
||||||
continue;
|
continue;
|
||||||
const PrintObject &object = *ltp.original_object;
|
const PrintObject &object = *ltp.original_object;
|
||||||
// No filter prints every band; belt_brim_filament() is 1-based.
|
// belt_brim_filament() is 1-based.
|
||||||
if (extruder_id && (! object.has_belt_brim() || static_cast<unsigned int>(object.belt_brim_filament() - 1) != *extruder_id))
|
if (! object.has_belt_brim() || static_cast<unsigned int>(object.belt_brim_filament() - 1) != extruder_id)
|
||||||
continue;
|
continue;
|
||||||
// Speeds, flow and retraction all read m_config.
|
// Speeds, flow and retraction all read m_config.
|
||||||
m_config.apply(print.default_region_config());
|
m_config.apply(print.default_region_config());
|
||||||
|
|||||||
@@ -418,15 +418,14 @@ protected:
|
|||||||
const bool last_layer,
|
const bool last_layer,
|
||||||
const size_t single_object_instance_idx);
|
const size_t single_object_instance_idx);
|
||||||
|
|
||||||
// Emit the apron bands carried by these layers, only those whose brim filament is
|
// Emit the apron bands carried by these layers whose brim filament is extruder_id
|
||||||
// extruder_id (0-based) when given. Called from both the brim-only branch and the
|
// (0-based). Called from both the brim-only branch and the ordinary path, since a
|
||||||
// ordinary path, since a band's print_z can coincide with another object's layer on a
|
// band's print_z can coincide with another object's layer on a multi-object belt.
|
||||||
// multi-object belt.
|
|
||||||
std::string emit_belt_brim_bands(
|
std::string emit_belt_brim_bands(
|
||||||
const Print &print,
|
const Print &print,
|
||||||
const std::vector<LayerToPrint> &layers,
|
const std::vector<LayerToPrint> &layers,
|
||||||
const size_t single_object_instance_idx,
|
const size_t single_object_instance_idx,
|
||||||
const std::optional<unsigned int> extruder_id = std::nullopt);
|
const unsigned int extruder_id);
|
||||||
|
|
||||||
LayerResult process_layer(
|
LayerResult process_layer(
|
||||||
const Print &print,
|
const Print &print,
|
||||||
|
|||||||
Reference in New Issue
Block a user