mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-27 15:49:52 -05:00
Brim filament for features (#17655)
This commit is contained in:
1 parent
8b3de0be86
commit
12c9ee813b
18 files changed
+373
-22
No files matched your search
+18
-2
@@ -6091,8 +6091,9 @@ std::string GCode::generate_object_brim(
|
||||
if (!first_layer)
|
||||
return {};
|
||||
|
||||
const bool wait_for_owner_filament = has_bed_exclude_volumes(m_config) &&
|
||||
active_bed_exclude_volume_mode(m_config) != BedExcludeVolumeMode::Shared;
|
||||
// A chosen brim filament also waits for its own pass, see process_layer().
|
||||
const bool wait_for_owner_filament = object.config().brim_filament_id.value > 0 ||
|
||||
(has_bed_exclude_volumes(m_config) && active_bed_exclude_volume_mode(m_config) != BedExcludeVolumeMode::Shared);
|
||||
auto emit_brim = [this, extruder_id, wait_for_owner_filament](const ExtrusionEntityCollection& brim,
|
||||
const std::vector<ObjectInstanceID>& instances,
|
||||
const unsigned int brim_filament_id) {
|
||||
@@ -7623,6 +7624,21 @@ LayerResult GCode::process_layer(
|
||||
this->set_origin(saved_origin);
|
||||
}
|
||||
|
||||
// A chosen brim filament may print nothing else on its objects, so their brims go down at the start of its pass.
|
||||
if (first_layer) {
|
||||
const Vec2d saved_origin = m_origin;
|
||||
for (const LayerToPrint <p : layers) {
|
||||
const PrintObject *object = ltp.original_object;
|
||||
if (object == nullptr || object->config().brim_filament_id.value <= 0 || object->has_belt_brim())
|
||||
continue;
|
||||
const size_t i_begin = single_object_instance_idx == size_t(-1) ? 0 : single_object_instance_idx;
|
||||
const size_t i_end = single_object_instance_idx == size_t(-1) ? object->instances().size() : single_object_instance_idx + 1;
|
||||
for (size_t i = i_begin; i < i_end && i < object->instances().size(); ++i)
|
||||
gcode += generate_object_brim(print, *object, i, first_layer, extruder_id, ltp.object_layer);
|
||||
}
|
||||
this->set_origin(saved_origin);
|
||||
}
|
||||
|
||||
auto &filament_plan = filament_to_print_instances[extruder_id];
|
||||
std::vector<InstanceToPrint> &instances_to_print = filament_plan.first;
|
||||
const std::vector<InstanceVisit> &instance_visits = filament_plan.second;
|
||||
|
||||
Reference in new issue
Block a user