Fix for bad wipe tower handling in arrangement

fixes #5320
This commit is contained in:
tamasmeszaros 2020-12-07 18:00:10 +01:00
parent b27e18c970
commit 598ac290a1
3 changed files with 7 additions and 8 deletions

View file

@ -3779,7 +3779,7 @@ GLCanvas3D::WipeTowerInfo GLCanvas3D::get_wipe_tower_info() const
m_config->opt_float("wipe_tower_y"));
wti.m_rotation = (M_PI/180.) * m_config->opt_float("wipe_tower_rotation_angle");
const BoundingBoxf3& bb = vol->bounding_box();
wti.m_bb_size = Vec2d(bb.size().x(), bb.size().y());
wti.m_bb = BoundingBoxf{to_2d(bb.min), to_2d(bb.max)};
break;
}
}

View file

@ -665,8 +665,8 @@ public:
class WipeTowerInfo {
protected:
Vec2d m_pos = {std::nan(""), std::nan("")};
Vec2d m_bb_size = {0., 0.};
double m_rotation = 0.;
BoundingBoxf m_bb;
friend class GLCanvas3D;
public:
@ -677,7 +677,7 @@ public:
inline const Vec2d& pos() const { return m_pos; }
inline double rotation() const { return m_rotation; }
inline const Vec2d bb_size() const { return m_bb_size; }
inline const Vec2d bb_size() const { return m_bb.size(); }
void apply_wipe_tower() const;
};

View file

@ -30,11 +30,10 @@ public:
ArrangePolygon get_arrange_polygon() const
{
Polygon ap({
{coord_t(0), coord_t(0)},
{scaled(m_bb_size(X)), coord_t(0)},
{scaled(m_bb_size)},
{coord_t(0), scaled(m_bb_size(Y))},
{coord_t(0), coord_t(0)},
{scaled(m_bb.min)},
{scaled(m_bb.max.x()), scaled(m_bb.min.y())},
{scaled(m_bb.max)},
{scaled(m_bb.min.x()), scaled(m_bb.max.y())}
});
ArrangePolygon ret;