From 4e9372c58b1f8316302fa062e90cd04a897fe49e Mon Sep 17 00:00:00 2001 From: bubnikv Date: Wed, 20 Feb 2019 15:54:12 +0100 Subject: [PATCH] Merge fixes --- src/libslic3r/Model.hpp | 2 ++ src/libslic3r/SLA/SLABasePool.cpp | 15 +++++++-------- src/libslic3r/SLA/SLABoilerPlate.hpp | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/libslic3r/Model.hpp b/src/libslic3r/Model.hpp index 5d6f2a9db..b67c6bf2e 100644 --- a/src/libslic3r/Model.hpp +++ b/src/libslic3r/Model.hpp @@ -49,6 +49,8 @@ struct ModelID bool operator<=(const ModelID &rhs) const { return this->id <= rhs.id; } bool operator>=(const ModelID &rhs) const { return this->id >= rhs.id; } + bool valid() const { return id != 0; } + size_t id; }; diff --git a/src/libslic3r/SLA/SLABasePool.cpp b/src/libslic3r/SLA/SLABasePool.cpp index 80634adb4..6f85c43dc 100644 --- a/src/libslic3r/SLA/SLABasePool.cpp +++ b/src/libslic3r/SLA/SLABasePool.cpp @@ -306,8 +306,8 @@ ExPolygons unify(const ExPolygons& shapes) { /// Only a debug function to generate top and bottom plates from a 2D shape. /// It is not used in the algorithm directly. inline Contour3D roofs(const ExPolygon& poly, coord_t z_distance) { - auto lower = triangulate_expolygons_3df(poly); - auto upper = triangulate_expolygons_3df(poly, z_distance*SCALING_FACTOR, true); + auto lower = triangulate_expolygon_3d(poly); + auto upper = triangulate_expolygon_3d(poly, z_distance*SCALING_FACTOR, true); Contour3D ret; ret.merge(lower); ret.merge(upper); return ret; @@ -409,8 +409,7 @@ Contour3D inner_bed(const ExPolygon& poly, double begin_h_mm = 0) { Contour3D bottom; - Pointf3s triangles = triangulate_expolygons_3df(poly, - -depth_mm + begin_h_mm); + Pointf3s triangles = triangulate_expolygon_3d(poly, -depth_mm + begin_h_mm); bottom.merge(triangles); coord_t depth = mm(depth_mm); @@ -597,7 +596,7 @@ void create_base_pool(const ExPolygons &ground_layer, TriangleMesh& out, // serve as the bottom plate of the pad. We will offset this concave hull // and then offset back the result with clipper with rounding edges ON. This // trick will create a nice rounded pad shape. - auto concavehs = concave_hull(ground_layer, mergedist, cfg.throw_on_cancel); + ExPolygons concavehs = concave_hull(ground_layer, mergedist, cfg.throw_on_cancel); const double thickness = cfg.min_wall_thickness_mm; const double wingheight = cfg.min_wall_height_mm; @@ -707,11 +706,11 @@ void create_base_pool(const ExPolygons &ground_layer, TriangleMesh& out, // Now we need to triangulate the top and bottom plates as well as the // cavity bottom plate which is the same as the bottom plate but it is // elevated by the thickness. - pool.merge(triangulate_expolygons_3df(top_poly)); - pool.merge(triangulate_expolygons_3df(inner_base, -fullheight, true)); + pool.merge(triangulate_expolygon_3d(top_poly)); + pool.merge(triangulate_expolygon_3d(inner_base, -fullheight, true)); if(wingheight > 0) - pool.merge(triangulate_expolygons_3df(inner_base, -wingheight)); + pool.merge(triangulate_expolygon_3d(inner_base, -wingheight)); } diff --git a/src/libslic3r/SLA/SLABoilerPlate.hpp b/src/libslic3r/SLA/SLABoilerPlate.hpp index dbe35eddb..602121af9 100644 --- a/src/libslic3r/SLA/SLABoilerPlate.hpp +++ b/src/libslic3r/SLA/SLABoilerPlate.hpp @@ -60,7 +60,7 @@ struct Contour3D { points.insert(points.end(), triangles.begin(), triangles.end()); indices.reserve(indices.size() + points.size() / 3); - for(size_t i = offs; i < points.size(); i += 3) + for(int i = (int)offs; i < (int)points.size(); i += 3) indices.emplace_back(i, i + 1, i + 2); }