Skip to content

Commit

Permalink
propagate errors in boolean operands
Browse files Browse the repository at this point in the history
  • Loading branch information
pca006132 committed Sep 19, 2024
1 parent fcc7075 commit 01437ee
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/manifold/src/boolean_result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,11 +671,22 @@ Manifold::Impl Boolean3::Result(OpType op) const {
const int c3 = op == OpType::Intersect ? 1 : -1;

if (inP_.IsEmpty()) {
if (inP_.status_ != Manifold::Error::NoError ||
inQ_.status_ != Manifold::Error::NoError) {
auto impl = Manifold::Impl();
impl.status_ = Manifold::Error::InvalidConstruction;
return impl;
}
if (!inQ_.IsEmpty() && op == OpType::Add) {
return inQ_;
}
return Manifold::Impl();
} else if (inQ_.IsEmpty()) {
if (inQ_.status_ != Manifold::Error::NoError) {
auto impl = Manifold::Impl();
impl.status_ = Manifold::Error::InvalidConstruction;
return impl;
}
if (op == OpType::Intersect) {
return Manifold::Impl();
}
Expand Down

0 comments on commit 01437ee

Please sign in to comment.