-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* uz refactor * ready for merge * layerstack --> layer_stack * finish migration to meshwell, remove legacy meshing code * finish migration to meshwell, remove legacy meshing code * fix docs * remove removed functions * fix init
- Loading branch information
Showing
15 changed files
with
174 additions
and
1,112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from typing import Any | ||
|
||
from gdsfactory.technology import LayerStack | ||
from meshwell.polysurface import PolySurface | ||
from shapely.affinity import scale | ||
|
||
|
||
def define_polysurfaces( | ||
polygons_dict: dict, | ||
layer_stack: LayerStack, | ||
model: Any, | ||
resolutions: dict, | ||
scale_factor: float = 1, | ||
): | ||
"""Define meshwell polysurfaces dimtags from gdsfactory information.""" | ||
polysurfaces_list = [] | ||
|
||
if resolutions is None: | ||
resolutions = {} | ||
|
||
for layername in polygons_dict.keys(): | ||
if polygons_dict[layername].is_empty: | ||
continue | ||
|
||
polysurfaces_list.append( | ||
PolySurface( | ||
polygons=scale( | ||
polygons_dict[layername], | ||
*(scale_factor,) * 2, | ||
origin=(0, 0, 0), | ||
), | ||
model=model, | ||
resolution=resolutions.get(layername, None), | ||
mesh_order=layer_stack.layers.get(layername).mesh_order, | ||
physical_name=layername, | ||
) | ||
) | ||
|
||
return polysurfaces_list |
Oops, something went wrong.