mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-06 03:38:01 -05:00
Add multi-nozzle exclusion volume modes
This commit is contained in:
1 parent
e21bd886eb
commit
dbae415127
17 files changed
+578
-40
No files matched your search
@@ -3643,6 +3643,36 @@ bool ModelInstance::intersects_bed_exclude_region(const BedExcludeRegion ®ion
|
||||
return intersects;
|
||||
}
|
||||
|
||||
bool ModelInstance::intersects_bed_exclude_regions(
|
||||
const std::vector<BedExcludeRegion> ®ions,
|
||||
indexed_triangle_set *intersection_mesh) const
|
||||
{
|
||||
if (intersection_mesh != nullptr)
|
||||
intersection_mesh->clear();
|
||||
if (regions.empty())
|
||||
return false;
|
||||
|
||||
const Polygon hull = const_cast<ModelInstance *>(this)->convex_hull_2d();
|
||||
bool intersects = false;
|
||||
for (const BedExcludeRegion ®ion : regions) {
|
||||
if (intersection(Polygons{ region.polygon }, Polygons{ hull }).empty())
|
||||
continue;
|
||||
|
||||
if (intersection_mesh == nullptr) {
|
||||
if (intersects_bed_exclude_region(region))
|
||||
return true;
|
||||
continue;
|
||||
}
|
||||
|
||||
indexed_triangle_set region_intersection;
|
||||
if (intersects_bed_exclude_region(region, ®ion_intersection) && !region_intersection.empty()) {
|
||||
intersects = true;
|
||||
its_merge(*intersection_mesh, region_intersection);
|
||||
}
|
||||
}
|
||||
return intersects;
|
||||
}
|
||||
|
||||
//BBS: invalidate instance's convex_hull_2d
|
||||
void ModelInstance::invalidate_convex_hull_2d()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user