ENH: Change the collision calculation

of the wipe tower's outer wall to use the actual outer wall path.

jira: none
Change-Id: Ib45ecbc328c88c1abe6d9e8567f715331a3ddd37
(cherry picked from commit 0a20f1fe6d6d63cdcb13bc19fd9ae553f45b6f59)
This commit is contained in:
jiangkai.zhao
2025-02-10 15:58:34 +08:00
committed by Noisyfox
parent f133dd1733
commit d463858fda
5 changed files with 49 additions and 39 deletions

View File

@@ -187,7 +187,19 @@ public:
Polygon generate_rib_polygon(const box_coordinates &wt_box);
float get_depth() const { return m_wipe_tower_depth; }
float get_brim_width() const { return m_wipe_tower_brim_width_real; }
BoundingBoxf get_bbx() const { return m_wipe_tower_bbx; }
BoundingBoxf get_bbx() const {
BoundingBox box = get_extents(m_outer_wall.front());
BoundingBoxf res = BoundingBoxf(unscale(box.min), unscale(box.max));
return res;
}
Polylines get_outer_wall() const {
Polylines res = m_outer_wall;
Point trans = scaled(m_rib_offset);
for (auto &polyline : res)
for (auto &p : polyline.points)
p += trans;
return res;
}
float get_height() const { return m_wipe_tower_height; }
float get_layer_height() const { return m_layer_height; }
@@ -456,8 +468,8 @@ private:
bool m_left_to_right = true;
float m_extra_spacing = 1.f;
float m_tpu_fixed_spacing = 2;
BoundingBoxf m_wipe_tower_bbx;
std::vector<Vec2f> m_wall_skip_points;
std::vector<Polyline> m_outer_wall;
bool is_first_layer() const { return size_t(m_layer_info - m_plan.begin()) == m_first_layer_idx; }
// Calculates length of extrusion line to extrude given volume