Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix astar router #845

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 30 additions & 6 deletions gdsfactory/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,27 +213,51 @@ def get_polygons(

if by_spec is True:
layers = self.get_layers()
return {
layer: self._cell.get_polygons(
polygon_dict = {}
for layer in layers:
polygon = self._cell.get_polygons(
depth=depth,
layer=layer[0],
datatype=layer[1],
include_paths=include_paths,
)
for layer in layers
}
polygon_dict[layer] = np.asarray(
[
[polygon[0], polygon[0]],
[polygon[0], polygon[1]],
[polygon[1], polygon[0]],
[polygon[1], polygon[1]],
]
)
return polygon_dict

elif not by_spec:
return self._cell.get_polygons(depth=depth, include_paths=include_paths)
polygon = self._cell.get_polygons(depth=depth, include_paths=include_paths)
return np.asarray(
[
[polygon[0], polygon[0]],
[polygon[0], polygon[1]],
[polygon[1], polygon[0]],
[polygon[1], polygon[1]],
]
)

else:
layer = gf.get_layer(by_spec)
return self._cell.get_polygons(
polygon = self._cell.get_polygons(
depth=depth,
layer=layer[0],
datatype=layer[1],
include_paths=include_paths,
)
return np.asarray(
[
[polygon[0], polygon[0]],
[polygon[0], polygon[1]],
[polygon[1], polygon[0]],
[polygon[1], polygon[1]],
]
)

def get_dependencies(self, recursive: bool = False) -> List["Component"]:
"""Return a set of the cells included in this cell as references.
Expand Down