From 7fe9a56ef835bbf372da885de4f24cf376097d66 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Wed, 23 May 2018 11:02:07 +0200 Subject: [PATCH] Added some comments and sequential version of png slice export. --- xs/src/libslic3r/Print.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/xs/src/libslic3r/Print.cpp b/xs/src/libslic3r/Print.cpp index ef38df35e0..c9c1c7c0c6 100644 --- a/xs/src/libslic3r/Print.cpp +++ b/xs/src/libslic3r/Print.cpp @@ -1301,8 +1301,10 @@ public: void saveLayer(unsigned lyr, const std::string& path); }; -template<> // Implementation for PNG raster output -class FilePrinter { +// Implementation for PNG raster output +// Be aware that if a large number of layers are allocated, it can wery well +// exhaust the available memory. +template<> class FilePrinter { struct Layer { Raster first; @@ -1498,8 +1500,8 @@ void Print::print_to(std::string dirpath, } printer.finishLayer(layer_id); // Finish the layer for later saving it. - // printer.saveLayer(layer_id, dir); We could save the layer immediately + // printer.saveLayer(layer_id, dir); We could save the layer immediately }; // Print all the layers in parallel @@ -1507,6 +1509,9 @@ void Print::print_to(std::string dirpath, layers.size(), process_layer); + // Sequential version (for testing) + // for(unsigned l = 0; l < layers.size(); ++l) process_layer(l); + // Save the print into the file system. printer.save(dir); }