Log support through boost::log

This commit is contained in:
bubnikv 2016-11-24 13:44:51 +01:00
parent e67e37c772
commit 0d20a81354
5 changed files with 64 additions and 1 deletions

View file

@ -9,6 +9,7 @@
#include <cmath>
#include <cassert>
#include <memory>
#include <boost/log/trivial.hpp>
// #define SLIC3R_DEBUG
@ -197,6 +198,8 @@ struct MyLayersPtrCompare
void PrintObjectSupportMaterial::generate(PrintObject &object)
{
BOOST_LOG_TRIVIAL(info) << "Support generator - Start";
coordf_t max_object_layer_height = 0.;
for (size_t i = 0; i < object.layer_count(); ++ i)
max_object_layer_height = std::max(max_object_layer_height, object.get_layer(i)->height);
@ -210,6 +213,8 @@ void PrintObjectSupportMaterial::generate(PrintObject &object)
// The layers will be referenced by various LayersPtr (of type std::vector<Layer*>)
MyLayerStorage layer_storage;
BOOST_LOG_TRIVIAL(info) << "Support generator - Creating top contacts";
// Determine the top contact surfaces of the support, defined as:
// contact = overhangs - clearance + margin
// This method is responsible for identifying what contact surfaces
@ -232,6 +237,8 @@ void PrintObjectSupportMaterial::generate(PrintObject &object)
}
#endif /* SLIC3R_DEBUG */
BOOST_LOG_TRIVIAL(info) << "Support generator - Creating bottom contacts";
// Determine the bottom contact surfaces of the supports over the top surfaces of the object.
// Depending on whether the support is soluble or not, the contact layer thickness is decided.
MyLayersPtr bottom_contacts = this->bottom_contact_layers(object, top_contacts, layer_storage);
@ -245,11 +252,15 @@ void PrintObjectSupportMaterial::generate(PrintObject &object)
}
#endif /* SLIC3R_DEBUG */
BOOST_LOG_TRIVIAL(info) << "Support generator - Trimming top contacts by bottom contacts";
// Because the top and bottom contacts are thick slabs, they may overlap causing over extrusion
// and unwanted strong bonds to the object.
// Rather trim the top contacts by their overlapping bottom contacts to leave a gap instead of over extruding.
this->trim_top_contacts_by_bottom_contacts(object, bottom_contacts, top_contacts);
BOOST_LOG_TRIVIAL(info) << "Support generator - Creating intermediate layers - indices";
// Generate empty intermediate layers between the top / bottom support contact layers,
// The layers may or may not be synchronized with the object layers, depending on the configuration.
// For example, a single nozzle multi material printing will need to generate a waste tower, which in turn
@ -257,6 +268,8 @@ void PrintObjectSupportMaterial::generate(PrintObject &object)
MyLayersPtr intermediate_layers = this->raft_and_intermediate_support_layers(
object, bottom_contacts, top_contacts, layer_storage, max_object_layer_height);
BOOST_LOG_TRIVIAL(info) << "Support generator - Creating base layers";
// Fill in intermediate layers between the top / bottom support contact layers, trimmed by the object.
this->generate_base_layers(object, bottom_contacts, top_contacts, intermediate_layers);
@ -269,6 +282,8 @@ void PrintObjectSupportMaterial::generate(PrintObject &object)
}
#endif /* SLIC3R_DEBUG */
BOOST_LOG_TRIVIAL(info) << "Support generator - Creating raft";
// If raft is to be generated, the 1st top_contact layer will contain the 1st object layer silhouette without holes.
// Add the bottom contacts to the raft, inflate the support bases.
// There is a contact layer below the 1st object layer in the bottom contacts.
@ -284,6 +299,8 @@ void PrintObjectSupportMaterial::generate(PrintObject &object)
shape = this->generate_pillars_shape(contact, support_z);
*/
BOOST_LOG_TRIVIAL(info) << "Support generator - Creating interfaces";
// Propagate top / bottom contact layers to generate interface layers.
MyLayersPtr interface_layers = this->generate_interface_layers(
object, bottom_contacts, top_contacts, intermediate_layers, layer_storage);
@ -305,6 +322,8 @@ void PrintObjectSupportMaterial::generate(PrintObject &object)
}
*/
BOOST_LOG_TRIVIAL(info) << "Support generator - Creating layers";
// Install support layers into the object.
MyLayersPtr layers_sorted;
layers_sorted.reserve(bottom_contacts.size() + top_contacts.size() + intermediate_layers.size() + interface_layers.size());
@ -332,8 +351,12 @@ void PrintObjectSupportMaterial::generate(PrintObject &object)
++ layer_id;
}
BOOST_LOG_TRIVIAL(info) << "Support generator - Generating tool paths";
// Generate the actual toolpaths and save them into each layer.
this->generate_toolpaths(object, raft, bottom_contacts, top_contacts, intermediate_layers, interface_layers);
BOOST_LOG_TRIVIAL(info) << "Support generator - End";
}
void collect_region_slices_by_type(const Layer &layer, SurfaceType surface_type, Polygons &out)