From b3e2aacffc0de0ffb4d9e251cc4db37fa4cd2f09 Mon Sep 17 00:00:00 2001 From: mckay Date: Mon, 18 Aug 2025 15:07:39 +0800 Subject: [PATCH] fix: correct logical operations in filter_cells_by_boolean for cell signs --- network_process/src/post_topo/patch_propagation.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/network_process/src/post_topo/patch_propagation.cpp b/network_process/src/post_topo/patch_propagation.cpp index 79afb56..100bf50 100644 --- a/network_process/src/post_topo/patch_propagation.cpp +++ b/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; switch (iter->get_operation()) { - 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::unionOp: temp_info.cell_signs &= other_cell_sign; break; + case internal::eNodeOperation::intersectionOp: temp_info.cell_signs |= other_cell_sign; break; case internal::eNodeOperation::differenceOp: // stacked nodes are always left childs - temp_info.cell_signs.flip() &= other_cell_sign; + temp_info.cell_signs.flip() |= other_cell_sign; 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.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(); } \ No newline at end of file