mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 21:05:56 +08:00
Fix of Print::apply() creating hierarchy of regions for complex scenarios:
Unnecessary regions were created for a modifier over a volume or a modifier, where the modifier did not modify any of its parent's properties. This lead to an explosion of regions for this particular 3MF. Fixes Non Responsive & Memory Leak when opening or changing this 3MF project #7220
This commit is contained in:
parent
ca677fa1da
commit
a0ee41770d
@ -857,11 +857,10 @@ static PrintObjectRegions* generate_print_object_regions(
|
|||||||
const PrintObjectRegions::BoundingBox *parent_bbox = find_volume_extents(layer_range, *parent_region.model_volume);
|
const PrintObjectRegions::BoundingBox *parent_bbox = find_volume_extents(layer_range, *parent_region.model_volume);
|
||||||
assert(parent_bbox != nullptr);
|
assert(parent_bbox != nullptr);
|
||||||
if (parent_bbox->intersects(*bbox))
|
if (parent_bbox->intersects(*bbox))
|
||||||
layer_range.volume_regions.push_back({
|
// Only create new region for a modifier, which actually modifies config of it's parent.
|
||||||
&volume, parent_region_id,
|
if (PrintRegionConfig config = region_config_from_model_volume(parent_region.region->config(), nullptr, volume, num_extruders);
|
||||||
get_create_region(region_config_from_model_volume(parent_region.region->config(), nullptr, volume, num_extruders)),
|
config != parent_region.region->config())
|
||||||
bbox
|
layer_range.volume_regions.push_back({ &volume, parent_region_id, get_create_region(std::move(config)), bbox });
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user