now can handle multiple depths of parenthesis

This commit is contained in:
myerspat 2022-07-29 13:29:21 -05:00
parent 9413e46998
commit d7904f7a13

View file

@ -866,8 +866,17 @@ bool CSGCell::contains_complex(
// skip a section or break
if (next_token >= OP_UNION && token != next_token) {
if (next_token == OP_LEFT_PAREN) {
it =
std::find(it, region_no_complements_.end() - 1, OP_RIGHT_PAREN);
int depth = 1;
while (depth > 0) {
it++;
if (*it > OP_COMPLEMENT) {
if (*it == OP_RIGHT_PAREN) {
depth--;
} else {
depth++;
}
}
}
} else {
break;
}