diff --git a/include/ExtruderPlan.h b/include/ExtruderPlan.h index 17e45d0013..7f534d1ec8 100644 --- a/include/ExtruderPlan.h +++ b/include/ExtruderPlan.h @@ -93,11 +93,10 @@ class ExtruderPlan /*! * Applying fan speed changes for minimal layer times. * - * \param starting_position The position the head was before starting this extruder plan * \param minTime Maximum minimum layer time for all extruders in this layer * \param time_other_extr_plans The time spent on the other extruder plans in this layer */ - void processFanSpeedForMinimalLayerTime(Point2LL starting_position, Duration maximum_cool_min_layer_time, double time_other_extr_plans); + void processFanSpeedForMinimalLayerTime(Duration maximum_cool_min_layer_time, double time_other_extr_plans); /*! * Applying fan speed changes for the first layers. diff --git a/include/FffGcodeWriter.h b/include/FffGcodeWriter.h index 68c1cb9986..46b9657968 100644 --- a/include/FffGcodeWriter.h +++ b/include/FffGcodeWriter.h @@ -312,12 +312,11 @@ class FffGcodeWriter : public NoCopy /*! * Add a single layer from a single mesh-volume to the layer plan \p gcodeLayer in mesh surface mode. * - * \param[in] storage where the slice data is stored. * \param mesh The mesh to add to the layer plan \p gcodeLayer. * \param mesh_config the line config with which to print a print feature * \param gcodeLayer The initial planning of the gcode of the layer. */ - void addMeshLayerToGCode_meshSurfaceMode(const SliceDataStorage& storage, const SliceMeshStorage& mesh, const MeshPathConfigs& mesh_config, LayerPlan& gcodeLayer) const; + void addMeshLayerToGCode_meshSurfaceMode(const SliceMeshStorage& mesh, const MeshPathConfigs& mesh_config, LayerPlan& gcodeLayer) const; /*! * Add the open polylines from a single layer from a single mesh-volume to the layer plan \p gcodeLayer for mesh the surface modes. @@ -398,13 +397,8 @@ class FffGcodeWriter : public NoCopy * \param part The part for which to create gcode. * \return Whether this function added anything to the layer plan. */ - bool processMultiLayerInfill( - const SliceDataStorage& storage, - LayerPlan& gcodeLayer, - const SliceMeshStorage& mesh, - const size_t extruder_nr, - const MeshPathConfigs& mesh_config, - const SliceLayerPart& part) const; + bool processMultiLayerInfill(LayerPlan& gcodeLayer, const SliceMeshStorage& mesh, const size_t extruder_nr, const MeshPathConfigs& mesh_config, const SliceLayerPart& part) + const; /*! * \brief Add normal sparse infill for a given part in a layer. @@ -549,7 +543,6 @@ class FffGcodeWriter : public NoCopy * \param[in] storage where the slice data is stored. * \param gcode_layer The initial planning of the gcode of the layer. * \param mesh The mesh for which to add to the layer plan \p gcode_layer. - * \param mesh_config The mesh-config for which to add to the layer plan \p gcode_layer. * \param extruder_nr The extruder for which to print all features of the mesh which should be printed with this extruder * \param area The area to fill * \param config the line config with which to print the print feature @@ -566,7 +559,6 @@ class FffGcodeWriter : public NoCopy const SliceDataStorage& storage, LayerPlan& gcode_layer, const SliceMeshStorage& mesh, - const MeshPathConfigs& mesh_config, const size_t extruder_nr, const Polygons& area, const GCodePathConfig& config, diff --git a/include/PathOrderOptimizer.h b/include/PathOrderOptimizer.h index 4dd1e47332..94b4c74344 100644 --- a/include/PathOrderOptimizer.h +++ b/include/PathOrderOptimizer.h @@ -220,7 +220,7 @@ class PathOrderOptimizer } else { - optimized_order = getOptimizerOrderWithConstraints(line_bucket_grid, snap_radius, *order_requirements_); + optimized_order = getOptimizerOrderWithConstraints(*order_requirements_); } @@ -300,10 +300,6 @@ class PathOrderOptimizer std::unordered_map picked(paths_.size()); // Fixed size boolean flag for whether each path is already in the optimized vector. - auto isPicked = [&picked](OrderablePath* c) - { - return picked[c]; - }; auto notPicked = [&picked](OrderablePath* c) { return ! picked[c]; @@ -356,8 +352,7 @@ class PathOrderOptimizer return optimized_order; } - std::vector - getOptimizerOrderWithConstraints(SparsePointGridInclusive line_bucket_grid, size_t snap_radius, const std::unordered_multimap& order_requirements) + std::vector getOptimizerOrderWithConstraints(const std::unordered_multimap& order_requirements) { std::vector optimized_order; // To store our result in. @@ -422,7 +417,7 @@ class PathOrderOptimizer }; const std::function handle_node - = [¤t_position, &optimized_order, this](const Path current_node, const std::nullptr_t _state) + = [¤t_position, &optimized_order, this](const Path current_node, [[maybe_unused]] const std::nullptr_t state) { // We should make map from node <-> path for this stuff for (auto& path : paths_) @@ -652,7 +647,6 @@ class PathOrderOptimizer { // For most seam types, the shortest distance matters. Not for SHARPEST_CORNER though. // For SHARPEST_CORNER, use a fixed starting score of 0. - const coord_t distance = (combing_boundary_ == nullptr) ? getDirectDistance(here, target_pos) : getCombingDistance(here, target_pos); const double score_distance = (seam_config_.type_ == EZSeamType::SHARPEST_CORNER && seam_config_.corner_pref_ != EZSeamCornerPrefType::Z_SEAM_CORNER_PREF_NONE) ? MM2INT(10) : vSize2(here - target_pos); diff --git a/include/Preheat.h b/include/Preheat.h index dba5d72c08..e9ff74ac23 100644 --- a/include/Preheat.h +++ b/include/Preheat.h @@ -4,13 +4,13 @@ #ifndef PREHEAT_H #define PREHEAT_H +#include // max +#include + #include "settings/types/Duration.h" #include "settings/types/Ratio.h" #include "settings/types/Temperature.h" -#include // max -#include - namespace cura { @@ -45,11 +45,10 @@ class Preheat * or the initial layer temperature. * * \param extruder The extruder train - * \param flow The flow for which to get the optimal temperature * \param is_initial_layer Whether the initial layer temperature should be returned instead of flow-based temperature * \return The corresponding optimal temperature */ - Temperature getTemp(const size_t extruder, const Ratio& flow, const bool is_initial_layer); + Temperature getTemp(const size_t extruder, const bool is_initial_layer); /*! * Decide when to start warming up again after starting to cool down towards \p temp_mid. @@ -112,4 +111,4 @@ class Preheat } // namespace cura -#endif // PREHEAT_H \ No newline at end of file +#endif // PREHEAT_H diff --git a/include/SkeletalTrapezoidationGraph.h b/include/SkeletalTrapezoidationGraph.h index 01eb198f94..6f6bb99ebc 100644 --- a/include/SkeletalTrapezoidationGraph.h +++ b/include/SkeletalTrapezoidationGraph.h @@ -85,7 +85,7 @@ class SkeletalTrapezoidationGraph : public HalfEdgeGraph, Polygons, Polygons> operator()(auto&&... args) + std::tuple, Polygons, Polygons> operator()([[maybe_unused]] auto&&... args) { // this code is only reachable when no slot is registered while the infill type is requested to be // generated by a plugin; this should not be possible to set up in the first place. Return an empty diff --git a/include/support.h b/include/support.h index 16819c0c90..81b1218929 100644 --- a/include/support.h +++ b/include/support.h @@ -4,12 +4,12 @@ #ifndef SUPPORT_H #define SUPPORT_H -#include "settings/types/LayerIndex.h" -#include "utils/polygon.h" - #include #include +#include "settings/types/LayerIndex.h" +#include "utils/polygon.h" + namespace cura { @@ -219,11 +219,9 @@ class AreaSupport * \param storage Where to store the resulting support. * \param supportLayer_up The support areas the layer above. * \param supportLayer_this The overhang areas of the current layer at hand. - * \param smoothing_distance Maximal distance in the X/Y directions of a - * line segment which is to be smoothed out. * \return The joined support areas for this layer. */ - static Polygons join(const SliceDataStorage& storage, const Polygons& supportLayer_up, Polygons& supportLayer_this, const coord_t smoothing_distance); + static Polygons join(const SliceDataStorage& storage, const Polygons& supportLayer_up, Polygons& supportLayer_this); /*! * Move the support up from model (cut away polygons to ensure bottom z distance) @@ -322,11 +320,10 @@ class AreaSupport * generates varying xy disallowed areas for \param layer_idx where the offset distance is dependent on the wall angle * * \param storage Data storage containing the input layer data and - * \param settings The settings to use to calculate the offsets * \param layer_idx The layer for which the disallowed areas are to be calcualted * */ - static Polygons generateVaryingXYDisallowedArea(const SliceMeshStorage& storage, const Settings& infill_settings, const LayerIndex layer_idx); + static Polygons generateVaryingXYDisallowedArea(const SliceMeshStorage& storage, const LayerIndex layer_idx); }; diff --git a/src/BeadingStrategy/BeadingStrategy.cpp b/src/BeadingStrategy/BeadingStrategy.cpp index 88b295b7ad..9383d796f0 100644 --- a/src/BeadingStrategy/BeadingStrategy.cpp +++ b/src/BeadingStrategy/BeadingStrategy.cpp @@ -50,7 +50,7 @@ double BeadingStrategy::getTransitionAnchorPos(coord_t lower_bead_count) const return 1.0 - static_cast(transition_point - lower_optimum) / static_cast(upper_optimum - lower_optimum); } -std::vector BeadingStrategy::getNonlinearThicknesses(coord_t lower_bead_count) const +std::vector BeadingStrategy::getNonlinearThicknesses([[maybe_unused]] coord_t lower_bead_count) const { return std::vector(); } diff --git a/src/FffGcodeWriter.cpp b/src/FffGcodeWriter.cpp index 8c0577e3bc..4d54b3bb23 100644 --- a/src/FffGcodeWriter.cpp +++ b/src/FffGcodeWriter.cpp @@ -1092,7 +1092,7 @@ FffGcodeWriter::ProcessLayerResult FffGcodeWriter::processLayer(const SliceDataS == mesh->settings.get("wall_0_extruder_nr").extruder_nr_ // mesh surface mode should always only be printed with the outer wall extruder! ) { - addMeshLayerToGCode_meshSurfaceMode(storage, *mesh, mesh_config, gcode_layer); + addMeshLayerToGCode_meshSurfaceMode(*mesh, mesh_config, gcode_layer); } else { @@ -1476,8 +1476,7 @@ std::vector FffGcodeWriter::calculateMeshOrder(const SliceDataStorage& s return ret; } -void FffGcodeWriter::addMeshLayerToGCode_meshSurfaceMode(const SliceDataStorage& storage, const SliceMeshStorage& mesh, const MeshPathConfigs& mesh_config, LayerPlan& gcode_layer) - const +void FffGcodeWriter::addMeshLayerToGCode_meshSurfaceMode(const SliceMeshStorage& mesh, const MeshPathConfigs& mesh_config, LayerPlan& gcode_layer) const { if (gcode_layer.getLayerNr() > mesh.layer_nr_max_filled_layer) { @@ -1630,13 +1629,12 @@ bool FffGcodeWriter::processInfill( { return false; } - bool added_something = processMultiLayerInfill(storage, gcode_layer, mesh, extruder_nr, mesh_config, part); + bool added_something = processMultiLayerInfill(gcode_layer, mesh, extruder_nr, mesh_config, part); added_something = added_something | processSingleLayerInfill(storage, gcode_layer, mesh, extruder_nr, mesh_config, part); return added_something; } bool FffGcodeWriter::processMultiLayerInfill( - const SliceDataStorage& storage, LayerPlan& gcode_layer, const SliceMeshStorage& mesh, const size_t extruder_nr, @@ -2698,7 +2696,6 @@ void FffGcodeWriter::processRoofing( storage, gcode_layer, mesh, - mesh_config, extruder_nr, skin_part.roofing_fill, mesh_config.roofing_config, @@ -2879,7 +2876,6 @@ void FffGcodeWriter::processTopBottom( storage, gcode_layer, mesh, - mesh_config, extruder_nr, skin_part.skin_fill, *skin_config, @@ -2896,7 +2892,6 @@ void FffGcodeWriter::processSkinPrintFeature( const SliceDataStorage& storage, LayerPlan& gcode_layer, const SliceMeshStorage& mesh, - const MeshPathConfigs& mesh_config, const size_t extruder_nr, const Polygons& area, const GCodePathConfig& config, diff --git a/src/FffPolygonGenerator.cpp b/src/FffPolygonGenerator.cpp index fa25f1e1db..0f731b9bae 100644 --- a/src/FffPolygonGenerator.cpp +++ b/src/FffPolygonGenerator.cpp @@ -1090,7 +1090,8 @@ void FffPolygonGenerator::processFuzzyWalls(SliceMeshStorage& mesh) = (mesh.settings.get("adhesion_type") == EPlatformAdhesion::BRIM) ? 1 : 0; // don't make fuzzy skin on first layer if there's a brim auto hole_area = Polygons(); - std::function accumulate_is_in_hole = [](const bool& prev_result, const ExtrusionJunction& junction) + std::function accumulate_is_in_hole + = []([[maybe_unused]] const bool& prev_result, [[maybe_unused]] const ExtrusionJunction& junction) { return false; }; diff --git a/src/InterlockingGenerator.cpp b/src/InterlockingGenerator.cpp index ba4528eb51..6ac2efb7d1 100644 --- a/src/InterlockingGenerator.cpp +++ b/src/InterlockingGenerator.cpp @@ -78,7 +78,7 @@ std::pair InterlockingGenerator::growBorderAreasPerpendicula Polygons from_border_b = b.difference(total_shrunk); Polygons temp_a, temp_b; - for (auto _ : ranges::views::iota(0, (detect / min_line) + 2)) + for (coord_t i = 0; i < (detect / min_line) + 2; ++i) { temp_a = from_border_a.offset(min_line); temp_b = from_border_b.offset(min_line); diff --git a/src/LayerPlan.cpp b/src/LayerPlan.cpp index a9932a7116..6e5ce67341 100644 --- a/src/LayerPlan.cpp +++ b/src/LayerPlan.cpp @@ -1133,7 +1133,7 @@ void LayerPlan::addWall( void LayerPlan::addInfillWall(const ExtrusionLine& wall, const GCodePathConfig& path_config, bool force_retract) { - assert(("All empty walls should have been filtered at this stage", ! wall.empty())); + assert(! wall.empty() && "All empty walls should have been filtered at this stage"); ExtrusionJunction junction{ *wall.begin() }; addTravel(junction.p_, force_retract); @@ -1701,7 +1701,7 @@ TimeMaterialEstimates ExtruderPlan::computeNaiveTimeEstimates(Point2LL starting_ return estimates_; } -void ExtruderPlan::processFanSpeedForMinimalLayerTime(Point2LL starting_position, Duration minTime, double time_other_extr_plans) +void ExtruderPlan::processFanSpeedForMinimalLayerTime(Duration minTime, double time_other_extr_plans) { /* min layer time @@ -1778,7 +1778,6 @@ void LayerPlan::processFanSpeedAndMinimalLayerTime(Point2LL starting_position) return a.extruder_nr_ < b.extruder_nr_; }) ->extruder_nr_; - Point2LL starting_position_last_extruder; unsigned int last_extruder_idx; double other_extr_plan_time = 0.0; Duration maximum_cool_min_layer_time; @@ -1792,7 +1791,6 @@ void LayerPlan::processFanSpeedAndMinimalLayerTime(Point2LL starting_position) extruder_plan.computeNaiveTimeEstimates(starting_position); if (extruder_plan.extruder_nr_ == last_extruder_nr) { - starting_position_last_extruder = starting_position; last_extruder_idx = extr_plan_idx; } else @@ -1814,7 +1812,7 @@ void LayerPlan::processFanSpeedAndMinimalLayerTime(Point2LL starting_position) // apply minimum layer time behaviour ExtruderPlan& last_extruder_plan = extruder_plans_[last_extruder_idx]; last_extruder_plan.forceMinimalLayerTime(maximum_cool_min_layer_time, other_extr_plan_time); - last_extruder_plan.processFanSpeedForMinimalLayerTime(starting_position_last_extruder, maximum_cool_min_layer_time, other_extr_plan_time); + last_extruder_plan.processFanSpeedForMinimalLayerTime(maximum_cool_min_layer_time, other_extr_plan_time); } diff --git a/src/LayerPlanBuffer.cpp b/src/LayerPlanBuffer.cpp index 453d55f7f4..7d430b8f01 100644 --- a/src/LayerPlanBuffer.cpp +++ b/src/LayerPlanBuffer.cpp @@ -519,18 +519,12 @@ void LayerPlanBuffer::insertTempCommands() size_t extruder = extruder_plan.extruder_nr_; const Settings& extruder_settings = Application::getInstance().current_slice_->scene.extruders[extruder].settings_; Duration time = extruder_plan.estimates_.getTotalUnretractedTime(); - Ratio avg_flow; - if (time > 0.0) - { - avg_flow = extruder_plan.estimates_.material / time; - } - else + if (time <= 0.0) { assert(extruder_plan.estimates_.material == 0.0 && "No extrusion time should mean no material usage!"); - avg_flow = 0.0; } - Temperature print_temp = preheat_config_.getTemp(extruder, avg_flow, extruder_plan.is_initial_layer_); + Temperature print_temp = preheat_config_.getTemp(extruder, extruder_plan.is_initial_layer_); Temperature initial_print_temp = extruder_settings.get("material_initial_print_temperature"); if (extruder_plan.temperature_factor_ > 0) // force lower printing temperatures due to minimum layer time diff --git a/src/Preheat.cpp b/src/Preheat.cpp index d2190cb9a3..d9f24b200a 100644 --- a/src/Preheat.cpp +++ b/src/Preheat.cpp @@ -39,7 +39,7 @@ Duration Preheat::getTimeToGoFromTempToTemp(const size_t extruder, const Tempera return std::max(0.0_s, time); } -Temperature Preheat::getTemp(const size_t extruder, const Ratio& flow, const bool is_initial_layer) +Temperature Preheat::getTemp(const size_t extruder, const bool is_initial_layer) { const Settings& extruder_settings = Application::getInstance().current_slice_->scene.extruders[extruder].settings_; if (is_initial_layer && extruder_settings.get("material_print_temperature_layer_0") != 0) diff --git a/src/SkeletalTrapezoidation.cpp b/src/SkeletalTrapezoidation.cpp index 3aca0644db..887059324d 100644 --- a/src/SkeletalTrapezoidation.cpp +++ b/src/SkeletalTrapezoidation.cpp @@ -97,9 +97,7 @@ void SkeletalTrapezoidation::transferEdge( assert(twin->prev_); // Forth rib assert(twin->prev_->twin_); // Back rib assert(twin->prev_->twin_->prev_); // Prev segment along parabola - - constexpr bool is_not_next_to_start_or_end = false; // Only ribs at the end of a cell should be skipped - graph_.makeRib(prev_edge, start_source_point, end_source_point, is_not_next_to_start_or_end); + graph_.makeRib(prev_edge, start_source_point, end_source_point); } assert(prev_edge); } @@ -152,8 +150,7 @@ void SkeletalTrapezoidation::transferEdge( if (p1_idx < discretized.size() - 1) { // Rib for last segment gets introduced outside this function! - constexpr bool is_not_next_to_start_or_end = false; // Only ribs at the end of a cell should be skipped - graph_.makeRib(prev_edge, start_source_point, end_source_point, is_not_next_to_start_or_end); + graph_.makeRib(prev_edge, start_source_point, end_source_point); } } assert(prev_edge); @@ -460,8 +457,7 @@ void SkeletalTrapezoidation::constructFromPolygons(const Polygons& polys) node_t* starting_node = vd_node_to_he_node_[starting_vonoroi_edge->vertex0()]; starting_node->data_.distance_to_boundary_ = 0; - constexpr bool is_next_to_start_or_end = true; - graph_.makeRib(prev_edge, start_source_point, end_source_point, is_next_to_start_or_end); + graph_.makeRib(prev_edge, start_source_point, end_source_point); for (vd_t::edge_type* vd_edge = starting_vonoroi_edge->next(); vd_edge != ending_vonoroi_edge; vd_edge = vd_edge->next()) { assert(vd_edge->is_finite()); @@ -469,7 +465,7 @@ void SkeletalTrapezoidation::constructFromPolygons(const Polygons& polys) Point2LL v2 = VoronoiUtils::p(vd_edge->vertex1()); transferEdge(v1, v2, *vd_edge, prev_edge, start_source_point, end_source_point, points, segments); - graph_.makeRib(prev_edge, start_source_point, end_source_point, vd_edge->next() == ending_vonoroi_edge); + graph_.makeRib(prev_edge, start_source_point, end_source_point); } transferEdge(VoronoiUtils::p(ending_vonoroi_edge->vertex0()), end_source_point, *ending_vonoroi_edge, prev_edge, start_source_point, end_source_point, points, segments); diff --git a/src/SkeletalTrapezoidationGraph.cpp b/src/SkeletalTrapezoidationGraph.cpp index 514277ed36..cad3cba700 100644 --- a/src/SkeletalTrapezoidationGraph.cpp +++ b/src/SkeletalTrapezoidationGraph.cpp @@ -329,7 +329,7 @@ void SkeletalTrapezoidationGraph::collapseSmallEdges(coord_t snap_dist) } } -void SkeletalTrapezoidationGraph::makeRib(edge_t*& prev_edge, Point2LL start_source_point, Point2LL end_source_point, bool is_next_to_start_or_end) +void SkeletalTrapezoidationGraph::makeRib(edge_t*& prev_edge, Point2LL start_source_point, Point2LL end_source_point) { Point2LL p = LinearAlg2D::getClosestOnLine(prev_edge->to_->p_, start_source_point, end_source_point); coord_t dist = vSize(prev_edge->to_->p_ - p); diff --git a/src/TreeModelVolumes.cpp b/src/TreeModelVolumes.cpp index 948ef86ec0..7318061091 100644 --- a/src/TreeModelVolumes.cpp +++ b/src/TreeModelVolumes.cpp @@ -905,7 +905,7 @@ Polygons TreeModelVolumes::safeOffset(const Polygons& me, coord_t distance, Clip assert(distance * max_safe_step_distance >= 0); Polygons ret = me; - for (const auto i : ranges::views::iota(0UL, steps)) + for (size_t i = 0; i < steps; ++i) { ret = ret.offset(max_safe_step_distance, jt).unionPolygons(collision); } @@ -1254,7 +1254,7 @@ coord_t TreeModelVolumes::ceilRadius(coord_t radius) const coord_t exponential_result = SUPPORT_TREE_EXPONENTIAL_THRESHOLD * SUPPORT_TREE_EXPONENTIAL_FACTOR; const coord_t stepsize = (exponential_result - radius_0_) / (SUPPORT_TREE_PRE_EXPONENTIAL_STEPS + 1); coord_t result = radius_0_; - for (const auto step : ranges::views::iota(0UL, SUPPORT_TREE_PRE_EXPONENTIAL_STEPS)) + for (size_t i = 0; i < SUPPORT_TREE_PRE_EXPONENTIAL_STEPS; ++i) { result += stepsize; if (result >= radius && ! ignorable_radii_.count(result)) diff --git a/src/TreeSupport.cpp b/src/TreeSupport.cpp index d12e14adbd..145fc64bf3 100644 --- a/src/TreeSupport.cpp +++ b/src/TreeSupport.cpp @@ -250,7 +250,7 @@ void TreeSupport::precalculate(const SliceDataStorage& storage, std::vector>& move_bounds, SliceDataStorage& storage) { - TreeSupportTipGenerator tip_gen(storage, mesh, volumes_); + TreeSupportTipGenerator tip_gen(mesh, volumes_); tip_gen.generateTips(storage, mesh, move_bounds, additional_required_support_area, placed_support_lines_support_areas); } diff --git a/src/TreeSupportTipGenerator.cpp b/src/TreeSupportTipGenerator.cpp index c5292dbf2b..27137585b6 100644 --- a/src/TreeSupportTipGenerator.cpp +++ b/src/TreeSupportTipGenerator.cpp @@ -28,7 +28,7 @@ namespace cura { -TreeSupportTipGenerator::TreeSupportTipGenerator(const SliceDataStorage& storage, const SliceMeshStorage& mesh, TreeModelVolumes& volumes_s) +TreeSupportTipGenerator::TreeSupportTipGenerator(const SliceMeshStorage& mesh, TreeModelVolumes& volumes_s) : config_(mesh.settings) , use_fake_roof_(! mesh.settings.get("support_roof_enable")) , volumes_(volumes_s) diff --git a/src/communication/CommandLine.cpp b/src/communication/CommandLine.cpp index 26dcaa60c3..95359abae4 100644 --- a/src/communication/CommandLine.cpp +++ b/src/communication/CommandLine.cpp @@ -80,7 +80,7 @@ void CommandLine::sendGCodePrefix(const std::string&) const // TODO: Right now this is done directly in the g-code writer. For consistency it should be moved here? } -void CommandLine::sendSliceUUID(const std::string& slice_uuid) const +void CommandLine::sendSliceUUID([[maybe_unused]] const std::string& slice_uuid) const { // pass } diff --git a/src/plugins/converters.cpp b/src/plugins/converters.cpp index 2f8eabd151..40988a2f7b 100644 --- a/src/plugins/converters.cpp +++ b/src/plugins/converters.cpp @@ -85,9 +85,11 @@ handshake_response::native_value_type handshake_response::operator()(const hands .broadcast_subscriptions = std::set(message.broadcast_subscriptions().begin(), message.broadcast_subscriptions().end()) }; } -simplify_request::value_type - simplify_request::operator()(const simplify_request::native_value_type& polygons, const coord_t max_resolution, const coord_t max_deviation, const coord_t max_area_deviation) - const +simplify_request::value_type simplify_request::operator()( + const simplify_request::native_value_type& polygons, + const coord_t max_resolution, + [[maybe_unused]] const coord_t max_deviation, + [[maybe_unused]] const coord_t max_area_deviation) const { value_type message{}; if (polygons.empty()) @@ -478,4 +480,4 @@ gcode_paths_modify_response::native_value_type return paths; } -} // namespace cura::plugins \ No newline at end of file +} // namespace cura::plugins diff --git a/src/skin.cpp b/src/skin.cpp index 9f1d865dcd..e02ba1b2d1 100644 --- a/src/skin.cpp +++ b/src/skin.cpp @@ -386,7 +386,6 @@ Polygons SkinInfillAreaComputation::generateFilledAreaBelow(SliceLayerPart& part { return {}; } - constexpr size_t min_wall_line_count = 2; const int lowest_flooring_layer = layer_nr_ - flooring_layer_count; Polygons filled_area_below = getOutlineOnLayer(part, lowest_flooring_layer); diff --git a/src/support.cpp b/src/support.cpp index 05e81fbf93..6e1f398e7a 100644 --- a/src/support.cpp +++ b/src/support.cpp @@ -186,7 +186,6 @@ void AreaSupport::generateGradualSupport(SliceDataStorage& storage) const coord_t gradual_support_step_height = infill_extruder.settings_.get("gradual_support_infill_step_height"); const size_t max_density_steps = infill_extruder.settings_.get("gradual_support_infill_steps"); - const coord_t wall_count = infill_extruder.settings_.get("support_wall_count"); const coord_t wall_width = infill_extruder.settings_.get("support_line_width"); // no early-out for this function; it needs to initialize the [infill_area_per_combine_per_density] @@ -458,7 +457,7 @@ void AreaSupport::cleanup(SliceDataStorage& storage) } } -Polygons AreaSupport::join(const SliceDataStorage& storage, const Polygons& supportLayer_up, Polygons& supportLayer_this, const coord_t smoothing_distance) +Polygons AreaSupport::join(const SliceDataStorage& storage, const Polygons& supportLayer_up, Polygons& supportLayer_this) { Polygons joined; @@ -811,7 +810,7 @@ void AreaSupport::generateOverhangAreasForMesh(SliceDataStorage& storage, SliceM }); } -Polygons AreaSupport::generateVaryingXYDisallowedArea(const SliceMeshStorage& storage, const Settings& infill_settings, const LayerIndex layer_idx) +Polygons AreaSupport::generateVaryingXYDisallowedArea(const SliceMeshStorage& storage, const LayerIndex layer_idx) { const auto& mesh_group_settings = Application::getInstance().current_slice_->scene.current_mesh_group->settings; const Simplify simplify{ mesh_group_settings }; @@ -820,7 +819,6 @@ Polygons AreaSupport::generateVaryingXYDisallowedArea(const SliceMeshStorage& st const auto support_distance_bot = static_cast(mesh_group_settings.get("support_bottom_distance")); const auto overhang_angle = mesh_group_settings.get("support_angle"); const auto xy_distance = static_cast(mesh_group_settings.get("support_xy_distance")); - const auto xy_distance_overhang = infill_settings.get("support_xy_distance_overhang"); constexpr coord_t snap_radius = 10; constexpr coord_t close_dist = snap_radius + 5; // needs to be larger than the snap radius! @@ -1065,8 +1063,6 @@ void AreaSupport::generateSupportAreasForMesh( const coord_t xy_distance_overhang = infill_settings.get("support_xy_distance_overhang"); const bool use_xy_distance_overhang = infill_settings.get("support_xy_overrides_z") == SupportDistPriority::Z_OVERRIDES_XY; // whether to use a different xy distance at overhangs - const AngleRadians angle = ((mesh.settings.get("support_roof_enable")) ? roof_settings : infill_settings).get("support_angle"); - const double tan_angle = tan(angle) - 0.01; // the XY-component of the supportAngle constexpr bool no_support = false; constexpr bool no_prime_tower = false; const coord_t support_line_width = mesh_group_settings.get("support_infill_extruder_nr").settings_.get("support_line_width"); @@ -1116,7 +1112,7 @@ void AreaSupport::generateSupportAreasForMesh( // layer below that protrudes beyond the current layer's area and combine it with the current layer's overhang disallowed area Polygons minimum_xy_disallowed_areas = xy_disallowed_per_layer[layer_idx].offset(xy_distance_overhang); - Polygons varying_xy_disallowed_areas = generateVaryingXYDisallowedArea(mesh, infill_settings, layer_idx); + Polygons varying_xy_disallowed_areas = generateVaryingXYDisallowedArea(mesh, layer_idx); xy_disallowed_per_layer[layer_idx] = minimum_xy_disallowed_areas.unionPolygons(varying_xy_disallowed_areas); scripta::log("support_xy_disallowed_areas", xy_disallowed_per_layer[layer_idx], SectionType::SUPPORT, layer_idx); } @@ -1139,26 +1135,6 @@ void AreaSupport::generateSupportAreasForMesh( const coord_t max_tower_supported_diameter = infill_settings.get("support_tower_maximum_supported_diameter"); const bool use_towers = infill_settings.get("support_use_towers") && max_tower_supported_diameter > 0; - coord_t smoothing_distance; - { // compute best smoothing_distance - const ExtruderTrain& infill_train = mesh_group_settings.get("support_infill_extruder_nr"); - const coord_t infill_line_width = infill_train.settings_.get("support_line_width"); - smoothing_distance = infill_line_width; - if (mesh.settings.get("support_roof_enable")) - { - const ExtruderTrain& roof_train = mesh_group_settings.get("support_roof_extruder_nr"); - const coord_t roof_line_width = roof_train.settings_.get("support_roof_line_width"); - smoothing_distance = std::max(smoothing_distance, roof_line_width); - } - - if (mesh.settings.get("support_bottom_enable")) - { - const ExtruderTrain& bottom_train = mesh_group_settings.get("support_bottom_extruder_nr"); - const coord_t bottom_line_width = bottom_train.settings_.get("support_bottom_line_width"); - smoothing_distance = std::max(smoothing_distance, bottom_line_width); - } - } - const coord_t z_distance_bottom = ((mesh.settings.get("support_bottom_enable")) ? bottom_settings : infill_settings).get("support_bottom_distance"); const size_t bottom_empty_layer_count = round_up_divide(z_distance_bottom, layer_thickness); // number of empty layers between support and model const coord_t bottom_stair_step_height = std::max(static_cast(0), mesh.settings.get("support_bottom_stair_step_height")); @@ -1234,7 +1210,7 @@ void AreaSupport::generateSupportAreasForMesh( layer_above = ∅ layer_this = layer_this.unionPolygons(storage.support.supportLayers[layer_idx].support_mesh); } - layer_this = AreaSupport::join(storage, *layer_above, layer_this, smoothing_distance).difference(model_mesh_on_layer); + layer_this = AreaSupport::join(storage, *layer_above, layer_this).difference(model_mesh_on_layer); } // make towers for small support @@ -1548,7 +1524,6 @@ std::pair AreaSupport::computeBasicAndFullOverhang(const Sli void AreaSupport::detectOverhangPoints(const SliceDataStorage& storage, SliceMeshStorage& mesh) { - const ExtruderTrain& infill_extruder = mesh.settings.get("support_infill_extruder_nr"); const coord_t max_tower_supported_diameter = mesh.settings.get("support_tower_maximum_supported_diameter"); const coord_t max_tower_supported_area = max_tower_supported_diameter * max_tower_supported_diameter; @@ -1652,8 +1627,6 @@ void AreaSupport::handleTowers( if (tower_roof.area() < tower_diameter * tower_diameter) { - constexpr bool no_support = false; - constexpr bool no_prime_tower = false; Polygons model_outline = xy_disallowed_area; // Rather than offsetting the tower with tower_roof_expansion_distance we do this step wise to achieve two things diff --git a/src/utils/Simplify.cpp b/src/utils/Simplify.cpp index cad210b30b..8d0795da54 100644 --- a/src/utils/Simplify.cpp +++ b/src/utils/Simplify.cpp @@ -83,7 +83,7 @@ size_t Simplify::previousNotDeleted(size_t index, const std::vector& to_de return index; } -Polygon Simplify::createEmpty(const Polygon& original) const +Polygon Simplify::createEmpty([[maybe_unused]] const Polygon& original) const { return Polygon(); } @@ -115,7 +115,7 @@ const Point2LL& Simplify::getPosition(const ExtrusionJunction& vertex) const return vertex.p_; } -Point2LL Simplify::createIntersection(const Point2LL& before, const Point2LL intersection, const Point2LL& after) const +Point2LL Simplify::createIntersection([[maybe_unused]] const Point2LL& before, const Point2LL intersection, [[maybe_unused]] const Point2LL& after) const { return intersection; } @@ -128,7 +128,7 @@ ExtrusionJunction Simplify::createIntersection(const ExtrusionJunction& before, return ExtrusionJunction(intersection, (before.w_ + after.w_) / 2, before.perimeter_index_); } -coord_t Simplify::getAreaDeviation(const Point2LL& before, const Point2LL& vertex, const Point2LL& after) const +coord_t Simplify::getAreaDeviation([[maybe_unused]] const Point2LL& before, [[maybe_unused]] const Point2LL& vertex, [[maybe_unused]] const Point2LL& after) const { return 0; // Fixed-width polygons don't have any deviation. }