From a4d06c5e6e8eb25bf4c71972e4c6bd27708b0fd6 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 81c71a5..8e229da 100644 --- a/network_process/src/post_topo/patch_propagation.cpp +++ b/network_process/src/post_topo/patch_propagation.cpp @@ -152,11 +152,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; } @@ -171,5 +171,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