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 plotting of 2d objects #1643

Merged
merged 1 commit into from
Apr 29, 2024
Merged

Conversation

dmarek-flex
Copy link
Contributor

@dmarek-flex dmarek-flex commented Apr 26, 2024

Found and issue with plotting Transformed objects that happen to have 0 thickness. The problem was that no intersections were found when using Trimesh to compute intersections. This is because all of the triangles were directly coincident on the intersection plane. This will not happen for fully 3D geometries.

I fixed it by reverting to simple intersection computations when the plane happens to be aligned with an axis. Another option would have been to give the object a very small thickness before meshing.

With this fix, I can correctly display geometries like:

image

@dmarek-flex dmarek-flex self-assigned this Apr 26, 2024
@dmarek-flex dmarek-flex added the Bug something isnt working label Apr 26, 2024
Copy link
Collaborator

@lucas-flexcompute lucas-flexcompute left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Collaborator

@tylerflex tylerflex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation looks good. A question about changing the intersections_tilted_plane method name. Do we need to do this? I'm worried it will cause complications but am not sure about specifically where this would come up.

If we do change it, we might want to deprecate that method first (eg. call the _do_intersections_tilted_plane, but log a warning?

tidy3d/components/geometry/base.py Show resolved Hide resolved
@tylerflex
Copy link
Collaborator

Can you also add a changelog item? thanks

@dmarek-flex dmarek-flex force-pushed the dmarek/fix_display_2D_objects branch from 55bf5f4 to 790936f Compare April 29, 2024 14:54
@tylerflex tylerflex self-requested a review April 29, 2024 16:03
@dmarek-flex dmarek-flex merged commit 2a12b64 into pre/2.7 Apr 29, 2024
4 of 16 checks passed
@dmarek-flex dmarek-flex deleted the dmarek/fix_display_2D_objects branch April 29, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug something isnt working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants