fixed an issue that zaa_enabled is redefined in both object and region. move all zaa config to region to keep it consistent

This commit is contained in:
SoftFever
2026-05-01 19:47:00 +08:00
parent 066243afe2
commit 20c3c833df
5 changed files with 28 additions and 17 deletions

View File

@@ -35,8 +35,18 @@ LayerPtrs new_layers(
coordf_t lo = object_layers[i_layer];
coordf_t hi = object_layers[i_layer + 1];
coordf_t slice_z = 0.5 * (lo + hi);
if (print_object->config().zaa_enabled) {
coordf_t z_offset = print_object->config().zaa_min_z;
bool zaa_active = false;
coordf_t z_offset = 0.0;
size_t num_regions = print_object->num_printing_regions();
for (size_t rid = 0; rid < num_regions; ++rid) {
const auto &rcfg = print_object->printing_region(rid).config();
if (rcfg.zaa_enabled) {
if (!zaa_active || rcfg.zaa_min_z < z_offset)
z_offset = rcfg.zaa_min_z;
zaa_active = true;
}
}
if (zaa_active) {
slice_z = lo + z_offset;
if (slice_z < lo || slice_z > hi) {
throw RuntimeError("Bad min Z value");