Browse Source

fix: update filter_cells_by_boolean to handle empty stack and assert parent index correctly

test-three-planes-intersection
mckay 1 month ago
parent
commit
45da454bfc
  1. 9
      network_process/src/post_topo/patch_propagation.cpp

9
network_process/src/post_topo/patch_propagation.cpp

@ -141,12 +141,13 @@ dynamic_bitset_mp<> filter_cells_by_boolean(const baked_blobtree_t&
stacked_nodes.emplace(std::move(front_info));
iter++;
while (iter != tree.nodes.end() - 1) {
// each out iteration must start with leaf node
while (iter != tree.nodes.end()) {
// each out iteration must start with leaf node, only 1 leaf node is absorbed in one iteration
assert(iter->is_primitive_node());
compact_node_info temp_info{std::move(cell_primitive_signs[iter->primitive_index]), iter->parent_index};
iter++; // to parent or neighboring node
while (temp_info.parent_index == stacked_nodes.top().parent_index) {
while (!stacked_nodes.empty() && temp_info.parent_index == stacked_nodes.top().parent_index) {
// do bool operation, util meet next primitive node.
assert(iter->is_operation_node());
const auto& other_cell_sign = stacked_nodes.top().cell_signs;
@ -168,7 +169,7 @@ dynamic_bitset_mp<> filter_cells_by_boolean(const baked_blobtree_t&
}
assert(stacked_nodes.size() == 1);
assert(stacked_nodes.top().parent_index == tree.nodes.size() - 1);
assert(stacked_nodes.top().parent_index == 0xFFFFFFFF);
return stacked_nodes.top().cell_signs;
}
Loading…
Cancel
Save