|
12 | 12 | import shapely |
13 | 13 | import tidy3d as td |
14 | 14 | import trimesh |
15 | | -from tidy3d.components.geometry.base import Planar |
16 | 15 | from tidy3d.components.geometry.mesh import AREA_SIZE_THRESHOLD |
17 | 16 | from tidy3d.components.geometry.utils import ( |
18 | 17 | SnapBehavior, |
@@ -160,8 +159,15 @@ def test_bounds(component): |
160 | 159 | _ = component.bounds |
161 | 160 |
|
162 | 161 |
|
163 | | -def test_planar_bounds(): |
164 | | - _ = Planar.bounds.fget(CYLINDER) |
| 162 | +@pytest.mark.parametrize( |
| 163 | + "component,expected_bounds", |
| 164 | + [ |
| 165 | + (CYLINDER, ((-1.0, -1.0, -0.5), (1.0, 1.0, 0.5))), |
| 166 | + (POLYSLAB, ((0.0, 0.0, -0.5), (1.0, 1.0, 0.5))), |
| 167 | + ], |
| 168 | +) |
| 169 | +def test_planar_bounds(component, expected_bounds): |
| 170 | + assert all(a == b for a, b in zip(component.bounds, expected_bounds)) |
165 | 171 |
|
166 | 172 |
|
167 | 173 | @pytest.mark.parametrize("component", GEO_TYPES) |
@@ -214,10 +220,6 @@ def test_intersections_plane_inf(): |
214 | 220 | assert len(c.intersections_plane(y=0)) == 1 |
215 | 221 |
|
216 | 222 |
|
217 | | -def test_bounds_base(): |
218 | | - assert all(a == b for a, b in zip(Planar.bounds.fget(POLYSLAB), POLYSLAB.bounds)) |
219 | | - |
220 | | - |
221 | 223 | def test_center_not_inf_validate(): |
222 | 224 | with pytest.raises(pydantic.ValidationError): |
223 | 225 | _ = td.Box(center=(td.inf, 0, 0)) |
|
0 commit comments