Organic supports: Fixed a wrong order of config initialization,

fixed some compilation warnings.
This commit is contained in:
Vojtech Bubnik 2023-05-25 12:15:35 +02:00
parent 25575bb3f3
commit bd0d4c662a
2 changed files with 6 additions and 6 deletions

View File

@ -298,7 +298,7 @@ std::pair<SupportGeneratorLayersPtr, SupportGeneratorLayersPtr> generate_interfa
else { else {
SupportGeneratorLayersPtr out(in1.size() + in2.size(), nullptr); 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; }); 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); interface_layers = merge_remove_empty(interface_layers, top_interface_layers);
@ -664,7 +664,7 @@ static inline void tree_supports_generate_paths(
// Draw the perimeters. // Draw the perimeters.
Polylines polylines; Polylines polylines;
polylines.reserve(expoly.holes.size() + 1); 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. // Open the loop with a seam.
const Polygon &loop = expoly.contour_or_hole(idx_loop); const Polygon &loop = expoly.contour_or_hole(idx_loop);
Polyline pl(loop.points); Polyline pl(loop.points);
@ -684,7 +684,7 @@ static inline void tree_supports_generate_paths(
double d2min = std::numeric_limits<double>::max(); double d2min = std::numeric_limits<double>::max();
Vec2d seam_pt = pl.back().cast<double>(); Vec2d seam_pt = pl.back().cast<double>();
for (ClipperLib_Z::Path &path : anchor_candidates) 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); int j = next_idx_modulo(i, path);
if (path[i].z() == idx_loop || path[j].z() == idx_loop) { if (path[i].z() == idx_loop || path[j].z() == idx_loop) {
Vec2d pi(path[i].x(), path[i].y()); Vec2d pi(path[i].x(), path[i].y());

View File

@ -84,8 +84,8 @@ TreeSupportSettings::TreeSupportSettings(const TreeSupportMeshGroupSettings &mes
layer_height(mesh_group_settings.layer_height), layer_height(mesh_group_settings.layer_height),
branch_radius(mesh_group_settings.support_tree_branch_diameter / 2), 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 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<coord_t>::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<coord_t>::max()),
maximum_move_distance_slow((angle_slow < M_PI / 2.) ? (coord_t)(tan(angle_slow) * layer_height) : std::numeric_limits<coord_t>::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<coord_t>::max()),
support_bottom_layers(mesh_group_settings.support_bottom_enable ? (mesh_group_settings.support_bottom_height + layer_height / 2) / layer_height : 0), 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 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), 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. // Layers between the raft contacts and bottom of the object.
auto nsteps = int(ceil(dist_to_go / slicing_params.max_suport_layer_height)); auto nsteps = int(ceil(dist_to_go / slicing_params.max_suport_layer_height));
double step = dist_to_go / nsteps; double step = dist_to_go / nsteps;
for (size_t i = 0; i < nsteps; ++ i) { for (int i = 0; i < nsteps; ++ i) {
z += step; z += step;
this->raft_layers.emplace_back(z); this->raft_layers.emplace_back(z);
} }