From bd0d4c662abb1699c94c9a427542223d09c0008f Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Thu, 25 May 2023 12:15:35 +0200 Subject: [PATCH] Organic supports: Fixed a wrong order of config initialization, fixed some compilation warnings. --- src/libslic3r/Support/SupportCommon.cpp | 6 +++--- src/libslic3r/Support/TreeSupportCommon.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/Support/SupportCommon.cpp b/src/libslic3r/Support/SupportCommon.cpp index 2035f9ea3..7c4f9b979 100644 --- a/src/libslic3r/Support/SupportCommon.cpp +++ b/src/libslic3r/Support/SupportCommon.cpp @@ -298,7 +298,7 @@ std::pair generate_interfa else { SupportGeneratorLayersPtr out(in1.size() + in2.size(), nullptr); std::merge(in1.begin(), in1.end(), in2.begin(), in2.end(), out.begin(), [](auto* l, auto* r) { return l->print_z < r->print_z; }); - return std::move(out); + return out; } }; interface_layers = merge_remove_empty(interface_layers, top_interface_layers); @@ -664,7 +664,7 @@ static inline void tree_supports_generate_paths( // Draw the perimeters. Polylines polylines; polylines.reserve(expoly.holes.size() + 1); - for (size_t idx_loop = 0; idx_loop < expoly.num_contours(); ++ idx_loop) { + for (int idx_loop = 0; idx_loop < int(expoly.num_contours()); ++ idx_loop) { // Open the loop with a seam. const Polygon &loop = expoly.contour_or_hole(idx_loop); Polyline pl(loop.points); @@ -684,7 +684,7 @@ static inline void tree_supports_generate_paths( double d2min = std::numeric_limits::max(); Vec2d seam_pt = pl.back().cast(); for (ClipperLib_Z::Path &path : anchor_candidates) - for (int i = 0; i < path.size(); ++ i) { + for (int i = 0; i < int(path.size()); ++ i) { int j = next_idx_modulo(i, path); if (path[i].z() == idx_loop || path[j].z() == idx_loop) { Vec2d pi(path[i].x(), path[i].y()); diff --git a/src/libslic3r/Support/TreeSupportCommon.cpp b/src/libslic3r/Support/TreeSupportCommon.cpp index 86b62d0bc..54f67e940 100644 --- a/src/libslic3r/Support/TreeSupportCommon.cpp +++ b/src/libslic3r/Support/TreeSupportCommon.cpp @@ -84,8 +84,8 @@ TreeSupportSettings::TreeSupportSettings(const TreeSupportMeshGroupSettings &mes layer_height(mesh_group_settings.layer_height), branch_radius(mesh_group_settings.support_tree_branch_diameter / 2), min_radius(mesh_group_settings.support_tree_tip_diameter / 2), // The actual radius is 50 microns larger as the resulting branches will be increased by 50 microns to avoid rounding errors effectively increasing the xydistance - maximum_move_distance((angle < M_PI / 2.) ? (coord_t)(tan(angle) * layer_height) : std::numeric_limits::max()), - maximum_move_distance_slow((angle_slow < M_PI / 2.) ? (coord_t)(tan(angle_slow) * layer_height) : std::numeric_limits::max()), + maximum_move_distance((mesh_group_settings.support_tree_angle < M_PI / 2.) ? (coord_t)(tan(mesh_group_settings.support_tree_angle) * layer_height) : std::numeric_limits::max()), + maximum_move_distance_slow((mesh_group_settings.support_tree_angle_slow < M_PI / 2.) ? (coord_t)(tan(mesh_group_settings.support_tree_angle_slow) * layer_height) : std::numeric_limits::max()), support_bottom_layers(mesh_group_settings.support_bottom_enable ? (mesh_group_settings.support_bottom_height + layer_height / 2) / layer_height : 0), tip_layers(std::max((branch_radius - min_radius) / (support_line_width / 3), branch_radius / layer_height)), // Ensure lines always stack nicely even if layer height is large branch_radius_increase_per_layer(tan(mesh_group_settings.support_tree_branch_diameter_angle) * layer_height), @@ -155,7 +155,7 @@ TreeSupportSettings::TreeSupportSettings(const TreeSupportMeshGroupSettings &mes // Layers between the raft contacts and bottom of the object. auto nsteps = int(ceil(dist_to_go / slicing_params.max_suport_layer_height)); double step = dist_to_go / nsteps; - for (size_t i = 0; i < nsteps; ++ i) { + for (int i = 0; i < nsteps; ++ i) { z += step; this->raft_layers.emplace_back(z); }