Skip to content

Commit 197b9d3

Browse files
Fixing indexing in parse_structures for contains_3d
1 parent 085a1f9 commit 197b9d3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tidy3d/components/grid/mesher.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,10 @@ def parse_structures(
119119
query_inds = tree.query_items(bbox_2d)
120120

121121
# Remove all lower structures that the current structure completely contains
122-
inds_lower = [ind for ind in query_inds if ind < str_ind]
123-
query_bbox = [struct_bbox[ind] for ind in inds_lower if struct_bbox[ind] is not None]
122+
inds_lower = [
123+
ind for ind in query_inds if ind < str_ind and struct_bbox[ind] is not None
124+
]
125+
query_bbox = [struct_bbox[ind] for ind in inds_lower]
124126
bbox_contains_inds = self.contains_3d(bbox, query_bbox)
125127
for ind in bbox_contains_inds:
126128
struct_bbox[inds_lower[ind]] = None

0 commit comments

Comments
 (0)