4
4
#pragma once
5
5
6
6
#include < settings/EnumSettings.h>
7
+ #include < utils/ExtrudersSet.h>
7
8
8
9
#include " ExtruderNumber.h"
9
10
#include " operation_transformation/PrintOperationTransformer.h"
@@ -27,41 +28,6 @@ class SkirtBrimAppender : public PrintOperationTransformer<PrintPlan>
27
28
void process (PrintPlan* print_plan) override ;
28
29
29
30
private:
30
- /* !
31
- * A helper class to store an offset yet to be performed on either an outline polygon, or based on an earlier generated brim line.
32
- */
33
- struct Offset
34
- {
35
- Offset (
36
- const std::variant<const Shape*, int >& reference_outline_or_index,
37
- const bool outside,
38
- const bool inside,
39
- const coord_t offset_value,
40
- const coord_t total_offset,
41
- const size_t inset_idx,
42
- const size_t extruder_nr,
43
- const bool is_last)
44
- : reference_outline_or_index_(reference_outline_or_index)
45
- , outside_(outside)
46
- , inside_(inside)
47
- , offset_value_(offset_value)
48
- , total_offset_(total_offset)
49
- , inset_idx_(inset_idx)
50
- , extruder_nr_(extruder_nr)
51
- , is_last_(is_last)
52
- {
53
- }
54
-
55
- std::variant<const Shape*, int > reference_outline_or_index_;
56
- bool outside_; // !< Wether to offset outward from the reference polygons
57
- bool inside_; // !< Wether to offset inward from the reference polygons
58
- coord_t offset_value_; // !< Distance by which to offset from the reference
59
- coord_t total_offset_; // !< Total distance from the model
60
- int inset_idx_; // !< The outset index of this brimline
61
- ExtruderNumber extruder_nr_; // !< The extruder by which to print this brim line
62
- bool is_last_; // !< Whether this is the last planned offset for this extruder.
63
- };
64
-
65
31
/* !
66
32
* Container to store the pre-extracted settings of an extruder
67
33
*/
@@ -74,63 +40,49 @@ class SkirtBrimAppender : public PrintOperationTransformer<PrintPlan>
74
40
int line_count_; // !< The (minimal) number of brim lines to generate
75
41
coord_t gap_; // !< The gap between the part and the first brim/skirt line
76
42
coord_t brim_inside_margin_;
43
+ size_t skirt_height_;
77
44
};
78
45
79
46
static constexpr coord_t min_brim_line_length_ = 3000u ; // !< open polyline brim lines smaller than this will be removed
80
- std::map<ExtruderNumber, ExtruderConfig> extruders_configs_;
81
47
const SliceDataStorage& storage_;
82
48
83
49
private:
84
- static bool sortOffsets (const Offset& a, const Offset& b)
85
- {
86
- // Use extruder_nr in case both extruders have the same offset settings.
87
- return a. total_offset_ != b. total_offset_ ? a. total_offset_ < b. total_offset_ : a. extruder_nr_ < b. extruder_nr_ ;
88
- } ;
50
+ static std::tuple<std::vector<ConstExtruderPlanPtr>, ExtrudersSet> generateUsedExtruders (const PrintPlan* print_plan);
51
+
52
+ static size_t calculateMaxHeight ( const std::map<ExtruderNumber, ExtruderConfig>& extruders_configs, const EPlatformAdhesion adhesion_type);
53
+
54
+ static std::map<ExtruderNumber, ExtruderConfig> generateExtrudersConfigs ( const ExtrudersSet& used_extruders, const EPlatformAdhesion adhesion_type) ;
89
55
90
- static std::map<ExtruderNumber, Shape> generateStartingOutlines (const PrintPlan* print_plan,
56
+ static std::map<ExtruderNumber, Shape> generateStartingOutlines (
57
+ const PrintPlan* print_plan,
91
58
const std::optional<ExtruderNumber> skirt_brim_extruder_nr,
92
59
const size_t height,
93
60
const EPlatformAdhesion adhesion_type,
94
61
const ExtrudersSet& used_extruders);
95
62
96
- std::vector<Offset> generateBrimOffsetPlan (const std::optional<ExtruderNumber> skirt_brim_extruder_nr,
97
- const EPlatformAdhesion adhesion_type,
63
+ std::map<ExtruderNumber, Shape> generateAllowedAreas (
98
64
const std::map<ExtruderNumber, Shape>& starting_outlines,
99
- const ExtrudersSet &used_extruders) const ;
100
-
101
- std::map<ExtruderNumber, Shape> generateAllowedAreas (const std::map<ExtruderNumber, Shape>& starting_outlines,
102
65
const EPlatformAdhesion adhesion_type,
103
- const ExtrudersSet & used_extruders,
66
+ const ExtrudersSet& used_extruders,
104
67
const std::optional<ExtruderNumber> skirt_brim_extruder_nr,
105
- const SliceDataStorage& storage ) const ;
68
+ const std::map<ExtruderNumber, ExtruderConfig>& extruders_configs ) const ;
106
69
107
- void generateSkirtBrim (const SliceDataStorage& storage,
70
+ static void generateSkirtBrim (
108
71
const EPlatformAdhesion adhesion_type,
109
- const std::map<ExtruderNumber, Shape>& starting_outlines,
110
- std::vector<Offset>& offset_plan,
111
- std::map<ExtruderNumber, Shape>& allowed_areas_per_extruder,
112
- PrintPlan* print_plan) const ;
113
-
114
- void generateSkirtBrimV2 (const SliceDataStorage& storage,
115
- const EPlatformAdhesion adhesion_type,
116
- const ExtrudersSet &used_extruders,
72
+ const ExtrudersSet& used_extruders,
117
73
const std::vector<ConstExtruderPlanPtr> first_extruder_plans,
118
- const std::map<ExtruderNumber,
119
- Shape>& starting_outlines,
120
- std::map<ExtruderNumber, Shape>& allowed_areas_per_extruder,
121
- PrintPlan* print_plan) const ;
122
-
123
- FeatureExtrusionPtr generateOffset (const Offset& offset,
124
74
const std::map<ExtruderNumber, Shape>& starting_outlines,
125
- Shape& covered_area,
126
75
std::map<ExtruderNumber, Shape>& allowed_areas_per_extruder,
127
- const LayerPlanPtr &layer_plan) const ;
76
+ const std::map<ExtruderNumber, ExtruderConfig>& extruders_configs,
77
+ PrintPlan* print_plan);
128
78
129
- FeatureExtrusionPtr generateOffsetV2 (const ExtruderNumber extruder_nr,
79
+ static FeatureExtrusionPtr generateOffset (
80
+ const ExtruderNumber extruder_nr,
130
81
const coord_t total_offset,
131
82
Shape& covered_area,
132
83
std::map<ExtruderNumber, Shape>& allowed_areas_per_extruder,
133
- const LayerPlanPtr &layer_plan) const ;
84
+ const std::map<ExtruderNumber, ExtruderConfig>& extruders_configs,
85
+ const LayerPlanPtr& layer_plan);
134
86
};
135
87
136
88
} // namespace cura
0 commit comments