Another bugfixes of GCode export after refactoring.

This commit is contained in:
bubnikv 2020-01-14 15:12:45 +01:00
parent b54ce0d468
commit ab6a2b71e8
4 changed files with 6 additions and 6 deletions

View file

@ -570,9 +570,8 @@ float WipingExtrusions::mark_wiping_extrusions(const Print& print, unsigned int
const LayerTools& lt = *m_layer_tools; const LayerTools& lt = *m_layer_tools;
const float min_infill_volume = 0.f; // ignore infill with smaller volume than this const float min_infill_volume = 0.f; // ignore infill with smaller volume than this
assert(volume_to_wipe >= 0.); if (! this->something_overridable || volume_to_wipe <= 0. || print.config().filament_soluble.get_at(old_extruder) || print.config().filament_soluble.get_at(new_extruder))
if (! this->something_overridable || volume_to_wipe == 0. || print.config().filament_soluble.get_at(old_extruder) || print.config().filament_soluble.get_at(new_extruder)) return 0.f; // Soluble filament cannot be wiped in a random infill, neither the filament after it
return volume_to_wipe; // Soluble filament cannot be wiped in a random infill, neither the filament after it
// we will sort objects so that dedicated for wiping are at the beginning: // we will sort objects so that dedicated for wiping are at the beginning:
PrintObjectPtrs object_list = print.objects(); PrintObjectPtrs object_list = print.objects();

View file

@ -23,8 +23,9 @@ void GCodeWriter::apply_print_config(const PrintConfig &print_config)
print_config.machine_max_acceleration_extruding.values.front() : 0); print_config.machine_max_acceleration_extruding.values.front() : 0);
} }
void GCodeWriter::set_extruders(const std::vector<unsigned int> &extruder_ids) void GCodeWriter::set_extruders(std::vector<unsigned int> extruder_ids)
{ {
std::sort(extruder_ids.begin(), extruder_ids.end());
m_extruders.clear(); m_extruders.clear();
m_extruders.reserve(extruder_ids.size()); m_extruders.reserve(extruder_ids.size());
for (unsigned int extruder_id : extruder_ids) for (unsigned int extruder_id : extruder_ids)

View file

@ -33,7 +33,7 @@ public:
std::string extrusion_axis() const { return m_extrusion_axis; } std::string extrusion_axis() const { return m_extrusion_axis; }
void apply_print_config(const PrintConfig &print_config); void apply_print_config(const PrintConfig &print_config);
// Extruders are expected to be sorted in an increasing order. // Extruders are expected to be sorted in an increasing order.
void set_extruders(const std::vector<unsigned int> &extruder_ids); void set_extruders(std::vector<unsigned int> extruder_ids);
const std::vector<Extruder>& extruders() const { return m_extruders; } const std::vector<Extruder>& extruders() const { return m_extruders; }
std::vector<unsigned int> extruder_ids() const { std::vector<unsigned int> extruder_ids() const {
std::vector<unsigned int> out; std::vector<unsigned int> out;

View file

@ -52,7 +52,7 @@ public:
// Average diameter of nozzles participating on extruding this region. // Average diameter of nozzles participating on extruding this region.
coordf_t bridging_height_avg(const PrintConfig &print_config) const; coordf_t bridging_height_avg(const PrintConfig &print_config) const;
// Collect extruder indices used to print this region's object. // Collect 0-based extruder indices used to print this region's object.
void collect_object_printing_extruders(std::vector<unsigned int> &object_extruders) const; void collect_object_printing_extruders(std::vector<unsigned int> &object_extruders) const;
static void collect_object_printing_extruders(const PrintConfig &print_config, const PrintRegionConfig &region_config, std::vector<unsigned int> &object_extruders); static void collect_object_printing_extruders(const PrintConfig &print_config, const PrintRegionConfig &region_config, std::vector<unsigned int> &object_extruders);