mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-05 01:02:08 +00:00
feat(libslic3r): multi-nozzle slicing engine for H2C/A2L
Port BambuStudio's dual-nozzle slicing core: H2C-era config keys, filament-to-nozzle grouping with per-layer dynamic regrouping, filament/nozzle/hotend gcode placeholder vocabulary, multi-nozzle wipe tower pre-heat/pre-cool, the two-pass pre-cooling injector, and corexy farthest-point timelapse.
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <filesystem>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
#include "format.hpp"
|
||||
#include "Platform.hpp"
|
||||
@@ -1497,6 +1501,15 @@ std::string format_memsize(size_t bytes, unsigned int decimals)
|
||||
}
|
||||
}
|
||||
|
||||
std::string format_diameter_to_str(double diameter, int precision)
|
||||
{
|
||||
double candidates[] = {0.2, 0.4, 0.6, 0.8};
|
||||
double best = *std::min_element(std::begin(candidates), std::end(candidates), [diameter](double a, double b) { return std::abs(a - diameter) < std::abs(b - diameter); });
|
||||
std::ostringstream oss;
|
||||
oss << std::fixed << std::setprecision(precision) << best;
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
// Returns platform-specific string to be used as log output or parsed in SysInfoDialog.
|
||||
// The latter parses the string with (semi)colons as separators, it should look about as
|
||||
// "desc1: value1; desc2: value2" or similar (spaces should not matter).
|
||||
|
||||
Reference in New Issue
Block a user