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

Write simulation plane to gds cell #883

Closed
tylerflex opened this issue May 16, 2023 · 7 comments
Closed

Write simulation plane to gds cell #883

tylerflex opened this issue May 16, 2023 · 7 comments
Assignees

Comments

@tylerflex
Copy link
Collaborator

eg wrapping filter_structures_plane, the following would be convenient

sim.to_gds(gds_cell, z=0)
@tylerflex
Copy link
Collaborator Author

tylerflex commented Jul 3, 2023

@lucas-flexcompute this is probably low priority but assigning you to try at some point if you think it's potentially useful. We had a user trying to generate a gds file from a cross section of their Simulation and was trying to do it by hand. In general, if there was some interface to make gds cells more simply from the Simulation itself, it might be useful.

@xin-flex
Copy link
Contributor

Two situations need to be considered:

  1. regular structures
  2. structures with custom medium (e.g. used in adjoint optimization)

@tylerflex
Copy link
Collaborator Author

Also, I thought we had a demo of 2 in our level set notebook but it seems not.

@lucas-flexcompute
Copy link
Collaborator

I was on the planning phase for this and I just wanted to share my thoughts to make sure I'm going in the right direction with the UI. I'm thinking of 3 interface functions:

  • Geometry.to_gds(filename: str, layer: Tuple[NonNegativeInt, NonNegativeInt])
  • Structure.to_gds(filename: str, layer: Tuple[NonNegativeInt, NonNegativeInt], permittivity_threshold: PositiveFloat = None)
  • Simulation.to_gds(filename: str, layer_map: Dict[MediumType, Tuple[NonNegativeInt, NonNegativeInt]] = {}, permittivity_threshold: PositiveFloat = None)

For the geometry, it seems quite straightforward to just use Geometry.intersections_plane. For structures with custom medium, we use threshold parameter and intersect the actual geometry shape with the contour from AbstractCustomMedium.eps_diagonal_on_grid (using the coordinates from geometry bounds and the maximum value in the diagonal).

@tylerflex
Copy link
Collaborator Author

This sounds good to me, so as an edge case, how do we treat geometry group / clip operations? as a single layer?

@lucas-flexcompute
Copy link
Collaborator

Groups and clip operations also implement intersections_plane, so there's no need to treat them as special cases. And because they have a single medium (when used in a structure), all generated shapes will belong to the same layer.

lucas-flexcompute added a commit that referenced this issue Oct 6, 2023
Structures with custom medium are intersected with their medium contours
at a given permittivity threshold.

Signed-off-by: Lucas Heitzmann Gabrielli <lucas@flexcompute.com>
lucas-flexcompute added a commit that referenced this issue Oct 6, 2023
Structures with custom medium are intersected with their medium contours
at a given permittivity threshold.

Signed-off-by: Lucas Heitzmann Gabrielli <lucas@flexcompute.com>
lucas-flexcompute added a commit that referenced this issue Oct 12, 2023
Structures with custom medium are intersected with their medium contours
at a given permittivity threshold.

Signed-off-by: Lucas Heitzmann Gabrielli <lucas@flexcompute.com>
lucas-flexcompute added a commit that referenced this issue Oct 12, 2023
Structures with custom medium are intersected with their medium contours
at a given permittivity threshold.

Signed-off-by: Lucas Heitzmann Gabrielli <lucas@flexcompute.com>
@lucas-flexcompute
Copy link
Collaborator

Implemented in #1194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants