mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
Parallelized PrintObject::bridge_over_infill() (#2132)
Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com>
This commit is contained in:
@@ -65,7 +65,7 @@ SurfacesPtr SurfaceCollection::filter_by_types(const SurfaceType *types, int nty
|
||||
return ss;
|
||||
}
|
||||
|
||||
void SurfaceCollection::filter_by_type(SurfaceType type, Polygons* polygons)
|
||||
void SurfaceCollection::filter_by_type(SurfaceType type, Polygons* polygons) const
|
||||
{
|
||||
for (const Surface &surface : this->surfaces)
|
||||
if (surface.surface_type == type)
|
||||
@@ -121,6 +121,22 @@ void SurfaceCollection::remove_type(const SurfaceType type)
|
||||
surfaces.erase(surfaces.begin() + j, surfaces.end());
|
||||
}
|
||||
|
||||
void SurfaceCollection::remove_type(const SurfaceType type, ExPolygons *polygons)
|
||||
{
|
||||
size_t j = 0;
|
||||
for (size_t i = 0; i < surfaces.size(); ++ i) {
|
||||
if (Surface &surface = surfaces[i]; surface.surface_type == type) {
|
||||
polygons->emplace_back(std::move(surface.expolygon));
|
||||
} else {
|
||||
if (j < i)
|
||||
std::swap(surfaces[i], surfaces[j]);
|
||||
++ j;
|
||||
}
|
||||
}
|
||||
if (j < surfaces.size())
|
||||
surfaces.erase(surfaces.begin() + j, surfaces.end());
|
||||
}
|
||||
|
||||
void SurfaceCollection::remove_types(const SurfaceType *types, int ntypes)
|
||||
{
|
||||
size_t j = 0;
|
||||
|
||||
Reference in New Issue
Block a user