diff --git a/src/slic3r/GUI/Jobs/ArrangeJob.cpp b/src/slic3r/GUI/Jobs/ArrangeJob.cpp index 75b6120b4..d1be13a60 100644 --- a/src/slic3r/GUI/Jobs/ArrangeJob.cpp +++ b/src/slic3r/GUI/Jobs/ArrangeJob.cpp @@ -322,25 +322,29 @@ void ArrangeJob::prepare_wipe_tower() extruder_ids = ppl.get_extruders(true); } + int bedid_unlocked = 0; for (int bedid = 0; bedid < MAX_NUM_PLATES; bedid++) { + int plate_index_valid = std::min(bedid, plate_count - 1); + PartPlate* pl = ppl.get_plate(plate_index_valid); + if(bedidis_locked()) + continue; if (auto wti = get_wipe_tower(*m_plater, bedid)) { // wipe tower is already there wipe_tower_ap = get_wipetower_arrange_poly(&wti); - wipe_tower_ap.bed_idx = bedid; + wipe_tower_ap.bed_idx = bedid_unlocked; m_unselected.emplace_back(wipe_tower_ap); } else if (need_wipe_tower) { if (only_on_partplate) { - int plate_index_valid = std::min(bedid, plate_count - 1); - PartPlate* pl = ppl.get_plate(plate_index_valid); auto plate_extruders = pl->get_extruders(true); extruder_ids.clear(); extruder_ids.insert(plate_extruders.begin(), plate_extruders.end()); } wipe_tower_ap = estimate_wipe_tower_info(bedid, extruder_ids); - wipe_tower_ap.bed_idx = bedid; + wipe_tower_ap.bed_idx = bedid_unlocked; m_unselected.emplace_back(wipe_tower_ap); } + bedid_unlocked++; } } @@ -368,7 +372,6 @@ void ArrangeJob::prepare_partplate() { return; } - params.is_seq_print = plate->get_real_print_seq() == PrintSequence::ByObject; Model& model = m_plater->model(); // Go through the objects and check if inside the selection @@ -548,9 +551,10 @@ void ArrangeJob::process() BOOST_LOG_TRIVIAL(warning)<< "Arrange full params: "<< params.to_json(); BOOST_LOG_TRIVIAL(info) << boost::format("arrange: items selected before arranging: %1%") % m_selected.size(); for (auto selected : m_selected) { - BOOST_LOG_TRIVIAL(debug) << selected.name << ", extruder: " << selected.extrude_ids.back() << ", bed: " << selected.bed_idx<<", filemant_type:" << selected.filament_temp_type; + BOOST_LOG_TRIVIAL(debug) << selected.name << ", extruder: " << selected.extrude_ids.back() << ", bed: " << selected.bed_idx << ", filemant_type:" << selected.filament_temp_type + << ", trans: " << selected.translation.transpose(); } - BOOST_LOG_TRIVIAL(debug) << "items unselected before arrange: "; + BOOST_LOG_TRIVIAL(debug) << "arrange: items unselected before arrange: " << m_unselected.size(); for (auto item : m_unselected) BOOST_LOG_TRIVIAL(debug) << item.name << ", bed: " << item.bed_idx << ", trans: " << item.translation.transpose() <<", bbox:"<(selected.translation(X)) << ","<< unscale(selected.translation(Y)); - BOOST_LOG_TRIVIAL(debug) << "items unselected after arrange: "; + BOOST_LOG_TRIVIAL(debug) << "arrange: items unselected after arrange: "<< m_unselected.size(); for (auto item : m_unselected) BOOST_LOG_TRIVIAL(debug) << item.name << ", bed: " << item.bed_idx << ", trans: " << item.translation.transpose(); } @@ -759,7 +763,11 @@ arrangement::ArrangeParams init_arrange_params(Plater *p) if (state == Job::JobPrepareState::PREPARE_STATE_MENU) { PartPlateList &plate_list = p->get_partplate_list(); PartPlate * plate = plate_list.get_curr_plate(); - params.is_seq_print = plate->get_real_print_seq() == PrintSequence::ByObject; + bool plate_same_as_global = true; + params.is_seq_print = plate->get_real_print_seq(&plate_same_as_global) == PrintSequence::ByObject; + // if plate's print sequence is not the same as global, the settings.distance is no longer valid, we set it to auto + if (!plate_same_as_global) + params.min_obj_distance = 0; } if (params.is_seq_print) { diff --git a/src/slic3r/GUI/PartPlate.cpp b/src/slic3r/GUI/PartPlate.cpp index abdd23aa4..31dd9170a 100644 --- a/src/slic3r/GUI/PartPlate.cpp +++ b/src/slic3r/GUI/PartPlate.cpp @@ -242,13 +242,21 @@ PrintSequence PartPlate::get_print_seq() const return PrintSequence::ByDefault; } -PrintSequence PartPlate::get_real_print_seq() const +PrintSequence PartPlate::get_real_print_seq(bool* plate_same_as_global) const { + PrintSequence global_print_seq = PrintSequence::ByDefault; + auto curr_preset_config = wxGetApp().preset_bundle->prints.get_edited_preset().config; + if (curr_preset_config.has("print_sequence")) + global_print_seq = curr_preset_config.option>("print_sequence")->value; + PrintSequence curr_plate_seq = get_print_seq(); if (curr_plate_seq == PrintSequence::ByDefault) { - auto curr_preset_config = wxGetApp().preset_bundle->prints.get_edited_preset().config; - if (curr_preset_config.has("print_sequence")) curr_plate_seq = curr_preset_config.option>("print_sequence")->value; + curr_plate_seq = global_print_seq; } + + if(plate_same_as_global) + *plate_same_as_global = (curr_plate_seq == global_print_seq); + return curr_plate_seq; } @@ -4591,11 +4599,9 @@ void PartPlateList::postprocess_arrange_polygon(arrangement::ArrangePolygon& arr { // outarea for large object arrange_polygon.bed_idx = m_plate_list.size(); - BoundingBox apbox = get_extents(arrange_polygon.poly); + BoundingBox apbox = get_extents(arrange_polygon.transformed_poly()); // the item may have been rotated auto apbox_size = apbox.size(); - //arrange_polygon.translation(X) = scaled(0.5 * plate_stride_x()); - //arrange_polygon.translation(Y) = scaled(0.5 * plate_stride_y()); arrange_polygon.translation(X) = 0.5 * apbox_size[0]; arrange_polygon.translation(Y) = scaled(static_cast(m_plate_depth)) - 0.5 * apbox_size[1]; } diff --git a/src/slic3r/GUI/PartPlate.hpp b/src/slic3r/GUI/PartPlate.hpp index 9d1f94f80..ab5d6bf6c 100644 --- a/src/slic3r/GUI/PartPlate.hpp +++ b/src/slic3r/GUI/PartPlate.hpp @@ -245,7 +245,7 @@ public: // Get the real effective print sequence of current plate. // If curr_plate's print_seq is ByDefault, use the global sequence // @return PrintSequence::{ByLayer,ByObject} - PrintSequence get_real_print_seq() const; + PrintSequence get_real_print_seq(bool* plate_same_as_global=nullptr) const; bool has_spiral_mode_config() const; bool get_spiral_vase_mode() const; @@ -694,6 +694,7 @@ public: std::vector get_nonempty_plates_slice_results(); + //compute the origin for printable plate with index i Vec3d get_current_plate_origin() { return compute_origin(m_current_plate, m_plate_cols); } Vec2d get_current_shape_position() { return compute_shape_position(m_current_plate, m_plate_cols); } Pointfs get_exclude_area() { return m_exclude_areas; }