mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
ENH: enhance filament group alogrithm
1. Try to merge filaments before grouping 2. Set max match num for machine filamnet in match mode jira:STUDIO-10392 Signed-off-by: xun.zhang <xun.zhang@bambulab.com> Change-Id: I2451d838e07ee02f493fda4dc702f3d13b2ad37b (cherry picked from commit d15fc37ff2fa048e38a0b132bb3ae525ff666fab)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include "FilamentGroupUtils.hpp"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace Slic3r
|
||||
{
|
||||
@@ -45,6 +45,20 @@ namespace FilamentGroupUtils
|
||||
return r != other.r || g != other.g || b != other.b || a != other.a;
|
||||
}
|
||||
|
||||
std::string Color::to_hex_str(bool include_alpha) const {
|
||||
std::ostringstream oss;
|
||||
oss << "#" << std::hex << std::setfill('0')
|
||||
<< std::setw(2) << static_cast<int>(r)
|
||||
<< std::setw(2) << static_cast<int>(g)
|
||||
<< std::setw(2) << static_cast<int>(b);
|
||||
|
||||
if (include_alpha) {
|
||||
oss << std::setw(2) << static_cast<int>(a);
|
||||
}
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
|
||||
bool MachineFilamentInfo::operator<(const MachineFilamentInfo& other) const
|
||||
{
|
||||
if (color != other.color) return color < other.color;
|
||||
|
||||
Reference in New Issue
Block a user