Skip to content

Commit cd7a6fc

Browse files
authored
force manifold evaluation before worker exit (openscad#5348)
1 parent e972ed8 commit cd7a6fc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/gui/CGALWorker.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <memory>
44
#include <QThread>
55

6+
#include "ManifoldGeometry.h"
67
#include "core/Tree.h"
78
#include "geometry/GeometryEvaluator.h"
89
#include "core/progress.h"
@@ -36,6 +37,14 @@ void CGALWorker::work()
3637
try {
3738
GeometryEvaluator evaluator(*this->tree);
3839
root_geom = evaluator.evaluateGeometry(*this->tree->root(), true);
40+
41+
if (auto manifold = std::dynamic_pointer_cast<const ManifoldGeometry>(root_geom)) {
42+
// calling status forces evaluation
43+
// we should complete evaluation within the worker thread, so computation
44+
// will not block the GUI.
45+
if (manifold->getManifold().Status() != manifold::Manifold::Error::NoError)
46+
LOG(message_group::Error, "Rendering cancelled due to unknown manifold error.");
47+
}
3948
} catch (const ProgressCancelException& e) {
4049
LOG("Rendering cancelled.");
4150
} catch (const HardWarningException& e) {

0 commit comments

Comments
 (0)