From d9249024baf3deb3771fe588a93085cb104f25ee Mon Sep 17 00:00:00 2001 From: Filip Sykala Date: Tue, 22 Mar 2022 15:59:58 +0100 Subject: [PATCH] fix: ../src/libslic3r/CutSurface.cpp:368:110: error: cannot bind non-const lvalue reference of type 'CGAL::Surface_mesh >::Property_map&' to an rvalue of type 'CGAL::Surface_mesh >::Property_map' ../src/libslic3r/CutSurface.cpp:369:110: error: cannot bind non-const lvalue reference of type 'CGAL::Surface_mesh >::Property_map&' to an rvalue of type 'CGAL::Surface_mesh >::Property_map' ../src/libslic3r/CutSurface.cpp:482:41: warning: comparison of integer expressions of different signedness: 'int32_t' {aka 'int'} and 'std::vector >::size_type' {aka 'long unsigned int'} [-Wsign-compare] ../src/libslic3r/CutSurface.cpp:522:12: warning: unused variable 'count' [-Wunused-variable] ../src/libslic3r/CutSurface.cpp:1041:15: warning: unused variable 'color' [-Wunused-variable] --- src/libslic3r/CutSurface.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/libslic3r/CutSurface.cpp b/src/libslic3r/CutSurface.cpp index d2dc1897b2..b76431e97c 100644 --- a/src/libslic3r/CutSurface.cpp +++ b/src/libslic3r/CutSurface.cpp @@ -367,8 +367,8 @@ void store(const SurfaceCuts &cut, const std::string &file_prefix); } // namespace privat SurfaceCuts Slic3r::cut_surface(const indexed_triangle_set &model, - const ExPolygons &shapes, - const Emboss::IProject &projection) + const ExPolygons &shapes, + const Emboss::IProject &projection) { priv::CutMesh cgal_model = priv::to_cgal(model); @@ -376,8 +376,8 @@ SurfaceCuts Slic3r::cut_surface(const indexed_triangle_set &model, std::string face_shape_map_name = "f:IntersectingElement"; priv::CutMesh cgal_shape = priv::to_cgal(shapes, projection, edge_shape_map_name, face_shape_map_name); - auto& edge_shape_map = cgal_shape.property_map(edge_shape_map_name).first; - auto& face_shape_map = cgal_shape.property_map(face_shape_map_name).first; + auto edge_shape_map = cgal_shape.property_map(edge_shape_map_name).first; + auto face_shape_map = cgal_shape.property_map(face_shape_map_name).first; std::string vert_shape_map_name = "v:IntersectingElement"; // pointer to edge or face shape_map @@ -490,7 +490,7 @@ priv::CutMesh priv::to_cgal(const ExPolygons &shapes, uint32_t contour_index = 0; for (int32_t i = 0; i < int32_t(indices.size()); i += 2) { bool is_first = i == 0; - bool is_last = (i + 2) >= indices.size(); + bool is_last = size_t(i + 2) >= indices.size(); int32_t j = is_last ? 0 : (i + 2); auto fi1 = result.add_face(indices[i], indices[i + 1], indices[j]); @@ -530,7 +530,6 @@ void priv::set_face_type(FaceTypeMap &face_type_map, const Project &project, const CutMesh &shape_mesh) { - size_t count = 0; for (auto& fi : mesh.faces()) { FaceType face_type = FaceType::not_constrained; auto hi_end = mesh.halfedge(fi); @@ -1049,7 +1048,6 @@ void priv::store(CutMesh &mesh, const ReductionMap &reduction_map, const std::st vertex_colors[vi] = CGAL::Color{127, 127, 127}; for (VI reduction_from : mesh.vertices()) { - auto &color = vertex_colors[reduction_from]; VI reduction_to = reduction_map[reduction_from]; if (reduction_to != reduction_from) { vertex_colors[reduction_from] = CGAL::Color{255, 0, 0};