mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-23 10:52:15 +00:00
fix assembly bounding box truncation problems noticed by hotcubcar (#28)
This commit is contained in:
@@ -322,20 +322,31 @@ static std::vector<std::vector<ExPolygons>> slices_to_regions(
|
||||
}
|
||||
} else {
|
||||
zs_complex.reserve(zs.size());
|
||||
// region.bbox is computed in pre-belt-shear slicer space (see PrintApply.cpp::trafo_for_bbox).
|
||||
// When belt transforms are active, layer Z values are in post-shear/scale/remap space,
|
||||
// so the Z components of region.bbox aren't comparable to z. Skipping the Z filter here
|
||||
// pushes those layers into the parallel_for path below, which handles multi-volume
|
||||
// clipping per layer without relying on the bbox Z range.
|
||||
const bool bbox_z_in_layer_frame = !(print_config.belt_printer.value &&
|
||||
(BeltTransformPipeline::has_shear(print_config)
|
||||
|| BeltTransformPipeline::has_scale(print_config)
|
||||
|| BeltTransformPipeline::has_preslice_remap(print_config)));
|
||||
for (; z_idx < zs.size() && zs[z_idx] < layer_range.layer_height_range.second; ++ z_idx) {
|
||||
float z = zs[z_idx];
|
||||
int idx_first_printable_region = -1;
|
||||
bool complex = false;
|
||||
for (int idx_region = 0; idx_region < int(layer_range.volume_regions.size()); ++ idx_region) {
|
||||
const PrintObjectRegions::VolumeRegion ®ion = layer_range.volume_regions[idx_region];
|
||||
if (region.bbox->min().z() <= z && region.bbox->max().z() >= z) {
|
||||
if (!bbox_z_in_layer_frame || (region.bbox->min().z() <= z && region.bbox->max().z() >= z)) {
|
||||
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) {
|
||||
const PrintObjectRegions::VolumeRegion ®ion2 = layer_range.volume_regions[idx_region2];
|
||||
if (region2.bbox->min().z() <= z && region2.bbox->max().z() >= z && overlap_in_xy(*region.bbox, *region2.bbox)) {
|
||||
const bool region2_in_z = !bbox_z_in_layer_frame
|
||||
|| (region2.bbox->min().z() <= z && region2.bbox->max().z() >= z);
|
||||
if (region2_in_z && overlap_in_xy(*region.bbox, *region2.bbox)) {
|
||||
complex = true;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user