Browse Source

fix: correct logical operations in filter_cells_by_boolean for cell signs

test-three-planes-intersection
mckay 4 weeks ago
parent
commit
b3e2aacffc
  1. 9
      network_process/src/post_topo/patch_propagation.cpp

9
network_process/src/post_topo/patch_propagation.cpp

@ -171,11 +171,11 @@ dynamic_bitset_mp<> filter_cells_by_boolean(const baked_blobtree_t&
const auto& other_cell_sign = stacked_nodes.top().cell_signs; const auto& other_cell_sign = stacked_nodes.top().cell_signs;
switch (iter->get_operation()) { switch (iter->get_operation()) {
case internal::eNodeOperation::unionOp: temp_info.cell_signs |= other_cell_sign; break; case internal::eNodeOperation::unionOp: temp_info.cell_signs &= other_cell_sign; break;
case internal::eNodeOperation::intersectionOp: temp_info.cell_signs &= other_cell_sign; break; case internal::eNodeOperation::intersectionOp: temp_info.cell_signs |= other_cell_sign; break;
case internal::eNodeOperation::differenceOp: case internal::eNodeOperation::differenceOp:
// stacked nodes are always left childs // stacked nodes are always left childs
temp_info.cell_signs.flip() &= other_cell_sign; temp_info.cell_signs.flip() |= other_cell_sign;
break; break;
default: throw std::runtime_error("ERROR: baked blobtree with unknown type operation node"); break; default: throw std::runtime_error("ERROR: baked blobtree with unknown type operation node"); break;
} }
@ -190,5 +190,6 @@ dynamic_bitset_mp<> filter_cells_by_boolean(const baked_blobtree_t&
assert(stacked_nodes.size() == 1); assert(stacked_nodes.size() == 1);
assert(stacked_nodes.top().parent_index == 0xFFFFFFFF); assert(stacked_nodes.top().parent_index == 0xFFFFFFFF);
return stacked_nodes.top().cell_signs; // sign 0 in blobtree means inside, so we need to flip the sign
return stacked_nodes.top().cell_signs.flip();
} }
Loading…
Cancel
Save