Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2017-03-09 01:02:27 +0300
committerbubnikv <bubnikv@gmail.com>2017-03-09 01:02:27 +0300
commit50976e1b5a679d82ae1d164db228b4f36fdb4319 (patch)
treea8e4b578b73daf7d282888eed551827dc67435e2 /xs/src/libslic3r/PrintObject.cpp
parent720459183eaa4bc16a4bd5e950ca067cb0a9d8d5 (diff)
Parallelized slices_to_fill_surfaces_clipped()
Diffstat (limited to 'xs/src/libslic3r/PrintObject.cpp')
-rw-r--r--xs/src/libslic3r/PrintObject.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp
index 531edebe4..5ef59d60f 100644
--- a/xs/src/libslic3r/PrintObject.cpp
+++ b/xs/src/libslic3r/PrintObject.cpp
@@ -527,16 +527,20 @@ void PrintObject::detect_surfaces_type()
this->layers[idx_layer]->get_region(idx_region)->slices.surfaces = std::move(surfaces_new[idx_layer]);
}
- BOOST_LOG_TRIVIAL(debug) << "Detecting solid surfaces for region " << idx_region << " in parallel - end";
-
+ BOOST_LOG_TRIVIAL(debug) << "Detecting solid surfaces for region " << idx_region << " - clipping in parallel - start";
// Fill in layerm->fill_surfaces by trimming the layerm->slices by the cummulative layerm->fill_surfaces.
- for (int idx_layer = 0; idx_layer < int(this->layer_count()); ++ idx_layer) {
- LayerRegion *layerm = this->layers[idx_layer]->get_region(idx_region);
- layerm->slices_to_fill_surfaces_clipped();
+ tbb::parallel_for(
+ tbb::blocked_range<size_t>(0, this->layers.size()),
+ [this, idx_region, interface_shells, &surfaces_new](const tbb::blocked_range<size_t>& range) {
+ for (size_t idx_layer = range.begin(); idx_layer < range.end(); ++ idx_layer) {
+ LayerRegion *layerm = this->layers[idx_layer]->get_region(idx_region);
+ layerm->slices_to_fill_surfaces_clipped();
#ifdef SLIC3R_DEBUG_SLICE_PROCESSING
- layerm->export_region_fill_surfaces_to_svg_debug("1_detect_surfaces_type-final");
+ layerm->export_region_fill_surfaces_to_svg_debug("1_detect_surfaces_type-final");
#endif /* SLIC3R_DEBUG_SLICE_PROCESSING */
- } // for each layer of a region
+ } // for each layer of a region
+ });
+ BOOST_LOG_TRIVIAL(debug) << "Detecting solid surfaces for region " << idx_region << " - clipping in parallel - end";
} // for each $self->print->region_count
}