Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 3 additions & 27 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,4 @@
Build
Build.bat
/build/
.git
build
deps/build
MYMETA.json
MYMETA.yml
_build
blib
xs/buildtmp
*.o
*.log
MANIFEST.bak
xs/MANIFEST.bak
xs/assertlib*
.init_bundle.ini
.vs/*
local-lib
/src/TAGS
/.vscode/
build-linux/*
deps/build-linux/*
**/.DS_Store
install_*
build_*/
SVG
Dockerfile
DockerBuild.sh
DockerRun.sh
*.AppImage
5 changes: 5 additions & 0 deletions BuildLinux.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ then
echo "Building CrealityPrint_profile_validator .."
#cmake --build build --target CrealityPrint_profile_validator
./run_gettext.sh
# Compile the .po translations into resources/i18n/<locale>/CrealityPrint.mo.
# This is a standalone custom target that the default build does NOT run, so
# without it the Linux package ships with an empty resources/i18n (English only).
echo "Building translations (gettext_po_to_mo) ..."
cmake --build build --target gettext_po_to_mo
echo "done"
fi

Expand Down
Empty file modified DockerBuild.sh
100644 → 100755
Empty file.
Empty file modified DockerRun.sh
100644 → 100755
Empty file.
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/ubuntu:22.04
FROM docker.io/ubuntu:24.04
LABEL maintainer "DeftDawg <DeftDawg@gmail.com>"

# Disable interactive package configuration
Expand All @@ -11,6 +11,7 @@ RUN echo deb-src http://archive.ubuntu.com/ubuntu \

RUN apt-get update && apt-get install -y \
autoconf \
bc \
build-essential \
cmake \
curl \
Expand All @@ -34,13 +35,13 @@ RUN apt-get update && apt-get install -y \
libgtk-3-dev \
libosmesa6-dev \
libsecret-1-dev \
libsoup2.4-dev \
libssl3 \
libsoup-3.0-dev \
libssl-dev \
libtool \
libudev-dev \
libwayland-dev \
libwebkit2gtk-4.0-dev \
libwebkit2gtk-4.1-dev \
libjavascriptcoregtk-4.1-dev \
libxkbcommon-dev \
locales \
locales-all \
Expand Down Expand Up @@ -70,6 +71,12 @@ RUN ./BuildLinux.sh -u
# Build dependencies in ./deps
RUN ./BuildLinux.sh -d

# Static libtiff from ./deps pulls in -lLerc and -ldeflate at final link time,
# but those dev libraries are not in the apt list above. Install before linking.
# libdeflate-dev provides the /usr/lib/.../libdeflate.so symlink referenced by
# the CMAKE_CXX_STANDARD_LIBRARIES fix in src/CMakeLists.txt.
RUN apt-get update && apt-get install -y liblerc-dev libdeflate-dev

# Build slic3r
RUN ./BuildLinux.sh -s

Expand Down
6 changes: 5 additions & 1 deletion deps/Assimp/Assimp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ orcaslicer_add_cmake_project(Assimp
URL https://github.com/assimp/assimp/archive/refs/tags/v5.4.3.zip
URL_HASH SHA256=795C29716F4AC123B403E53B677E9F32A8605C4A7B2D9904BFAAE3F4053B506D
PATCH_COMMAND ${patch_command}
# CMAKE_ARGS
CMAKE_ARGS
# Assimp forces -Wall -Werror (ASSIMP_WARNINGS_AS_ERRORS defaults ON).
# GCC 13 emits new warnings (-Wdangling-reference, -Wstringop-overflow,
# ...) that would become fatal. Turn the promotion off.
-DASSIMP_WARNINGS_AS_ERRORS=OFF
# -DASSIMP_BUILD_ZLIB=OFF

)
Expand Down
6 changes: 5 additions & 1 deletion deps/paho-mqtt/paho-mqtt.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#set(patch_command git init && ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-fix-slicer-build.patch)
set(_build_static ON)
set(_build_with_ssl ON)
if(LINUX)
# Build paho WITHOUT SSL on Linux: otherwise paho compiles against the system
# OpenSSL 3.x headers but links the static OpenSSL 1.1.1 from ./deps, an ABI
# mismatch. Use "UNIX AND NOT APPLE" because the LINUX variable only exists in
# CMake >= 3.25 (the 22.04 image had 3.22, where if(LINUX) silently never fired).
if(UNIX AND NOT APPLE)
set(_build_with_ssl OFF)
endif()

Expand Down
18 changes: 13 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ if (SLIC3R_GUI)
if(LIBRT)
list(APPEND wxWidgets_LIBRARIES ${LIBRT})
endif()
# ʹ������������ʽ֧�ֶ����������� (�� Visual Studio)
# ʹ������������ʽ֧�ֶ����������� (�� Visual Studio)
find_library(LIBOSS_DEBUG alibabacloud-oss-cpp-sdkd)
find_library(LIBOSS_RELEASE alibabacloud-oss-cpp-sdk)
if(NOT LIBOSS_DEBUG)
set(LIBOSS_DEBUG ${LIBOSS_RELEASE})
endif()
if(LIBOSS_DEBUG OR LIBOSS_RELEASE)
if(APPLE)
# Apple ֻ�� Release �汾
# Apple ֻ�� Release �汾
list(APPEND wxWidgets_LIBRARIES ${LIBOSS_RELEASE} OpenSSL::SSL OpenSSL::Crypto)
else()
list(APPEND wxWidgets_LIBRARIES
Expand Down Expand Up @@ -158,6 +158,14 @@ else()
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/osx/Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist @ONLY)
message("PROJECT_DLL_NAME_WIN32=${PROJECT_DLL_NAME_WIN32}")
# Static libtiff from ./deps pulls in libdeflate and libLerc symbols, but
# libtiff.a appears twice in the link line and the transitive -ldeflate/-lLerc
# land before its last occurrence, so the symbols go unresolved. Append both
# libraries at the very end of every link line (CMAKE_CXX_STANDARD_LIBRARIES is
# emitted last and not deduped).
if (UNIX AND NOT APPLE)
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} /usr/lib/x86_64-linux-gnu/libdeflate.so /usr/lib/x86_64-linux-gnu/libLerc.so")
endif()
set(PROJECT_DLL ${PROJECT_DLL_NAME_WIN32})
if(WIN32)
set(PROJECT_DLL ${PROJECT_DLL_NAME_WIN32})
Expand Down Expand Up @@ -193,14 +201,14 @@ if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "loongarch|loongarch64")
endif()
if(ENABLE_BREAKPAD)
add_definitions(-DUSE_BREAKPAD)
# ʹ������������ʽ֧�ֶ����������� (�� Visual Studio)
# ʹ������������ʽ֧�ֶ����������� (�� Visual Studio)
find_library(LIB_BREAKPAD_DEBUG libbreakpad_clientd)
find_library(LIB_BREAKPAD_RELEASE libbreakpad_client)
if(NOT LIB_BREAKPAD_DEBUG)
set(LIB_BREAKPAD_DEBUG ${LIB_BREAKPAD_RELEASE})
endif()
if(APPLE)
# Apple ֻ�� Release �汾
# Apple ֻ�� Release �汾
message(STATUS "LIB_BREAKPAD=${LIB_BREAKPAD_RELEASE}")
target_link_libraries(${PROJECT_DLL} libslic3r cereal::cereal ${LIB_BREAKPAD_RELEASE})
else()
Expand Down Expand Up @@ -242,7 +250,7 @@ if(WIN32)
endif()
endif()

# ʹ�� debug/optimized �ؼ���֧�ֶ����������� (�� Visual Studio)
# ʹ�� debug/optimized �ؼ���֧�ֶ����������� (�� Visual Studio)
find_library(LIB_ASSIMP_DEBUG assimp-${ASSIMP_MSVC_VERSION}-mtd)
if(NOT LIB_ASSIMP_DEBUG)
find_library(LIB_ASSIMP_DEBUG assimp-${ASSIMP_MSVC_VERSION}-mt)
Expand Down
4 changes: 3 additions & 1 deletion src/clipper2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ target_include_directories(Clipper2
if (WIN32)
target_compile_options(Clipper2 PRIVATE /W4 /WX)
else()
target_compile_options(Clipper2 PRIVATE -Wall -Wextra -Wpedantic -Werror)
# -Werror dropped: GCC 13 promotes new warnings (e.g. -Wdangling-reference)
# to errors in this third-party lib. Keep the warnings, not the promotion.
target_compile_options(Clipper2 PRIVATE -Wall -Wextra -Wpedantic)
target_link_libraries(Clipper2 PUBLIC -lm)
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 14.1)
target_compile_options(Clipper2 PRIVATE -Wno-error=template-id-cdtor)
Expand Down
26 changes: 23 additions & 3 deletions src/libslic3r/AppConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,13 @@ bool ProfileLoader::_LoadModel(ProfileMachine& profile, const std::string& vendo
using json = nlohmann::json;
boost::nowide::ifstream ifs(vendor_path.string());
json data;
ifs >> data;
try {
ifs >> data;
} catch (const std::exception& e) {
BOOST_LOG_TRIVIAL(warning) << "ProfileLoader: skip vendor \"" << vendor << "\", failed to load \""
<< vendor_path.string() << "\": " << e.what();
return false;
}
if (!data.contains("name") || !data["name"].is_string())
return false;
if (!data.contains("machine_model_list") || !data["machine_model_list"].is_array())
Expand Down Expand Up @@ -169,7 +175,16 @@ bool ProfileLoader::_LoadModelImpl(ProfileModel& profile, const std::string& ven
boost::filesystem::path model_path = boost::filesystem::absolute(root_path / vendor / sub_path).make_preferred();
boost::nowide::ifstream ifs(model_path.string());
json model_data;
ifs >> model_data;
// A missing or malformed model file must not abort the whole profile load:
// skip this model instead of letting the parse error propagate (case-sensitive
// filesystems surface broken sub_path references that Windows/macOS hide).
try {
ifs >> model_data;
} catch (const std::exception& e) {
BOOST_LOG_TRIVIAL(warning) << "ProfileLoader: skip model \"" << model << "\", failed to load \""
<< model_path.string() << "\": " << e.what();
return false;
}
if (!model_data.contains("nozzle_diameter") || !model_data["nozzle_diameter"].is_string())
return false;
std::vector<std::string> nozzle_group;
Expand Down Expand Up @@ -288,7 +303,12 @@ bool ProfileLoader::_LoadPrinterImpl(ProfilePrinter& profile, const std::string&
using json = nlohmann::json;
boost::nowide::ifstream ifs(path);
json data;
ifs >> data;
try {
ifs >> data;
} catch (const std::exception& e) {
BOOST_LOG_TRIVIAL(warning) << "ProfileLoader: skip printer profile \"" << path << "\": " << e.what();
return false;
}
if (!data.contains("type") || !data["type"].is_string() || data["type"]!="machine")
return false;
if (!data.contains("name") || !data["type"].is_string())
Expand Down
9 changes: 9 additions & 0 deletions src/slic3r/GUI/ParamsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,16 @@ ParamsDialog::ParamsDialog(wxWindow * parent)
adjust_dialog_in_screen(this, 1300, 650);
Bind(wxEVT_SHOW, [this](auto &event) {
if (IsShown()) {
#ifndef __linux__
// On GTK a wxWindowDisabler that excludes this dialog still ends up
// making the dialog itself insensitive (the dialog is transient-for
// the mainframe, which gets gtk_widget_set_sensitive(FALSE)). The
// custom-drawn Creality widgets keep their normal look but stop
// receiving any mouse/keyboard events, so every parameter input
// appears read-only. See CrealityOfficial/CrealityPrint#565 / #552.
// Skip the modal-style disabler on Linux; the dialog stays usable.
m_winDisabler = new wxWindowDisabler(this);
#endif
} else {
delete m_winDisabler;
m_winDisabler = nullptr;
Expand Down
6 changes: 5 additions & 1 deletion src/slic3r/GUI/ParamsPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,11 @@ void ParamsPanel::OnToggled(wxCommandEvent& event)

if (m_mode_region && m_mode_region->GetValue() && m_current_tab) {
wxWindowUpdateLocker locker(GetParent());
set_active_tab(nullptr);
// Re-activate the current tab instead of clearing it. Passing nullptr
// here left the panel without an active tab, so all parameter inputs
// (cooling, temperatures, etc.) stayed greyed out / read-only after a
// mode toggle. See CrealityOfficial/CrealityPrint#552.
set_active_tab(m_current_tab);
}

m_page_view->Update();
Expand Down
11 changes: 7 additions & 4 deletions src/slic3r/GUI/Plater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,10 @@ static void remap_model_filament_assignments(const std::vector<unsigned int> &re
}
}

// Forward declarations for MixedFilament <-> Dialog mapping helpers (defined later in anon namespace).
// Forward declarations for MixedFilament <-> Dialog mapping helpers (defined later in
// the anonymous namespace). Kept inside an anonymous namespace so they share the
// definitions' internal linkage; the definitions must NOT use the redundant 'static'
// keyword, or GCC flags an extern-then-static linkage mismatch.
namespace {
MixedFilamentResult build_result_from_mixed(const MixedFilament& mf);
void apply_result_to_mixed(const MixedFilamentResult& r, MixedFilament& mf);
Expand Down Expand Up @@ -4619,7 +4622,7 @@ static std::string encode_gradient_weights(const std::vector<int> &w)
return out;
}

static MixedFilamentResult build_result_from_mixed(const MixedFilament& mf)
MixedFilamentResult build_result_from_mixed(const MixedFilament& mf)
{
MixedFilamentResult r;
if (!mf.gradient_component_ids.empty()) {
Expand All @@ -4637,7 +4640,7 @@ static MixedFilamentResult build_result_from_mixed(const MixedFilament& mf)
return r;
}

static void apply_result_to_mixed(const MixedFilamentResult& r, MixedFilament& mf)
void apply_result_to_mixed(const MixedFilamentResult& r, MixedFilament& mf)
{
mf.manual_pattern.clear();
if (r.components.size() >= 3) {
Expand All @@ -4660,7 +4663,7 @@ static void apply_result_to_mixed(const MixedFilamentResult& r, MixedFilament& m
mf.custom = true;
}

static void apply_result_append_to_manager(const MixedFilamentResult& r,
void apply_result_append_to_manager(const MixedFilamentResult& r,
MixedFilamentManager& mgr,
const std::vector<std::string>& colors)
{
Expand Down
36 changes: 16 additions & 20 deletions src/slic3r/GUI/simple/PrintSettingsPanel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PrintSettingsPanel
struct PrintSettings
{
int quality_index = 1; // 0: Fast, 1: Standard, 2: Fine
int infill_density = 15; // Percentage: 0�C100
int infill_density = 15; // Percentage: 0�C100
int top_layers = 5;
int bottom_layers = 4;
int wall_layers = 4;
Expand Down Expand Up @@ -64,8 +64,8 @@ class PrintSettingsPanel
const char* label, int* current_index, const char* const items[], int item_count, float width, ImU32 bg_color, ImU32 button_color)
{
ImGui::PushStyleColor(ImGuiCol_FrameBg, bg_color);
ImGui::PushStyleColor(ImGuiCol_Button, button_color); // ���Ƽ�ͷ��ť��ɫ
ImGui::PushStyleColor(ImGuiCol_PopupBg, bg_color); // �����˵�����
ImGui::PushStyleColor(ImGuiCol_Button, button_color); // ���Ƽ�ͷ��ť��ɫ
ImGui::PushStyleColor(ImGuiCol_PopupBg, bg_color); // �����˵�����
ImGui::PushItemWidth(width);

bool changed = ImGui::Combo(label, current_index, items, item_count);
Expand All @@ -79,22 +79,22 @@ class PrintSettingsPanel
private:
static constexpr const char* infill_options[] = {"5%", "10%", "15%", "20%", "25%", "30%", "40%", "50%"};

// �ٷֱ� �� ����
// �ٷֱ� �� ����
int infill_density_to_index(int density)
{
for (int i = 0; i < IM_ARRAYSIZE(infill_options); ++i) {
if (std::stoi(infill_options[i]) == density)
return i;
}
return 0; // Ĭ�ϻ��˵���һ��
return 0; // Ĭ�ϻ��˵���һ��
}

// ���� �� �ٷֱ�
// ���� �� �ٷֱ�
int infill_index_to_density(int index)
{
if (index >= 0 && index < IM_ARRAYSIZE(infill_options))
return std::stoi(infill_options[index]);
return 15; // Ĭ��ֵ
return 15; // Ĭ��ֵ
}

template<typename T> void safe_get(const DynamicPrintConfig& cfg, const char* key, T& out)
Expand All @@ -107,22 +107,13 @@ class PrintSettingsPanel
if (auto* opt = cfg.option<typename ConfigOptionType<T>::type>(key))
opt->value = val;
}
// Primary template only; explicit specializations live at namespace scope
// below (GCC rejects explicit specialization inside a class body, unlike MSVC).
template<typename T> struct ConfigOptionType;

template<> struct ConfigOptionType<int>
{
using type = ConfigOptionInt;
};
template<> struct ConfigOptionType<float>
{
using type = ConfigOptionFloat;
};

template<> struct ConfigOptionType<unsigned> { using type = ConfigOptionPercent; };

void load_from_config(PrintSettings& s, const DynamicPrintConfig& config)
{
// �������������
// �������������
/* if (auto* opt = config.option<ConfigOptionFloat>("sparse_infill_pattern")) {
float lh = opt->value;
if (lh == 0.20f)
Expand Down Expand Up @@ -161,10 +152,15 @@ class PrintSettingsPanel


PrintSettings settings;
float animated_highlight_x = -1.0f; // ��ʼ��Ϊ��Чֵ
float animated_highlight_x = -1.0f; // ��ʼ��Ϊ��Чֵ
bool m_initialized = false;
};

// Explicit specializations of the member trait, required at namespace scope by GCC.
template<> struct PrintSettingsPanel::ConfigOptionType<int> { using type = ConfigOptionInt; };
template<> struct PrintSettingsPanel::ConfigOptionType<float> { using type = ConfigOptionFloat; };
template<> struct PrintSettingsPanel::ConfigOptionType<unsigned> { using type = ConfigOptionPercent; };

using PrintSettings = PrintSettingsPanel::PrintSettings;
}
} // namespace slic3r
Expand Down