-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add support for geometry transformations #1203
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lucas-flexcompute this is really comprehensive and will be great to have. Thanks a lot. I jumped in to take a look before noticing this was a draft, so sorry if any of the comments were things that you just hadn't got to yet. Just a few initial thoughts as I read through things.
Very cool feature! Overall looks good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a quick look - looks good to me! I didn't fully understand all the intersection operation details - will go over it again when you finalize the PR.
a686776
to
c9a41d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lucas-flexcompute, I just have a set of minor comments / suggestions. Everything related to the functionality looks really good to me! I'm approving for when the comments are addressed / discussed.
Because of the discussion about the back-end processing, transformed slanted polyslabs should not be allowed, but if we add the validator in |
a734d61
to
b7e45cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just a few minor comments.
_ = np.linalg.inv(val) | ||
return val | ||
|
||
@pydantic.root_validator(skip_on_failure=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for adding skip_on_failure=True
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doesn't make much sense to use this validator if geometry
or transform
aren't really one of the expected types or the transform is singular. It'll just raise another error. Isn't that what skip_on_failure
means?
04471c3
to
f096d44
Compare
tidy3d/components/structure.py
Outdated
"""Prevents the creation of slanted polyslabs rotated out of plane.""" | ||
if ( | ||
isinstance(val, Transformed) | ||
and isinstance(val.geometry, PolySlab) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if a geometrygroup or clipper operator is transformed, and it contains a slanted polyslab? is it included here already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I guess not. We'll need a recursive check in this case. Let me think it through and change it.
Support is added through a new `Geometry` subclass: `Transformed` and a few convenience functions to instance it from other geometries. Related issues: - flexcompute/tidy3d-core#25 - flexcompute/tidy3d-core#339 Signed-off-by: Lucas Heitzmann Gabrielli <lucas@flexcompute.com>
f096d44
to
c440c80
Compare
Based on flexcompute/tidy3d#1203 Signed-off-by: Lucas Heitzmann Gabrielli <lucas@flexcompute.com>
Based on flexcompute/tidy3d#1203 Signed-off-by: Lucas Heitzmann Gabrielli <lucas@flexcompute.com>
Support is added through a new
Geometry
subclass:Transformed
and a few convenience functions to instance it from other geometries.Related issues: