Returns a `mp.Volume` read from a GDSII file `fname` on layer number `layer` with `zmin` and `zmax` (default 0). This function is useful for creating a `FluxRegion` from a GDSII file as follows: ```python fr = mp.FluxRegion(volume=mp.GDSII_vol(fname, layer, zmin, zmax)) ```
(fname, layer, zmin, zmax)
| 6219 | |
| 6220 | |
| 6221 | def GDSII_vol(fname, layer, zmin, zmax): |
| 6222 | """ |
| 6223 | Returns a `mp.Volume` read from a GDSII file `fname` on layer number `layer` with |
| 6224 | `zmin` and `zmax` (default 0). This function is useful for creating a `FluxRegion` |
| 6225 | from a GDSII file as follows: |
| 6226 | |
| 6227 | ```python |
| 6228 | fr = mp.FluxRegion(volume=mp.GDSII_vol(fname, layer, zmin, zmax)) |
| 6229 | ``` |
| 6230 | """ |
| 6231 | meep_vol = mp.get_GDSII_volume(fname, layer, zmin, zmax) |
| 6232 | dims = meep_vol.dim + 1 |
| 6233 | is_cyl = False |
| 6234 | |
| 6235 | if dims == 4: |
| 6236 | # cylindrical |
| 6237 | dims = 2 |
| 6238 | is_cyl = True |
| 6239 | |
| 6240 | center, size = get_center_and_size(meep_vol) |
| 6241 | |
| 6242 | return Volume(center, size, dims, is_cyl) |
| 6243 | |
| 6244 | |
| 6245 | def GDSII_prisms(material, fname, layer=-1, zmin=0.0, zmax=0.0): |
nothing calls this directly
no test coverage detected