77{
80
81
82
83
84
85
86 coordf_t support_material_extruder_dmr = print_config.nozzle_diameter.get_at(object_config.support_filament.value - 1);
87 coordf_t support_material_interface_extruder_dmr = print_config.nozzle_diameter.get_at(object_config.support_interface_filament.value - 1);
88
89
90 const coordf_t support_top_z_gap = object_config.support_top_z_distance.value;
91 const coordf_t support_bottom_z_gap = object_config.support_bottom_z_distance.value;
92 const coordf_t raft_z_gap = object_config.raft_contact_distance.value;
93
94
95
96
97
98
99 const bool zero_topZ_contact =
100 support_top_z_gap == 0.0;
101
103 object_config.support_interface_top_layers.value > 0 &&
104 zero_topZ_contact;
105
107 (object_config.support_interface_bottom_layers.value < 0
108 ? object_config.support_interface_top_layers.value
109 : object_config.support_interface_bottom_layers.value) > 0 &&
110 (support_bottom_z_gap == 0.0 || zero_topZ_contact);
111
113 raft_z_gap == 0.0 || zero_topZ_contact;
114
116
117 params.layer_height = object_config.layer_height.value;
120 params.object_print_z_min = 0.0;
121
122 params.object_print_z_max = object_height * object_shrinkage_compensation.z();
123 params.object_print_z_uncompensated_max = object_height;
124 params.object_shrinkage_compensation_z = object_shrinkage_compensation.z();
125 params.base_raft_layers = object_config.raft_layers.value;
129
130
132 params.max_layer_height = std::numeric_limits<double>::max();
133 if (object_config.enable_support.value || params.base_raft_layers > 0 || object_config.enforce_support_layers > 0) {
134
135 params.min_layer_height = std::max(
138 params.max_layer_height = std::min(
141 params.max_suport_layer_height = params.max_layer_height;
142 }
143
144 if (object_extruders.empty()) {
147 } else {
148 for (unsigned int extruder_id : object_extruders) {
151 }
152 }
153
154 params.min_layer_height = std::min(params.min_layer_height, params.layer_height);
155 params.max_layer_height = std::max(params.max_layer_height, params.layer_height);
156
157
158
159
160
161
163 params.gap_raft_object = 0.0;
164 } else {
165 params.gap_raft_object = raft_z_gap;
166 if (!print_config.independent_support_layer_height) {
167 params.gap_raft_object =
168 std::round(params.gap_raft_object / object_config.layer_height +
EPSILON)
169 * object_config.layer_height;
170 }
171 }
172
173
175 params.gap_object_support = 0.0;
176 } else {
177 params.gap_object_support = support_bottom_z_gap;
178
179 if (!print_config.independent_support_layer_height) {
180 params.gap_object_support =
181 std::round(params.gap_object_support / object_config.layer_height +
EPSILON)
182 * object_config.layer_height;
183 }
184 }
185
186
188 params.gap_support_object = 0.0;
189 } else {
190 params.gap_support_object = support_top_z_gap;
191
192 if (!print_config.independent_support_layer_height) {
193 params.gap_support_object =
194 std::round(params.gap_support_object / object_config.layer_height +
EPSILON)
195 * object_config.layer_height;
196 }
197 }
198
199
200
201
202
203 if (params.base_raft_layers > 0) {
204 params.interface_raft_layers = (params.base_raft_layers + 1) / 2;
205 params.base_raft_layers -= params.interface_raft_layers;
206
207 params.base_raft_layer_height = std::max(params.layer_height, 0.75 * support_material_extruder_dmr);
208 params.interface_raft_layer_height = std::max(params.layer_height, 0.75 * support_material_interface_extruder_dmr);
209 params.first_object_layer_bridging = false;
210 params.contact_raft_layer_height = std::max(params.layer_height, 0.75 * support_material_interface_extruder_dmr);
211 params.first_object_layer_height = params.layer_height;
212 }
213
214 if (params.has_raft()) {
215
216
217 if (params.raft_layers() == 1) {
218
221 } else {
222 assert(params.base_raft_layers > 0);
223 assert(params.interface_raft_layers > 0);
224
226
227 params.raft_interface_top_z = params.raft_base_top_z +
coordf_t(params.interface_raft_layers - 1) * params.interface_raft_layer_height;
228 params.raft_contact_top_z = params.raft_interface_top_z + params.contact_raft_layer_height;
229 }
230
231 coordf_t print_z = params.raft_contact_top_z + params.gap_raft_object;
232 params.object_print_z_min = print_z;
233 params.object_print_z_max += print_z;
234 params.object_print_z_uncompensated_max += print_z;
235 }
236
237 params.valid = true;
238 return params;
239}
#define EPSILON
Definition ColorUtils.cpp:64
double coordf_t
Definition GUI_ObjectList.hpp:46
coordf_t max_layer_height_from_nozzle(const PrintConfig &print_config, int idx_nozzle)
Definition Slicing.cpp:46
zaa_minimize_perimeter_height initial_layer_print_height((ConfigOptionFloatsNullable, initial_layer_speed))((ConfigOptionFloatsNullable
coordf_t min_layer_height_from_nozzle(const PrintConfig &print_config, int idx_nozzle)
Definition Slicing.cpp:38
static const coordf_t MIN_LAYER_HEIGHT
Definition Slicing.cpp:33
bool zero_gap_interface_top
Definition Slicing.hpp:90
bool zero_gap_interface_raft
Definition Slicing.hpp:92
bool zero_gap_interface_bottom
Definition Slicing.hpp:91
SlicingParameters()=default