Fix omitted assembly parts with height ranges (#15499)

This commit is contained in:
Kiss Lorand
2026-09-02 18:15:18 -03:00
committed by GitHub
parent b81c0e30c1
commit 51fd6327fe
2 changed files with 15 additions and 6 deletions
+10 -3
View File
@@ -304,11 +304,16 @@ static std::vector<std::vector<ExPolygons>> slices_to_regions(
float z = zs[z_idx];
int idx_first_printable_region = -1;
bool complex = false;
std::vector<int> printable_region_ids;
for (int idx_region = 0; idx_region < int(layer_range.volume_regions.size()); ++ idx_region) {
const PrintObjectRegions::VolumeRegion &region = layer_range.volume_regions[idx_region];
if (region.bbox->min().z() <= z && region.bbox->max().z() >= z) {
if (idx_first_printable_region == -1 && region.model_volume->is_model_part())
if (region.model_volume->is_model_part())
printable_region_ids.push_back(idx_region);
if (idx_first_printable_region == -1 && region.model_volume->is_model_part()) {
idx_first_printable_region = idx_region;
}
else if (idx_first_printable_region != -1) {
// Test for overlap with some other region.
for (int idx_region2 = idx_first_printable_region; idx_region2 < idx_region; ++ idx_region2) {
@@ -324,8 +329,10 @@ static std::vector<std::vector<ExPolygons>> slices_to_regions(
if (complex)
zs_complex.push_back({ z_idx, z });
else if (idx_first_printable_region >= 0) {
const PrintObjectRegions::VolumeRegion &region = layer_range.volume_regions[idx_first_printable_region];
slices_by_region[region.region->print_object_region_id()][z_idx] = std::move(volume_slices_find_by_id(volume_slices, region.model_volume->id()).slices[z_idx]);
for (int printable_region_id : printable_region_ids) {
const PrintObjectRegions::VolumeRegion &region = layer_range.volume_regions[printable_region_id];
append(slices_by_region[region.region->print_object_region_id()][z_idx], std::move(volume_slices_find_by_id(volume_slices, region.model_volume->id()).slices[z_idx]));
}
}
}
}