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-08 15:43:49 +0300
committerbubnikv <bubnikv@gmail.com>2017-03-08 15:43:49 +0300
commit52b76930aae8aab64251ce533c028223402f352e (patch)
tree95f0322d55f70e1d62c90da707634363188ea190 /xs/src/libslic3r/PrintObject.cpp
parent4331f38912cfc31f0558196502bf28cb6a8d0cec (diff)
Simplify_slices rewritten to C++, parallelized.
Added some move methods to Surface class.
Diffstat (limited to 'xs/src/libslic3r/PrintObject.cpp')
-rw-r--r--xs/src/libslic3r/PrintObject.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp
index 20bcdf5ca..31993dfc9 100644
--- a/xs/src/libslic3r/PrintObject.cpp
+++ b/xs/src/libslic3r/PrintObject.cpp
@@ -1121,7 +1121,7 @@ void PrintObject::_slice()
}
}
- // remove last layer(s) if empty
+ BOOST_LOG_TRIVIAL(debug) << "Slicing objects - removing top empty layers";
while (! this->layers.empty()) {
const Layer *layer = this->layers.back();
for (size_t region_id = 0; region_id < this->print()->regions.size(); ++ region_id)
@@ -1284,6 +1284,25 @@ std::string PrintObject::_fix_slicing_errors()
"however you might want to check the results or repair the input file and retry.\n";
}
+// Simplify the sliced model, if "resolution" configuration parameter > 0.
+// The simplification is problematic, because it simplifies the slices independent from each other,
+// which makes the simplified discretization visible on the object surface.
+void PrintObject::_simplify_slices(double distance)
+{
+ BOOST_LOG_TRIVIAL(debug) << "Slicing objects - siplifying slices in parallel - begin";
+ tbb::parallel_for(
+ tbb::blocked_range<size_t>(0, this->layers.size()),
+ [this, distance](const tbb::blocked_range<size_t>& range) {
+ for (size_t layer_idx = range.begin(); layer_idx < range.end(); ++ layer_idx) {
+ Layer *layer = this->layers[layer_idx];
+ for (size_t region_idx = 0; region_idx < layer->regions.size(); ++ region_idx)
+ layer->regions[region_idx]->slices.simplify(distance);
+ layer->slices.simplify(distance);
+ }
+ });
+ BOOST_LOG_TRIVIAL(debug) << "Slicing objects - siplifying slices in parallel - end";
+}
+
void
PrintObject::_make_perimeters()
{