FIX: auto-arrange reads wrongs first_bed_temp
Also change words for extruder clearance parameters. Change-Id: I736fd9049d184c140b33078d78f764b4fe172765 (cherry picked from commit e70c0c0ea133cffa5788efbfc9633332b196e8df)
This commit is contained in:
parent
d3e7989119
commit
8dd401d35f
|
@ -84,6 +84,15 @@ public:
|
||||||
|
|
||||||
std::sort(store_.begin(), store_.end(), sortfunc);
|
std::sort(store_.begin(), store_.end(), sortfunc);
|
||||||
|
|
||||||
|
// debug: write down intitial order
|
||||||
|
for (auto it = store_.begin(); it != store_.end(); ++it) {
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << "initial order: " << it->get().name << ", p=" << it->get().priority() << ", bed_temp=" << it->get().bed_temp << ", height=" << it->get().height
|
||||||
|
<< ", area=" << it->get().area();
|
||||||
|
if (this->unfitindicator_)
|
||||||
|
this->unfitindicator_(ss.str());
|
||||||
|
}
|
||||||
|
|
||||||
int item_id = 0;
|
int item_id = 0;
|
||||||
auto makeProgress = [this, &item_id](Placer &placer, size_t bin_idx) {
|
auto makeProgress = [this, &item_id](Placer &placer, size_t bin_idx) {
|
||||||
packed_bins_[bin_idx] = placer.getItems();
|
packed_bins_[bin_idx] = placer.getItems();
|
||||||
|
@ -102,7 +111,7 @@ public:
|
||||||
bool was_packed = false;
|
bool was_packed = false;
|
||||||
int best_bed_id = -1;
|
int best_bed_id = -1;
|
||||||
int bed_id_firstfit = -1;
|
int bed_id_firstfit = -1;
|
||||||
double score = LARGE_COST_TO_REJECT, best_score = LARGE_COST_TO_REJECT;
|
double score = LARGE_COST_TO_REJECT+1, best_score = LARGE_COST_TO_REJECT+1;
|
||||||
double score_all_plates = 0, score_all_plates_best = std::numeric_limits<double>::max();
|
double score_all_plates = 0, score_all_plates_best = std::numeric_limits<double>::max();
|
||||||
typename Placer::PackResult result, result_best, result_firstfit;
|
typename Placer::PackResult result, result_best, result_firstfit;
|
||||||
size_t j = 0;
|
size_t j = 0;
|
||||||
|
@ -130,8 +139,8 @@ public:
|
||||||
// item is not fit because we have tried all possible plates to find a good enough fit
|
// item is not fit because we have tried all possible plates to find a good enough fit
|
||||||
if (bed_id_firstfit == MAX_NUM_PLATES) {
|
if (bed_id_firstfit == MAX_NUM_PLATES) {
|
||||||
it->get().binId(BIN_ID_UNFIT);
|
it->get().binId(BIN_ID_UNFIT);
|
||||||
//if (this->unfitindicator_)
|
if (this->unfitindicator_)
|
||||||
// this->unfitindicator_(it->get().name + " bed_id_firstfit == MAX_NUM_PLATES" + ",best_score=" + std::to_string(best_score));
|
this->unfitindicator_(it->get().name + " bed_id_firstfit == MAX_NUM_PLATES" + ",best_score=" + std::to_string(best_score));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -152,10 +161,13 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!was_packed){
|
if(!was_packed){
|
||||||
//if (this->unfitindicator_)
|
if (this->unfitindicator_ && !placers.empty())
|
||||||
// this->unfitindicator_(it->get().name + " ,plate_id=" + std::to_string(j) + ",score=" + std::to_string(score)
|
this->unfitindicator_(it->get().name + ", height=" +std::to_string(it->get().height)
|
||||||
// + ", score_all_plates=" + std::to_string(score_all_plates)
|
+ " ,plate_id=" + std::to_string(j-1)
|
||||||
// + ", overfit=" + std::to_string(result.overfit()));
|
+ ", score=" + std::to_string(score)
|
||||||
|
+ ", best_bed_id=" + std::to_string(best_bed_id)
|
||||||
|
+ ", score_all_plates=" + std::to_string(score_all_plates)
|
||||||
|
+", overfit=" + std::to_string(result.overfit()));
|
||||||
|
|
||||||
placers.emplace_back(bin);
|
placers.emplace_back(bin);
|
||||||
placers.back().plateID(placers.size() - 1);
|
placers.back().plateID(placers.size() - 1);
|
||||||
|
|
|
@ -404,8 +404,8 @@ protected:
|
||||||
hasLidHeightConflict |= (p.height > clearance_height_to_lid);
|
hasLidHeightConflict |= (p.height > clearance_height_to_lid);
|
||||||
}
|
}
|
||||||
|
|
||||||
double lambda3 = LARGE_COST_TO_REJECT;
|
double lambda3 = LARGE_COST_TO_REJECT*1.1;
|
||||||
double lambda4 = LARGE_COST_TO_REJECT;
|
double lambda4 = LARGE_COST_TO_REJECT*1.2;
|
||||||
for (int i = 0; i < m_items.size(); i++) {
|
for (int i = 0; i < m_items.size(); i++) {
|
||||||
Item& p = m_items[i];
|
Item& p = m_items[i];
|
||||||
if (p.is_virt_object) continue;
|
if (p.is_virt_object) continue;
|
||||||
|
@ -556,12 +556,11 @@ public:
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//if (progressind) {
|
if (progressind) {
|
||||||
// m_pck.unfitIndicator([this, progressind](std::string name) {
|
m_pck.unfitIndicator([this, progressind](std::string name) {
|
||||||
// progressind(100, name+" not fit!");
|
BOOST_LOG_TRIVIAL(debug) << "arrange not fit: " + name;
|
||||||
// BOOST_LOG_TRIVIAL(debug) << "arrange not fit: " + name;
|
});
|
||||||
// });
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
if (stopcond) m_pck.stopCondition(stopcond);
|
if (stopcond) m_pck.stopCondition(stopcond);
|
||||||
|
|
||||||
|
|
|
@ -127,11 +127,11 @@ ArrangePolygon get_instance_arrange_poly(ModelInstance* instance, const Slic3r::
|
||||||
|
|
||||||
const ConfigOptionInts* bed_opt = config.option<ConfigOptionInts>(get_bed_temp_key(curr_bed_type));
|
const ConfigOptionInts* bed_opt = config.option<ConfigOptionInts>(get_bed_temp_key(curr_bed_type));
|
||||||
if (bed_opt != nullptr)
|
if (bed_opt != nullptr)
|
||||||
ap.bed_temp = bed_opt->get_at(ap.extrude_ids.back());
|
ap.bed_temp = bed_opt->get_at(ap.extrude_ids.back()-1);
|
||||||
|
|
||||||
const ConfigOptionInts* bed_opt_1st_layer = config.option<ConfigOptionInts>(get_bed_temp_1st_layer_key(curr_bed_type));
|
const ConfigOptionInts* bed_opt_1st_layer = config.option<ConfigOptionInts>(get_bed_temp_1st_layer_key(curr_bed_type));
|
||||||
if (bed_opt_1st_layer != nullptr)
|
if (bed_opt_1st_layer != nullptr)
|
||||||
ap.first_bed_temp = bed_opt_1st_layer->get_at(ap.extrude_ids.back());
|
ap.first_bed_temp = bed_opt_1st_layer->get_at(ap.extrude_ids.back()-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.has("nozzle_temperature")) //get the print temperature
|
if (config.has("nozzle_temperature")) //get the print temperature
|
||||||
|
|
|
@ -968,7 +968,7 @@ void PrintConfigDef::init_fff_params()
|
||||||
def = this->add("extruder_clearance_height_to_rod", coFloat);
|
def = this->add("extruder_clearance_height_to_rod", coFloat);
|
||||||
def->label = L("Height to rod");
|
def->label = L("Height to rod");
|
||||||
def->tooltip = L("Distance of the nozzle tip to the lower rod. "
|
def->tooltip = L("Distance of the nozzle tip to the lower rod. "
|
||||||
"Used as input of auto-arranging to avoid collision when printing by object");
|
"Used for collision avoidance in by-object printing.");
|
||||||
def->sidetext = L("mm");
|
def->sidetext = L("mm");
|
||||||
def->min = 0;
|
def->min = 0;
|
||||||
def->mode = comAdvanced;
|
def->mode = comAdvanced;
|
||||||
|
@ -978,7 +978,7 @@ void PrintConfigDef::init_fff_params()
|
||||||
def = this->add("extruder_clearance_height_to_lid", coFloat);
|
def = this->add("extruder_clearance_height_to_lid", coFloat);
|
||||||
def->label = L("Height to lid");
|
def->label = L("Height to lid");
|
||||||
def->tooltip = L("Distance of the nozzle tip to the lid. "
|
def->tooltip = L("Distance of the nozzle tip to the lid. "
|
||||||
"Used as input of auto-arranging to avoid collision when printing by object");
|
"Used for collision avoidance in by-object printing.");
|
||||||
def->sidetext = L("mm");
|
def->sidetext = L("mm");
|
||||||
def->min = 0;
|
def->min = 0;
|
||||||
def->mode = comAdvanced;
|
def->mode = comAdvanced;
|
||||||
|
@ -986,7 +986,7 @@ void PrintConfigDef::init_fff_params()
|
||||||
|
|
||||||
def = this->add("extruder_clearance_radius", coFloat);
|
def = this->add("extruder_clearance_radius", coFloat);
|
||||||
def->label = L("Radius");
|
def->label = L("Radius");
|
||||||
def->tooltip = L("Clearance radius around extruder. Used as input of auto-arranging to avoid collision when printing by object");
|
def->tooltip = L("Clearance radius around extruder. Used for collision avoidance in by-object printing.");
|
||||||
def->sidetext = L("mm");
|
def->sidetext = L("mm");
|
||||||
def->min = 0;
|
def->min = 0;
|
||||||
def->mode = comAdvanced;
|
def->mode = comAdvanced;
|
||||||
|
@ -994,7 +994,7 @@ void PrintConfigDef::init_fff_params()
|
||||||
|
|
||||||
def = this->add("extruder_clearance_max_radius", coFloat);
|
def = this->add("extruder_clearance_max_radius", coFloat);
|
||||||
def->label = L("Max Radius");
|
def->label = L("Max Radius");
|
||||||
def->tooltip = L("Max clearance radius around extruder. Used as input of auto-arranging to avoid collision when printing by object");
|
def->tooltip = L("Max clearance radius around extruder. Used for collision avoidance in by-object printing.");
|
||||||
def->sidetext = L("mm");
|
def->sidetext = L("mm");
|
||||||
def->min = 0;
|
def->min = 0;
|
||||||
def->mode = comAdvanced;
|
def->mode = comAdvanced;
|
||||||
|
|
|
@ -575,6 +575,7 @@ void ArrangeJob::process()
|
||||||
<< ", bed_temp: " << selected.first_bed_temp << ", print_temp: " << selected.print_temp;
|
<< ", bed_temp: " << selected.first_bed_temp << ", print_temp: " << selected.print_temp;
|
||||||
BOOST_LOG_TRIVIAL(debug) << "items unselected before arrange: ";
|
BOOST_LOG_TRIVIAL(debug) << "items unselected before arrange: ";
|
||||||
for (auto item : m_unselected)
|
for (auto item : m_unselected)
|
||||||
|
if (!item.is_virt_object)
|
||||||
BOOST_LOG_TRIVIAL(debug) << item.name << ", extruder: " << item.extrude_ids.back() << ", bed: " << item.bed_idx << ", trans: " << item.translation.transpose();
|
BOOST_LOG_TRIVIAL(debug) << item.name << ", extruder: " << item.extrude_ids.back() << ", bed: " << item.bed_idx << ", trans: " << item.translation.transpose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue