mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-20 21:27:52 -06:00
Parallelized PrintObject::bridge_over_infill() (#2132)
Co-authored-by: Vojtech Bubnik <bubnikv@gmail.com>
This commit is contained in:
parent
bd13d83385
commit
685e058c35
3 changed files with 70 additions and 40 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue