mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-24 03:12:07 +00:00
ENH: Add limited filament maps to slice info
jira: none Change-Id: I7b08943ba5f4e7fa9be18ba3f64caee182888d45 (cherry picked from commit 85ebb469959499d5c2d7fe349e0d8e92045c9fab)
This commit is contained in:
@@ -699,8 +699,11 @@ GCodeProcessor::GCodeProcessor()
|
||||
|
||||
bool GCodeProcessor::check_multi_extruder_gcode_valid(const std::vector<Polygons> &unprintable_areas, const std::vector<int> &filament_map)
|
||||
{
|
||||
m_result.limit_filament_maps.clear();
|
||||
m_result.gcode_check_result.reset();
|
||||
|
||||
m_result.limit_filament_maps.resize(filament_map.size(), 0);
|
||||
|
||||
auto to_2d = [](const Vec3d &pos) -> Point {
|
||||
Point ps(scale_(pos.x()), scale_(pos.y()));
|
||||
return ps;
|
||||
@@ -735,6 +738,15 @@ bool GCodeProcessor::check_multi_extruder_gcode_valid(const std::vector<Polygons
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < unprintable_areas.size(); ++i) {
|
||||
for (const Polygon &poly : unprintable_areas[i]) {
|
||||
if (!poly.bounding_box().overlap(bbox))
|
||||
continue;
|
||||
|
||||
m_result.limit_filament_maps[iter->first] |= (1 << i);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
// Accurate calculation is not efficient
|
||||
for (const Polygon& poly : unprintable_areas[extruder_id]) {
|
||||
|
||||
@@ -233,6 +233,7 @@ class Print;
|
||||
std::vector<float> filament_costs;
|
||||
std::vector<int> filament_vitrification_temperature;
|
||||
std::vector<int> filament_maps;
|
||||
std::vector<int> limit_filament_maps;
|
||||
PrintEstimatedStatistics print_statistics;
|
||||
std::vector<CustomGCode::Item> custom_gcode_per_print_z;
|
||||
std::vector<std::pair<float, std::pair<size_t, size_t>>> spiral_vase_layers;
|
||||
@@ -273,6 +274,7 @@ class Print;
|
||||
warnings = other.warnings;
|
||||
bed_type = other.bed_type;
|
||||
gcode_check_result = other.gcode_check_result;
|
||||
limit_filament_maps = other.limit_filament_maps;
|
||||
filament_printable_reuslt = other.filament_printable_reuslt;
|
||||
#if ENABLE_GCODE_VIEWER_STATISTICS
|
||||
time = other.time;
|
||||
|
||||
Reference in New Issue
Block a user