Skip to content

Commit 8bbc2ad

Browse files
committed
Factorize code and make it more readable
CURA-12250
1 parent 7fa83d6 commit 8bbc2ad

File tree

3 files changed

+171
-220
lines changed

3 files changed

+171
-220
lines changed

include/feature_generation/MeshInfillGenerator.h

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
#pragma once
55

66
#include <utils/Coord_t.h>
7+
#include <utils/ExtrusionLine.h>
78

89
#include "feature_generation/MeshFeatureGenerator.h"
910

1011
namespace cura
1112
{
1213

14+
enum class EFillMethod;
15+
class Settings;
1316
class LightningGenerator;
1417
class Shape;
1518

@@ -28,30 +31,32 @@ class MeshInfillGenerator : public MeshFeatureGenerator
2831

2932
private:
3033
/*!
31-
* \brief Add thicker (multiple layers) sparse infill for a given part in a
32-
* layer plan.
33-
*
34-
* \param gcodeLayer The initial planning of the gcode of the layer.
35-
* \param mesh The mesh for which to add to the layer plan \p gcodeLayer.
36-
* \param extruder_nr The extruder for which to print all features of the
37-
* mesh which should be printed with this extruder.
38-
* \param mesh_config The line config with which to print a print feature.
39-
* \param part The part for which to create gcode.
40-
* \return Whether this function added anything to the layer plan.
34+
* \brief Add thicker (multiple layers) sparse infill for a given part in a layer plan.
4135
*/
42-
void processMultiLayerInfill(const LayerPlanPtr& layer_plan, const ExtruderPlanPtr& extruder_plan, const SliceLayerPart& part) const;
36+
void processMultiLayerInfill(
37+
const SliceLayerPart& part,
38+
const Settings& settings,
39+
const LayerPlanPtr& layer_plan,
40+
const size_t last_idx,
41+
const EFillMethod infill_pattern,
42+
const coord_t infill_line_width,
43+
const coord_t infill_overlap,
44+
const bool zig_zaggify_infill,
45+
const auto generate_infill,
46+
std::vector<std::vector<VariableWidthLines>>& wall_tool_paths,
47+
OpenLinesSet& infill_lines,
48+
Shape& infill_polygons) const;
4349

4450
/*!
4551
* \brief Add normal sparse infill for a given part in a layer.
46-
* \param gcodeLayer The initial planning of the gcode of the layer.
47-
* \param mesh The mesh for which to add to the layer plan \p gcodeLayer.
48-
* \param extruder_nr The extruder for which to print all features of the
49-
* mesh which should be printed with this extruder
50-
* \param mesh_config The line config with which to print a print feature.
51-
* \param part The part for which to create gcode.
52-
* \return Whether this function added anything to the layer plan.
5352
*/
54-
void processSingleLayerInfill(const SliceDataStorage& storage, const LayerPlanPtr& layer_plan, const ExtruderPlanPtr& extruder_plan, const SliceLayerPart& part) const;
53+
void processSingleLayerInfill(
54+
const SliceLayerPart& part,
55+
const size_t last_idx,
56+
const EFillMethod infill_pattern,
57+
const size_t combine_idx,
58+
const coord_t infill_overlap,
59+
const auto generate_infill) const;
5560

5661
bool partitionInfillBySkinAbove(Shape& infill_below_skin, Shape& infill_not_below_skin, const LayerPlanPtr& layer_plan, const SliceLayerPart& part, coord_t infill_line_width)
5762
const;

include/infill.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Infill
7676
EFillMethod pattern,
7777
bool zig_zaggify,
7878
bool connect_polygons,
79-
Shape in_outline,
79+
const Shape& in_outline,
8080
coord_t infill_line_width,
8181
coord_t line_distance,
8282
coord_t infill_overlap,

0 commit comments

Comments
 (0)