FIX: apply unprintable filament type to limit filament map
jira: none Change-Id: I81e22dc28bc416a1b26c242fab4e054f597b064e
This commit is contained in:
parent
31fbdd29e7
commit
9b81b9e2d4
|
@ -1534,7 +1534,10 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu
|
||||||
int extruder_size = m_print->config().nozzle_diameter.values.size();
|
int extruder_size = m_print->config().nozzle_diameter.values.size();
|
||||||
if (extruder_size > 1) {
|
if (extruder_size > 1) {
|
||||||
std::vector<Polygons> extruder_unprintable_polys = m_print->get_extruder_unprintable_polygons();
|
std::vector<Polygons> extruder_unprintable_polys = m_print->get_extruder_unprintable_polygons();
|
||||||
m_processor.check_multi_extruder_gcode_valid(extruder_unprintable_polys, m_print->get_extruder_printable_height(), m_print->get_filament_maps());
|
m_processor.check_multi_extruder_gcode_valid(extruder_unprintable_polys,
|
||||||
|
m_print->get_extruder_printable_height(),
|
||||||
|
m_print->get_filament_maps(),
|
||||||
|
m_print->get_physical_unprintable_filaments(m_print->get_slice_used_filaments(false)));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_processor.finalize(true);
|
m_processor.finalize(true);
|
||||||
|
|
|
@ -1563,7 +1563,10 @@ void GCodeProcessor::register_commands()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GCodeProcessor::check_multi_extruder_gcode_valid(const std::vector<Polygons> &unprintable_areas, const std::vector<double>& printable_heights, const std::vector<int> &filament_map)
|
bool GCodeProcessor::check_multi_extruder_gcode_valid(const std::vector<Polygons> &unprintable_areas,
|
||||||
|
const std::vector<double> &printable_heights,
|
||||||
|
const std::vector<int> &filament_map,
|
||||||
|
const std::vector<std::set<int>> &unprintable_filament_types)
|
||||||
{
|
{
|
||||||
m_result.limit_filament_maps.clear();
|
m_result.limit_filament_maps.clear();
|
||||||
m_result.gcode_check_result.reset();
|
m_result.gcode_check_result.reset();
|
||||||
|
@ -1642,6 +1645,14 @@ bool GCodeProcessor::check_multi_extruder_gcode_valid(const std::vector<Polygons
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// apply unprintable filament type result
|
||||||
|
for (int extruder_id = 0; extruder_id < unprintable_filament_types.size(); ++extruder_id) {
|
||||||
|
const std::set<int> &filament_ids = unprintable_filament_types[extruder_id];
|
||||||
|
for (int filament_id : filament_ids) {
|
||||||
|
m_result.limit_filament_maps[filament_id] |= (1 << extruder_id);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return valid;
|
return valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1091,7 +1091,10 @@ namespace Slic3r {
|
||||||
GCodeProcessor();
|
GCodeProcessor();
|
||||||
|
|
||||||
// check whether the gcode path meets the filament_map grouping requirements
|
// check whether the gcode path meets the filament_map grouping requirements
|
||||||
bool check_multi_extruder_gcode_valid(const std::vector<Polygons> &unprintable_areas, const std::vector<double>& printable_heights, const std::vector<int>& filament_map);
|
bool check_multi_extruder_gcode_valid(const std::vector<Polygons> &unprintable_areas,
|
||||||
|
const std::vector<double> &printable_heights,
|
||||||
|
const std::vector<int> &filament_map,
|
||||||
|
const std::vector<std::set<int>>& unprintable_filament_types );
|
||||||
void apply_config(const PrintConfig& config);
|
void apply_config(const PrintConfig& config);
|
||||||
|
|
||||||
void set_filaments(const std::vector<Extruder>&filament_lists) { m_filament_lists=filament_lists;}
|
void set_filaments(const std::vector<Extruder>&filament_lists) { m_filament_lists=filament_lists;}
|
||||||
|
|
Loading…
Reference in New Issue