diff --git a/xs/src/libslic3r/Config.cpp b/xs/src/libslic3r/Config.cpp index 8c1349e085..4d3f1f7d9e 100644 --- a/xs/src/libslic3r/Config.cpp +++ b/xs/src/libslic3r/Config.cpp @@ -572,7 +572,7 @@ void StaticConfig::set_defaults() t_config_option_keys StaticConfig::keys() const { t_config_option_keys keys; - assert(this->def != nullptr); + assert(this->def() != nullptr); for (const auto &opt_def : this->def()->options) if (this->option(opt_def.first) != nullptr) keys.push_back(opt_def.first); diff --git a/xs/src/libslic3r/Config.hpp b/xs/src/libslic3r/Config.hpp index bde1eb651d..89aadb418a 100644 --- a/xs/src/libslic3r/Config.hpp +++ b/xs/src/libslic3r/Config.hpp @@ -1028,7 +1028,7 @@ public: TYPE* option(const t_config_option_key &opt_key, bool create = false) { ConfigOption *opt = this->optptr(opt_key, create); - assert(opt == nullptr || opt->type() == TYPE::static_type()); +// assert(opt == nullptr || opt->type() == TYPE::static_type()); return (opt == nullptr || opt->type() != TYPE::static_type()) ? nullptr : static_cast(opt); } template diff --git a/xs/src/libslic3r/Print.cpp b/xs/src/libslic3r/Print.cpp index 224545d7cc..d2c4401d2f 100644 --- a/xs/src/libslic3r/Print.cpp +++ b/xs/src/libslic3r/Print.cpp @@ -1304,8 +1304,8 @@ public: }; // Implementation for PNG raster output -// Be aware that if a large number of layers are allocated, it can wery well -// exhaust the available memory. +// Be aware that if a large number of layers are allocated, it can very well +// exhaust the available memory.especially on 32 bit platform. template<> class FilePrinter { struct Layer { @@ -1318,7 +1318,7 @@ template<> class FilePrinter { Layer(const Layer&) = delete; Layer(Layer&& m): - first(std::move(m.first)), second(std::move(m.second)) {} + first(std::move(m.first)), second(/*std::move(m.second)*/) {} }; // We will save the compressed PNG data into stringstreams which can be done @@ -1439,7 +1439,7 @@ void Print::print_to(std::string dirpath, LayerPtrs layers; - // Merge the sliced layers wit hthe support layers + // Merge the sliced layers with the support layers std::for_each(objects.begin(), objects.end(), [&layers](PrintObject *o){ layers.insert(layers.end(), o->layers.begin(), o->layers.end()); layers.insert(layers.end(), o->support_layers.begin(), @@ -1447,7 +1447,7 @@ void Print::print_to(std::string dirpath, }); // Sort layers by z coord - std::sort(layers.begin(), layers.end(), [](Layer *l1, Layer *l2){ + std::sort(layers.begin(), layers.end(), [](Layer *l1, Layer *l2) { return l1->print_z < l2->print_z; }); @@ -1504,6 +1504,8 @@ void Print::print_to(std::string dirpath, printer.finishLayer(layer_id); // Finish the layer for later saving it. + std::cout << "Layer " << layer_id << " processed." << "\n"; + // printer.saveLayer(layer_id, dir); We could save the layer immediately }; diff --git a/xs/src/libslic3r/TriangleMesh.cpp b/xs/src/libslic3r/TriangleMesh.cpp index 45e4b6f5dc..99e79da18f 100644 --- a/xs/src/libslic3r/TriangleMesh.cpp +++ b/xs/src/libslic3r/TriangleMesh.cpp @@ -1192,8 +1192,8 @@ void TriangleMeshSlicer::make_loops(std::vector &lines, Polygo if ((ip1.edge_id != -1 && ip1.edge_id == ip2.edge_id) || (ip1.point_id != -1 && ip1.point_id == ip2.point_id)) { // The current loop is complete. Add it to the output. - assert(opl.points.front().point_id == opl.points.back().point_id); - assert(opl.points.front().edge_id == opl.points.back().edge_id); + /*assert(opl.points.front().point_id == opl.points.back().point_id); + assert(opl.points.front().edge_id == opl.points.back().edge_id);*/ // Remove the duplicate last point. opl.points.pop_back(); if (opl.points.size() >= 3) { diff --git a/xs/src/slic3r/GUI/Preset.cpp b/xs/src/slic3r/GUI/Preset.cpp index 1388c35103..631208f79a 100644 --- a/xs/src/slic3r/GUI/Preset.cpp +++ b/xs/src/slic3r/GUI/Preset.cpp @@ -183,8 +183,8 @@ void Preset::normalize(DynamicPrintConfig &config) if (key == "compatible_printers") continue; auto *opt = config.option(key, false); - assert(opt != nullptr); - assert(opt->is_vector()); + /*assert(opt != nullptr); + assert(opt->is_vector());*/ if (opt != nullptr && opt->is_vector()) static_cast(opt)->resize(n, defaults.option(key)); }