Skip to content

Commit f51659c

Browse files
committed
I fixed most of the problems with Scene.plot(). But Polyslabs are not transposed correctly. It looks like I need to modify the "polyslab.py" file. (I haven't touched this file yet.)
1 parent c6cccd1 commit f51659c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tidy3d/components/geometry/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2181,7 +2181,7 @@ def intersections_with(self, other, transpose: bool = False):
21812181
dim = "xyz"[normal_ind]
21822182
pos = self.center[normal_ind]
21832183
xyz_kwargs = {dim: pos}
2184-
shapes_plane = other.intersections_plane(**xyz_kwargs)
2184+
shapes_plane = other.intersections_plane(**xyz_kwargs, transpose=transpose)
21852185

21862186
# intersect all shapes with the input self
21872187
bs_min, bs_max = (self.pop_axis(bounds, axis=normal_ind, transpose=transpose)[1] for bounds in self.bounds)

tidy3d/components/scene.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def intersecting_media(
319319

320320
@staticmethod
321321
def intersecting_structures(
322-
test_object: Box, structures: tuple[Structure, ...]
322+
test_object: Box, structures: tuple[Structure, ...], transpose: bool = False,
323323
) -> tuple[Structure, ...]:
324324
"""From a given list of structures, returns a list of :class:`.Structure` that intersect
325325
with the ``test_object``, if it is a surface, or its surfaces, if it is a volume.
@@ -346,7 +346,7 @@ def intersecting_structures(
346346

347347
structures_merged = []
348348
for structure in structures:
349-
intersections = structure.geometry.intersections_plane(**xyz_kwargs)
349+
intersections = structure.geometry.intersections_plane(**xyz_kwargs, transpose=transpose)
350350
if len(intersections) > 0:
351351
structures_merged.append(structure)
352352
return structures_merged
@@ -648,8 +648,8 @@ def _get_structures_2dbox(
648648
"""
649649
# if no hlim and/or vlim given, the bounds will then be the usual pml bounds
650650
axis, _ = Box.parse_xyz_kwargs(x=x, y=y, z=z)
651-
_, (hmin, vmin) = Box.pop_axis(self.bounds[0], axis=axis)
652-
_, (hmax, vmax) = Box.pop_axis(self.bounds[1], axis=axis)
651+
_, (hmin, vmin) = Box.pop_axis(self.bounds[0], axis=axis, transpose=transpose)
652+
_, (hmax, vmax) = Box.pop_axis(self.bounds[1], axis=axis, transpose=transpose)
653653

654654
if hlim is not None:
655655
(hmin, hmax) = hlim

0 commit comments

Comments
 (0)