mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-26 18:31:11 +00:00
Forced pattern , separed to > 9 extruder
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
|
||||
#include <boost/log/trivial.hpp>
|
||||
#include <cfloat>
|
||||
#include <limits>
|
||||
#include <sstream>
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
@@ -1140,16 +1142,23 @@ static void append_mixed_component_extruders(const MixedFilamentManager &mixed_m
|
||||
append_unique_painted_extruder(painting_extruders, unsigned(token - '0'), num_physical_extruders);
|
||||
}
|
||||
|
||||
for (char token : mixed_row->manual_pattern) {
|
||||
unsigned int extruder_id = 0;
|
||||
if (token == '1')
|
||||
extruder_id = mixed_row->component_a;
|
||||
else if (token == '2')
|
||||
extruder_id = mixed_row->component_b;
|
||||
else if (token >= '3' && token <= '9')
|
||||
extruder_id = unsigned(token - '0');
|
||||
|
||||
append_unique_painted_extruder(painting_extruders, extruder_id, num_physical_extruders);
|
||||
const std::string normalized_pattern = MixedFilamentManager::normalize_manual_pattern(mixed_row->manual_pattern);
|
||||
if (!normalized_pattern.empty()) {
|
||||
std::stringstream ss(normalized_pattern);
|
||||
std::string token;
|
||||
while (std::getline(ss, token, ',')) {
|
||||
if (token.empty())
|
||||
continue;
|
||||
try {
|
||||
size_t consumed = 0;
|
||||
const unsigned long value = std::stoul(token, &consumed);
|
||||
if (consumed != token.size() || value == 0 || value > std::numeric_limits<unsigned int>::max())
|
||||
continue;
|
||||
append_unique_painted_extruder(painting_extruders, static_cast<unsigned int>(value), num_physical_extruders);
|
||||
} catch (...) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user