mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-01 09:22:58 -05:00
Make support generation exclusion-volume aware
This commit is contained in:
1 parent
5ec9169bc7
commit
fd55cc77d3
12 files changed
+376
-68
No files matched your search
+17
-4
@@ -5201,13 +5201,25 @@ std::string GCode::generate_object_skirt_group(const Print &print,
|
||||
object_skirt_tools, layer, extruder_id, m_skirt_group_done[group_idx]);
|
||||
}
|
||||
|
||||
std::string GCode::generate_object_brim(const Print &print, const PrintObject &object, size_t instance_id, bool first_layer)
|
||||
std::string GCode::generate_object_brim(
|
||||
const Print &print,
|
||||
const PrintObject &object,
|
||||
const size_t instance_id,
|
||||
const bool first_layer,
|
||||
const unsigned int extruder_id)
|
||||
{
|
||||
if (!first_layer)
|
||||
return {};
|
||||
|
||||
auto emit_brim = [this](const ExtrusionEntityCollection& brim, const std::vector<ObjectInstanceID>& instances) {
|
||||
auto emit_brim = [this, extruder_id](const ExtrusionEntityCollection& brim,
|
||||
const std::vector<ObjectInstanceID>& instances,
|
||||
const unsigned int brim_filament_id) {
|
||||
std::string gcode;
|
||||
// Combined brims have an explicit owner filament. Waiting for that
|
||||
// filament avoids inheriting whichever tool first encounters a carrier
|
||||
// object in the layer traversal.
|
||||
if (brim_filament_id != extruder_id)
|
||||
return gcode;
|
||||
const bool already_emitted = std::none_of(instances.begin(), instances.end(), [this](const ObjectInstanceID& instance) {
|
||||
return m_objsWithBrim.find(instance) != m_objsWithBrim.end();
|
||||
});
|
||||
@@ -5232,7 +5244,7 @@ std::string GCode::generate_object_brim(const Print &print, const PrintObject &o
|
||||
std::string gcode;
|
||||
for (const Print::SkirtBrimGroup::Brim& brim : print.skirt_brim_groups()[group_idx].brims)
|
||||
if (std::find(brim.instances.begin(), brim.instances.end(), object_instance_id) != brim.instances.end())
|
||||
gcode += emit_brim(brim.brim, brim.instances);
|
||||
gcode += emit_brim(brim.brim, brim.instances, brim.filament_id);
|
||||
return gcode;
|
||||
}
|
||||
|
||||
@@ -6497,7 +6509,8 @@ LayerResult GCode::process_layer(
|
||||
const LayerToPrint &layer_to_print = layers[instance_to_print.layer_id];
|
||||
if (visit.first_visit && print_wipe_extrusions == (is_anything_overridden ? 1 : 0)) {
|
||||
gcode += generate_object_skirt_group(print, instance_to_print.print_object, instance_to_print.instance_id, layer_tools, layer, extruder_id);
|
||||
gcode += generate_object_brim(print, instance_to_print.print_object, instance_to_print.instance_id, first_layer);
|
||||
gcode += generate_object_brim(
|
||||
print, instance_to_print.print_object, instance_to_print.instance_id, first_layer, extruder_id);
|
||||
}
|
||||
|
||||
// To control print speed of the 1st object layer printed over raft interface.
|
||||
|
||||
Reference in new issue
Block a user