Skip to content

Commit

Permalink
ENH: optimize the performance of slicing
Browse files Browse the repository at this point in the history
Signed-off-by: yifan.wu <[email protected]>
Change-Id: Ic769fabf641eb07eaf5cb55bf308a49831998470
  • Loading branch information
YifanWuBambu authored and lanewei120 committed Dec 15, 2022
1 parent d641f94 commit 9e89a1e
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/libslic3r/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1404,15 +1404,21 @@ void Print::process()
obj->set_done(posIroning);
}
}
for (PrintObject *obj : m_objects) {
if (need_slicing_objects.count(obj) != 0) {
obj->generate_support_material();
}
else {
if (obj->set_started(posSupportMaterial))
obj->set_done(posSupportMaterial);

tbb::parallel_for(tbb::blocked_range<int>(0, int(m_objects.size())),
[this, need_slicing_objects](const tbb::blocked_range<int>& range) {
for (int i = range.begin(); i < range.end(); i++) {
PrintObject* obj = m_objects[i];
if (need_slicing_objects.count(obj) != 0) {
obj->generate_support_material();
}
else {
if (obj->set_started(posSupportMaterial))
obj->set_done(posSupportMaterial);
}
}
}
}
);

for (PrintObject *obj : m_objects)
{
Expand Down

0 comments on commit 9e89a1e

Please sign in to comment.