From f13060358fd1e8f3c923b6c037bb70ad047eb066 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Tue, 2 Jul 2024 16:37:31 +0200 Subject: [PATCH 1/3] Fix prime tower building on mac --- src/PrimeTower/PrimeTower.cpp | 2 +- src/PrimeTower/PrimeTowerInterleaved.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PrimeTower/PrimeTower.cpp b/src/PrimeTower/PrimeTower.cpp index accfeaf374..39deada0f6 100644 --- a/src/PrimeTower/PrimeTower.cpp +++ b/src/PrimeTower/PrimeTower.cpp @@ -53,7 +53,7 @@ PrimeTower::PrimeTower() const double brim_radius_factor = std::pow((1.0 - static_cast(z) / static_cast(base_height)), base_curve_magnitude); const coord_t extra_radius = std::llrint(static_cast(base_extra_radius) * brim_radius_factor); const coord_t total_radius = tower_radius + extra_radius; - base_occupied_outline_.emplace_back(PolygonUtils::makeDisc(middle_, total_radius, circle_definition_), total_radius); + base_occupied_outline_.emplace_back(OccupiedOutline { PolygonUtils::makeDisc(middle_, total_radius, circle_definition_), total_radius }); } } } diff --git a/src/PrimeTower/PrimeTowerInterleaved.cpp b/src/PrimeTower/PrimeTowerInterleaved.cpp index fabe0226ce..8782ab7b33 100644 --- a/src/PrimeTower/PrimeTowerInterleaved.cpp +++ b/src/PrimeTower/PrimeTowerInterleaved.cpp @@ -88,7 +88,7 @@ std::map> PrimeTowerInter { if (toolpaths_at_layer.empty()) { - toolpaths_at_layer.emplace_back(last_extruder_support, ClosedLinesSet(), prime_next_outer_radius, inner_support_radius); + toolpaths_at_layer.emplace_back(ExtruderToolPaths { last_extruder_support, ClosedLinesSet(), prime_next_outer_radius, inner_support_radius }); } ExtruderToolPaths& last_extruder_toolpaths = toolpaths_at_layer.back(); @@ -117,7 +117,7 @@ void PrimeTowerInterleaved::polishExtrudersUses(LayerVector Date: Tue, 2 Jul 2024 14:38:01 +0000 Subject: [PATCH 2/3] Applied clang-format. --- src/PrimeTower/PrimeTower.cpp | 2 +- src/PrimeTower/PrimeTowerInterleaved.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PrimeTower/PrimeTower.cpp b/src/PrimeTower/PrimeTower.cpp index 39deada0f6..f842b682fa 100644 --- a/src/PrimeTower/PrimeTower.cpp +++ b/src/PrimeTower/PrimeTower.cpp @@ -53,7 +53,7 @@ PrimeTower::PrimeTower() const double brim_radius_factor = std::pow((1.0 - static_cast(z) / static_cast(base_height)), base_curve_magnitude); const coord_t extra_radius = std::llrint(static_cast(base_extra_radius) * brim_radius_factor); const coord_t total_radius = tower_radius + extra_radius; - base_occupied_outline_.emplace_back(OccupiedOutline { PolygonUtils::makeDisc(middle_, total_radius, circle_definition_), total_radius }); + base_occupied_outline_.emplace_back(OccupiedOutline{ PolygonUtils::makeDisc(middle_, total_radius, circle_definition_), total_radius }); } } } diff --git a/src/PrimeTower/PrimeTowerInterleaved.cpp b/src/PrimeTower/PrimeTowerInterleaved.cpp index 8782ab7b33..48169d8a8b 100644 --- a/src/PrimeTower/PrimeTowerInterleaved.cpp +++ b/src/PrimeTower/PrimeTowerInterleaved.cpp @@ -88,7 +88,7 @@ std::map> PrimeTowerInter { if (toolpaths_at_layer.empty()) { - toolpaths_at_layer.emplace_back(ExtruderToolPaths { last_extruder_support, ClosedLinesSet(), prime_next_outer_radius, inner_support_radius }); + toolpaths_at_layer.emplace_back(ExtruderToolPaths{ last_extruder_support, ClosedLinesSet(), prime_next_outer_radius, inner_support_radius }); } ExtruderToolPaths& last_extruder_toolpaths = toolpaths_at_layer.back(); @@ -117,7 +117,7 @@ void PrimeTowerInterleaved::polishExtrudersUses(LayerVector Date: Wed, 3 Jul 2024 08:54:21 +0200 Subject: [PATCH 3/3] Use push_back instead of emplace_back Since we can't have the performance improvements provided by emplace_back and its construct-in-place mechanism without adding a lot of code (constructors for the struct), just use push_back to emphasize the fact that we are constructing the objects then putting them into the list. This is fine though, we don't actually need performance in this case. --- src/PrimeTower/PrimeTower.cpp | 2 +- src/PrimeTower/PrimeTowerInterleaved.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PrimeTower/PrimeTower.cpp b/src/PrimeTower/PrimeTower.cpp index f842b682fa..31699c5412 100644 --- a/src/PrimeTower/PrimeTower.cpp +++ b/src/PrimeTower/PrimeTower.cpp @@ -53,7 +53,7 @@ PrimeTower::PrimeTower() const double brim_radius_factor = std::pow((1.0 - static_cast(z) / static_cast(base_height)), base_curve_magnitude); const coord_t extra_radius = std::llrint(static_cast(base_extra_radius) * brim_radius_factor); const coord_t total_radius = tower_radius + extra_radius; - base_occupied_outline_.emplace_back(OccupiedOutline{ PolygonUtils::makeDisc(middle_, total_radius, circle_definition_), total_radius }); + base_occupied_outline_.push_back(OccupiedOutline{ PolygonUtils::makeDisc(middle_, total_radius, circle_definition_), total_radius }); } } } diff --git a/src/PrimeTower/PrimeTowerInterleaved.cpp b/src/PrimeTower/PrimeTowerInterleaved.cpp index 48169d8a8b..854f205e2c 100644 --- a/src/PrimeTower/PrimeTowerInterleaved.cpp +++ b/src/PrimeTower/PrimeTowerInterleaved.cpp @@ -88,7 +88,7 @@ std::map> PrimeTowerInter { if (toolpaths_at_layer.empty()) { - toolpaths_at_layer.emplace_back(ExtruderToolPaths{ last_extruder_support, ClosedLinesSet(), prime_next_outer_radius, inner_support_radius }); + toolpaths_at_layer.push_back(ExtruderToolPaths{ last_extruder_support, ClosedLinesSet(), prime_next_outer_radius, inner_support_radius }); } ExtruderToolPaths& last_extruder_toolpaths = toolpaths_at_layer.back(); @@ -117,7 +117,7 @@ void PrimeTowerInterleaved::polishExtrudersUses(LayerVector