Fixed error due to applying de morgans laws

This commit is contained in:
myerspat 2022-08-26 12:47:08 -04:00
parent 80c8692537
commit 090363b637
2 changed files with 3 additions and 2 deletions

View file

@ -244,7 +244,7 @@ protected:
bool contains_simple(Position r, Direction u, int32_t on_surface) const;
bool contains_complex(Position r, Direction u, int32_t on_surface) const;
BoundingBox bounding_box_simple() const;
static BoundingBox bounding_box_complex(vector<int32_t> rpn);
static BoundingBox bounding_box_complex(vector<int32_t> postfix);
//! Applies DeMorgan's laws to a section of the RPN
//! \param start Starting point for token modification

View file

@ -624,6 +624,7 @@ CSGCell::CSGCell(pugi::xml_node cell_node)
for (auto it = region_.begin(); it != region_.end(); it++) {
if (*it == OP_INTERSECTION || *it > OP_COMPLEMENT) {
region_.erase(it);
it--;
}
}
region_.shrink_to_fit();
@ -807,7 +808,7 @@ void CSGCell::remove_complement_ops(vector<int32_t>& infix)
// positions in the RPN
apply_demorgan(it, stop);
// update iterator position
it = std::find(it, infix.end(), OP_COMPLEMENT);
it = std::find(infix.begin(), infix.end(), OP_COMPLEMENT);
}
}