diff --git a/src/libslic3r/Model.cpp b/src/libslic3r/Model.cpp index cd12c327a..a1a8839dc 100644 --- a/src/libslic3r/Model.cpp +++ b/src/libslic3r/Model.cpp @@ -49,8 +49,9 @@ namespace Slic3r { const std::vector CONST_FILAMENTS = { - "", "4", "8", "0C", "1C", "2C", "3C", "4C", "5C", "6C", "7C", "8C", "9C", "AC", "BC", "CC", "DC", -}; // 5 10 15 16 + "", "4", "8", "0C", "1C", "2C", "3C", "4C", "5C", "6C", "7C", "8C", "9C", "AC", "BC", "CC","DC",//16 + "EC", "0FC", "1FC", "2FC", "3FC", "4FC", "5FC", "6FC", "7FC", "8FC", "9FC", "AFC", "BFC", "CFC", "DFC", "EFC",//32 +}; // 1 5 10 15 16 // BBS initialization of static variables std::map Model::extruderParamsMap = { {0,{"",0,0}}}; GlobalSpeedMap Model::printSpeedMap{}; @@ -3629,6 +3630,7 @@ static void get_real_filament_id(const unsigned char &id, std::string &result) { if (id < CONST_FILAMENTS.size()) { result = CONST_FILAMENTS[id]; } else { + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "check error:CONST_FILAMENTS out of array "; result = "";//error } }; diff --git a/src/libslic3r/TriangleSelector.cpp b/src/libslic3r/TriangleSelector.cpp index fa3b94034..4136dfd58 100644 --- a/src/libslic3r/TriangleSelector.cpp +++ b/src/libslic3r/TriangleSelector.cpp @@ -1680,9 +1680,9 @@ std::pair>, std::vector> TriangleSelector: if (n >= 3) { data.second.insert(data.second.end(), {true, true}); n -= 3; - while (n >= 16) { + while (n >= 15) { data.second.insert(data.second.end(), {true, true, true, true}); - n -= 16; + n -= 15; } for (size_t bit_idx = 0; bit_idx < 4; ++bit_idx) @@ -1771,7 +1771,7 @@ void TriangleSelector::deserialize(const std::pair> 2)); + state = EnforcerBlockerType(next_code + 15 * num + 3);//old:next_nibble() + 3; } else { state = EnforcerBlockerType(code >> 2); @@ -1871,9 +1871,23 @@ bool TriangleSelector::has_facets(const std::pair int { int code = next_nibble(); int num_of_split_sides = code & 0b11; - return num_of_split_sides == 0 ? - ((code & 0b1100) == 0b1100 ? next_nibble() + 3 : code >> 2) : - - num_of_split_sides - 1; + if (num_of_split_sides == 0) { + int state = 0; + if ((code & 0b1100) == 0b1100) { + int next_code = next_nibble(); + int num = 0; + while (next_code == 0b1111) { + num++; + next_code = next_nibble(); + } + state = next_code + 15 * num + 3; // old:next_nibble() + 3; + } else { + state = code >> 2; + } + return state; + } else { + return -num_of_split_sides - 1;// < 0 -> negative of a number of children + } }; int state = num_children_or_state();