mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-09 07:56:24 -06:00
FIX: avoid wipe tower conflict with objects
Change-Id: I09f6937a4bb698e4981c094c5694b3ce50efd2b4 (cherry picked from commit 2fc3f05732b8e5c7132b6c8a5f4403d30c516bff)
This commit is contained in:
parent
229b173894
commit
29459fe4cb
3 changed files with 22 additions and 11 deletions
|
@ -1718,7 +1718,7 @@ bool GLCanvas3D::make_current_for_postinit() {
|
|||
return _set_current();
|
||||
}
|
||||
|
||||
Points GLCanvas3D::estimate_wipe_tower_points(int plate_index) const
|
||||
Points GLCanvas3D::estimate_wipe_tower_points(int plate_index, bool global) const
|
||||
{
|
||||
PartPlateList & ppl = wxGetApp().plater()->get_partplate_list();
|
||||
DynamicPrintConfig &proj_cfg = wxGetApp().preset_bundle->project_config;
|
||||
|
@ -1734,18 +1734,26 @@ Points GLCanvas3D::estimate_wipe_tower_points(int plate_index) const
|
|||
if (wipe_tower_size(1) == 0) {
|
||||
// when depth is unavailable (no items on this plate), we have to estimate the depth using the extruder number of all plates
|
||||
std::set<int> extruder_ids;
|
||||
auto pl = ppl.get_plate_list();
|
||||
for (const auto& p : pl) {
|
||||
auto es = p->get_extruders();
|
||||
if (global) {
|
||||
auto objs = wxGetApp().obj_list()->objects();
|
||||
for (ModelObject *obj : *objs) {
|
||||
for (ModelVolume *volume : obj->volumes) {
|
||||
std::vector<int> es = volume->get_extruders();
|
||||
extruder_ids.insert(es.begin(), es.end());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
PartPlate* pl = ppl.get_plate(plate_index);
|
||||
std::vector<int> es = pl->get_extruders();
|
||||
extruder_ids.insert(es.begin(), es.end());
|
||||
}
|
||||
int extruder_size = extruder_ids.size();
|
||||
int extruder_size = extruder_ids.size();
|
||||
wipe_tower_size(1) = extruder_size * print.wipe_tower_data(extruder_size).depth + 2 * print.wipe_tower_data().brim_width;
|
||||
}
|
||||
Vec3d plate_origin = ppl.get_plate(plate_index)->get_origin();
|
||||
Vec3d plate_origin = ppl.get_plate(plate_index)->get_origin();
|
||||
Point wt_min_corner{scale_(x), scale_(y)};
|
||||
Point wt_max_corner(scale_(x + wipe_tower_size(0)), scale_(y + wipe_tower_size(1)));
|
||||
return {wt_min_corner, {wt_max_corner.x(), wt_min_corner.y()}, wt_max_corner, {wt_min_corner.x(),wt_max_corner.y()}};
|
||||
return {wt_min_corner, {wt_max_corner.x(), wt_min_corner.y()}, wt_max_corner, {wt_min_corner.x(), wt_max_corner.y()}};
|
||||
}
|
||||
|
||||
void GLCanvas3D::render(bool only_init)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue