diff --git a/tests/test_components/test_autograd.py b/tests/test_components/test_autograd.py index dfddd9656..58ccb4c1f 100644 --- a/tests/test_components/test_autograd.py +++ b/tests/test_components/test_autograd.py @@ -826,7 +826,7 @@ def objective(*params): sim_fields = sim_full_traced.strip_traced_fields() # note: there is one traced structure in SIM_FULL already with 6 fields + 1 = 7 - assert len(sim_fields) == 7 + assert len(sim_fields) == 10 sim_traced = sim_full_static.insert_traced_fields(sim_fields) diff --git a/tests/utils.py b/tests/utils.py index a234ee936..16f45f6a6 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -401,6 +401,11 @@ def make_custom_data(lims, unstructured): size=(8.0, 8.0, 8.0), run_time=1e-12, structures=[ + td.Structure( + geometry=td.Cylinder(length=1, center=(-1 * tracer, 0, 0), radius=tracer, axis=2), + medium=td.Medium(permittivity=1 + tracer, name="dieletric"), + name="traced_dieletric_cylinder", + ), td.Structure( geometry=td.Box(size=(1, tracer, tracer), center=(-1 * tracer, 0, 0)), medium=td.Medium(permittivity=1 + tracer, name="dieletric"), diff --git a/tidy3d/components/geometry/primitives.py b/tidy3d/components/geometry/primitives.py index 1710056d4..1d20d6bc4 100644 --- a/tidy3d/components/geometry/primitives.py +++ b/tidy3d/components/geometry/primitives.py @@ -486,13 +486,15 @@ def _intersections_normal(self, z: float): `Shapely's Documentation `_. """ + static_self = self.to_static() + # radius at z - radius_offset = self._radius_z(z) + radius_offset = static_self._radius_z(z) if radius_offset <= 0: return [] - _, (x0, y0) = self.pop_axis(self.center, axis=self.axis) + _, (x0, y0) = self.pop_axis(static_self.center, axis=self.axis) return [shapely.Point(x0, y0).buffer(radius_offset, quad_segs=_N_SHAPELY_QUAD_SEGS)] def _intersections_side(self, position, axis):