Merge branch 'main' into pr/tommasobbianchi/16019

This commit is contained in:
SoftFever
2026-10-05 10:58:44 +08:00
643 changed files with 2314161 additions and 2304433 deletions
+5 -23
View File
@@ -19,7 +19,6 @@
#include <boost/filesystem/path.hpp>
#include <boost/log/trivial.hpp> // the offer/atlas join check reports on the log
#include <wx/stopwatch.h>
#include <Standard_Failure.hxx>
#include <cassert>
#include <cstdarg> // offer_trace: diagnostic row dump for the offer ladder
@@ -4714,7 +4713,7 @@ void DesignPanel::on_import_svg()
// (parse + tessellate); running it inline froze the whole window — the compositor marked the
// app unresponsive and nothing repainted. The dialog is app-modal, so the document cannot be
// touched while the worker owns it. Exceptions must not escape the worker: `work` is expected
// to swallow them (OCCT throws Standard_Failure, which is not a std::exception).
// to swallow them.
// True while a worker owns the document. wxYield below runs pending events — and a queued MCP
// request is one — so the control socket must check this and refuse rather than change the
// document under the worker (DesignPanel::mcp_busy).
@@ -4762,10 +4761,6 @@ bool DesignPanel::mcp_busy(bool sketch_method, std::string& why) const
return false;
}
// Rebuild the document off the UI thread. Every feature op (fillet, cut, shell, boolean, ...)
// goes through recompute(), and on a heavy imported solid that is seconds of OCCT work — inline
// it freezes the window. OCCT throws Standard_Failure, which is not a std::exception and would
// terminate the process if it escaped the worker, so both are caught here.
// Keep the Model's copy of the recipe in step with the document.
//
// This used to be written in exactly ONE place — on_commit(), as a side effect of Commit to
@@ -4796,18 +4791,15 @@ void DesignPanel::sync_recipe_to_model()
Slic3r::put_other_changes();
}
// Runs recompute() off the UI thread, because on a heavy imported solid it takes seconds.
bool DesignPanel::recompute_guarded(const wxString& message)
{
bool ok = false;
run_off_ui_thread(this, message, [this, &ok]() {
try {
ok = m_doc.recompute();
} catch (const Standard_Failure& e) {
const char* what = e.GetMessageString();
m_doc.error = (what != nullptr && *what != '\0') ? what : "OCCT failure";
ok = false;
} catch (const std::exception& e) {
m_doc.error = e.what();
m_doc.error = *e.what() ? e.what() : "OCCT failure";
ok = false;
}
});
@@ -4832,11 +4824,8 @@ void DesignPanel::on_import_step()
run_off_ui_thread(this, _L("Reading STEP…"), [&]() {
try {
solids = GeometryEngine::read_step_solids(path, err);
} catch (const Standard_Failure& e) {
const char* what = e.GetMessageString();
err = (what != nullptr && *what != '\0') ? what : "OCCT failure";
} catch (const std::exception& e) {
err = e.what();
err = *e.what() ? e.what() : "OCCT failure";
}
});
if (solids.empty()) {
@@ -4858,11 +4847,8 @@ void DesignPanel::on_import_step()
run_off_ui_thread(this, _L("Rebuilding model…"), [&]() {
try {
rebuilt = m_doc.recompute();
} catch (const Standard_Failure& e) {
const char* what = e.GetMessageString();
m_doc.error = (what != nullptr && *what != '\0') ? what : "OCCT failure";
} catch (const std::exception& e) {
m_doc.error = e.what();
m_doc.error = *e.what() ? e.what() : "OCCT failure";
}
});
if (!rebuilt) {
@@ -4934,10 +4920,6 @@ void DesignPanel::on_import_mesh()
try {
shape = GeometryEngine::mesh_to_brep(mesh.its, MESH_IMPORT_TOLERANCE,
MESH_IMPORT_MERGE_ANGLE_DEG, stats);
} catch (const Standard_Failure& e) { // on OCCT >= 8 Standard_Failure derives from std::exception — must precede that handler
fail(wxString::Format(_L("Mesh conversion failed: %s"),
kernel_error_text(e.GetMessageString() ? e.GetMessageString() : "")));
return;
} catch (const std::exception& e) {
fail(wxString::Format(_L("Mesh conversion failed: %s"), kernel_error_text(e.what())));
return;