update libslic3r

This commit is contained in:
QIDI TECH
2025-05-05 19:52:57 +08:00
parent eae8e18c3a
commit 126534997a
180 changed files with 24833 additions and 5679 deletions

View File

@@ -60,9 +60,13 @@
#define CLI_OBJECT_COLLISION_IN_SEQ_PRINT -63
#define CLI_OBJECT_COLLISION_IN_LAYER_PRINT -64
#define CLI_SPIRAL_MODE_INVALID_PARAMS -65
#define CLI_FILAMENT_CAN_NOT_MAP -66
#define CLI_ONLY_ONE_TPU_SUPPORTED -67
#define CLI_FILAMENTS_NOT_SUPPORTED_BY_EXTRUDER -68
#define CLI_SLICING_ERROR -100
#define CLI_GCODE_PATH_CONFLICTS -101
#define CLI_GCODE_PATH_IN_UNPRINTABLE_AREA -102
#define CLI_FILAMENT_UNPRINTABLE_ON_FIRST_LAYER -103
namespace boost { namespace filesystem { class directory_entry; }}
@@ -129,6 +133,39 @@ inline DataType round_up_divide(DataType dividend, DataType divisor) //!< Return
return (dividend + divisor - 1) / divisor;
}
template<typename T>
T get_max_element(const std::vector<T> &vec)
{
static_assert(std::is_arithmetic<T>::value, "T must be of numeric type.");
if (vec.empty())
return static_cast<T>(0);
return *std::max_element(vec.begin(), vec.end());
}
template <typename From, typename To>
std::vector<To> convert_vector(const std::vector<From>& src) {
std::vector<To> dst;
dst.reserve(src.size());
for (const auto& elem : src) {
if constexpr (std::is_signed_v<To>) {
if (elem > static_cast<From>(std::numeric_limits<To>::max())) {
throw std::overflow_error("Source value exceeds destination maximum");
}
if (elem < static_cast<From>(std::numeric_limits<To>::min())) {
throw std::underflow_error("Source value below destination minimum");
}
}
else {
if (elem < 0) {
throw std::invalid_argument("Negative value in source for unsigned destination");
}
}
dst.push_back(static_cast<To>(elem));
}
return dst;
}
// Set a path with GUI localization files.
void set_local_dir(const std::string &path);
@@ -169,6 +206,7 @@ typedef std::string local_encoded_string;
extern local_encoded_string encode_path(const char *src);
extern std::string decode_path(const char *src);
extern std::string normalize_utf8_nfc(const char *src);
extern std::vector<std::string> split_string(const std::string &str, char delimiter);
// Safely rename a file even if the target exists.
// On Windows, the file explorer (or anti-virus or whatever else) often locks the file
@@ -190,7 +228,7 @@ CopyFileResult copy_file_inner(const std::string &from, const std::string &to, s
// of the source file before renaming.
// Additional error info is passed in error message.
extern CopyFileResult copy_file(const std::string &from, const std::string &to, std::string& error_message, const bool with_check = false);
extern bool copy_framework(const std::string &from, const std::string &to);
// Compares two files if identical.
extern CopyFileResult check_copy(const std::string& origin, const std::string& copy);