|
@@ -9,6 +9,7 @@
|
|
#include <cmath>
|
|
#include <cmath>
|
|
#include <cassert>
|
|
#include <cassert>
|
|
#include <memory>
|
|
#include <memory>
|
|
|
|
+#include <boost/log/trivial.hpp>
|
|
|
|
|
|
// #define SLIC3R_DEBUG
|
|
// #define SLIC3R_DEBUG
|
|
|
|
|
|
@@ -197,6 +198,8 @@ struct MyLayersPtrCompare
|
|
|
|
|
|
void PrintObjectSupportMaterial::generate(PrintObject &object)
|
|
void PrintObjectSupportMaterial::generate(PrintObject &object)
|
|
{
|
|
{
|
|
|
|
+ BOOST_LOG_TRIVIAL(info) << "Support generator - Start";
|
|
|
|
+
|
|
coordf_t max_object_layer_height = 0.;
|
|
coordf_t max_object_layer_height = 0.;
|
|
for (size_t i = 0; i < object.layer_count(); ++ i)
|
|
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);
|
|
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*>)
|
|
// The layers will be referenced by various LayersPtr (of type std::vector<Layer*>)
|
|
MyLayerStorage layer_storage;
|
|
MyLayerStorage layer_storage;
|
|
|
|
|
|
|
|
+ BOOST_LOG_TRIVIAL(info) << "Support generator - Creating top contacts";
|
|
|
|
+
|
|
// Determine the top contact surfaces of the support, defined as:
|
|
// Determine the top contact surfaces of the support, defined as:
|
|
// contact = overhangs - clearance + margin
|
|
// contact = overhangs - clearance + margin
|
|
// This method is responsible for identifying what contact surfaces
|
|
// This method is responsible for identifying what contact surfaces
|
|
@@ -232,6 +237,8 @@ void PrintObjectSupportMaterial::generate(PrintObject &object)
|
|
}
|
|
}
|
|
#endif /* SLIC3R_DEBUG */
|
|
#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.
|
|
// 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.
|
|
// 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);
|
|
MyLayersPtr bottom_contacts = this->bottom_contact_layers(object, top_contacts, layer_storage);
|
|
@@ -245,11 +252,15 @@ void PrintObjectSupportMaterial::generate(PrintObject &object)
|
|
}
|
|
}
|
|
#endif /* SLIC3R_DEBUG */
|
|
#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
|
|
// Because the top and bottom contacts are thick slabs, they may overlap causing over extrusion
|
|
// and unwanted strong bonds to the object.
|
|
// 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.
|
|
// 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);
|
|
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,
|
|
// 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.
|
|
// 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
|
|
// 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(
|
|
MyLayersPtr intermediate_layers = this->raft_and_intermediate_support_layers(
|
|
object, bottom_contacts, top_contacts, layer_storage, max_object_layer_height);
|
|
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.
|
|
// 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);
|
|
this->generate_base_layers(object, bottom_contacts, top_contacts, intermediate_layers);
|
|
|
|
|
|
@@ -269,6 +282,8 @@ void PrintObjectSupportMaterial::generate(PrintObject &object)
|
|
}
|
|
}
|
|
#endif /* SLIC3R_DEBUG */
|
|
#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.
|
|
// 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.
|
|
// 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.
|
|
// 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);
|
|
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.
|
|
// Propagate top / bottom contact layers to generate interface layers.
|
|
MyLayersPtr interface_layers = this->generate_interface_layers(
|
|
MyLayersPtr interface_layers = this->generate_interface_layers(
|
|
object, bottom_contacts, top_contacts, intermediate_layers, layer_storage);
|
|
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.
|
|
// Install support layers into the object.
|
|
MyLayersPtr layers_sorted;
|
|
MyLayersPtr layers_sorted;
|
|
layers_sorted.reserve(bottom_contacts.size() + top_contacts.size() + intermediate_layers.size() + interface_layers.size());
|
|
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;
|
|
++ layer_id;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ BOOST_LOG_TRIVIAL(info) << "Support generator - Generating tool paths";
|
|
|
|
+
|
|
// Generate the actual toolpaths and save them into each layer.
|
|
// Generate the actual toolpaths and save them into each layer.
|
|
this->generate_toolpaths(object, raft, bottom_contacts, top_contacts, intermediate_layers, interface_layers);
|
|
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)
|
|
void collect_region_slices_by_type(const Layer &layer, SurfaceType surface_type, Polygons &out)
|