From 0726e896ce9171bd3bd968deafd1b47adbb8b0c0 Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Sat, 12 May 2018 18:38:55 -0500 Subject: [PATCH] Draw clearance area if necessary. --- src/GUI/Plater/Plate2D.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/GUI/Plater/Plate2D.cpp b/src/GUI/Plater/Plate2D.cpp index e694b3680..15f449c03 100644 --- a/src/GUI/Plater/Plate2D.cpp +++ b/src/GUI/Plater/Plate2D.cpp @@ -134,6 +134,16 @@ void Plate2D::repaint(wxPaintEvent& e) { for (const auto& points : obj.instance_thumbnails.back().expolygons) { auto poly { this->scaled_points_to_pixel(Polygon(points), true) }; dc->DrawPolygon(poly.size(), poly.data(), 0, 0); + // TODO draw bounding box if that debug option is turned on. + + // if sequential printing is enabled and more than one object, draw clearance area + if (this->config->get("complete_objects") && + std::count_if(this->model->objects.cbegin(), this->model->objects.cend(), [](const ModelObject* o){ return o->instances.size() > 0; }) > 1) { + auto clearance {offset(thumbnail.convex_hull(), (scale_(this->config->get("extruder_clearance_radius")) / 2.0), 1.0, ClipperLib::jtRound, scale_(0.1))}; + dc->SetPen(this->clearance_pen); + dc->SetBrush(this->transparent_brush); + auto poly { this->scaled_points_to_pixel(Polygon(clearance.front()), true) }; + dc->DrawPolygon(poly.size(), poly.data(), 0, 0); } } }