mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-11 19:17:33 +00:00
Fix omitted assembly parts with height ranges (#15499)
This commit is contained in:
@@ -560,9 +560,11 @@ static inline bool model_volume_solid_or_modifier(const ModelVolume &mv)
|
|||||||
|
|
||||||
static inline Transform3f trafo_for_bbox(const Transform3d &object_trafo, const Transform3d &volume_trafo)
|
static inline Transform3f trafo_for_bbox(const Transform3d &object_trafo, const Transform3d &volume_trafo)
|
||||||
{
|
{
|
||||||
Transform3d m = object_trafo * volume_trafo;
|
// Orca: Keep the volume's local XY offset for multipart overlap checks, but remove the object's bed placement.
|
||||||
m.translation().x() = 0.;
|
Transform3d object_trafo_local = object_trafo;
|
||||||
m.translation().y() = 0.;
|
object_trafo_local.translation().x() = 0.;
|
||||||
|
object_trafo_local.translation().y() = 0.;
|
||||||
|
Transform3d m = object_trafo_local * volume_trafo;
|
||||||
return m.cast<float>();
|
return m.cast<float>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -304,11 +304,16 @@ static std::vector<std::vector<ExPolygons>> slices_to_regions(
|
|||||||
float z = zs[z_idx];
|
float z = zs[z_idx];
|
||||||
int idx_first_printable_region = -1;
|
int idx_first_printable_region = -1;
|
||||||
bool complex = false;
|
bool complex = false;
|
||||||
|
std::vector<int> printable_region_ids;
|
||||||
for (int idx_region = 0; idx_region < int(layer_range.volume_regions.size()); ++ idx_region) {
|
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];
|
const PrintObjectRegions::VolumeRegion ®ion = layer_range.volume_regions[idx_region];
|
||||||
if (region.bbox->min().z() <= z && region.bbox->max().z() >= z) {
|
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;
|
idx_first_printable_region = idx_region;
|
||||||
|
}
|
||||||
else if (idx_first_printable_region != -1) {
|
else if (idx_first_printable_region != -1) {
|
||||||
// Test for overlap with some other region.
|
// Test for overlap with some other region.
|
||||||
for (int idx_region2 = idx_first_printable_region; idx_region2 < idx_region; ++ idx_region2) {
|
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)
|
if (complex)
|
||||||
zs_complex.push_back({ z_idx, z });
|
zs_complex.push_back({ z_idx, z });
|
||||||
else if (idx_first_printable_region >= 0) {
|
else if (idx_first_printable_region >= 0) {
|
||||||
const PrintObjectRegions::VolumeRegion ®ion = layer_range.volume_regions[idx_first_printable_region];
|
for (int printable_region_id : printable_region_ids) {
|
||||||
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]);
|
const PrintObjectRegions::VolumeRegion ®ion = 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]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user