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
path: root/xs
diff options
context:
space:
mode:
authorLukas Matena <lukasmatena@seznam.cz>2018-03-21 18:01:31 +0300
committerLukas Matena <lukasmatena@seznam.cz>2018-03-21 18:01:31 +0300
commite7a5bc1afefb3d051c888830e3655e8e456b6eaa (patch)
tree307dba654aca785aa190d397b0d6275b11878fab /xs
parent9519fae49072955eaf793195132e8f717ee16a23 (diff)
Added a check that no object uses extruder the printer doesn't have
Diffstat (limited to 'xs')
-rw-r--r--xs/src/libslic3r/Print.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/xs/src/libslic3r/Print.cpp b/xs/src/libslic3r/Print.cpp
index 18d2bcead..62c9c8819 100644
--- a/xs/src/libslic3r/Print.cpp
+++ b/xs/src/libslic3r/Print.cpp
@@ -624,7 +624,12 @@ std::string Print::validate() const
for (unsigned int extruder_id : extruders)
nozzle_diameters.push_back(this->config.nozzle_diameter.get_at(extruder_id));
double min_nozzle_diameter = *std::min_element(nozzle_diameters.begin(), nozzle_diameters.end());
-
+
+ unsigned int total_extruders_count = this->config.nozzle_diameter.size();
+ for (const auto& extruder_idx : extruders)
+ if ( extruder_idx >= total_extruders_count )
+ return "One or more object have assigned an extruder that the printer does not have.";
+
for (PrintObject *object : this->objects) {
if ((object->config.support_material_extruder == -1 || object->config.support_material_interface_extruder == -1) &&
(object->config.raft_layers > 0 || object->config.support_material.value)) {