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

mp.Volume(vertices=...) is not a bounding box (& is undocumented) #2906

Open
yurivict opened this issue Sep 9, 2024 · 1 comment
Open

mp.Volume(vertices=...) is not a bounding box (& is undocumented) #2906

yurivict opened this issue Sep 9, 2024 · 1 comment

Comments

@yurivict
Copy link

yurivict commented Sep 9, 2024

In the modified example bent-waveguide.ipynb the 'vertices' argument has 6 elements:
bent-waveguide-1.ipynb

The span of the vertices array is -1.5 .. +1.5 in both X and Y directions.
However, the displayed box is has the width < 1:
image

mp.Volume should either throw an exception if the vertices argument isn't valid, or it should display it properly.
The above shape doesn't make sense.

@stevengj
Copy link
Collaborator

stevengj commented Sep 9, 2024

@smartalecH added this vertices option to the mp.Volume construct in #910.

Right now, it uses the centroid (mean) of the vertices to determine the volume center, but to determine the volume size it only uses the first two elements of the vertex list?

It seems like it would be better to use define the volume as a bounding box for the vertices? In any case we should document precisely what this does. And we should emphasize that the final mp.Volume is a Cartesian box, not a polygon (see the confusion in #2905).

@smartalecH, I'm not 100% sure what the intended use of this feature is?

@stevengj stevengj changed the title The 'vertices' argument of mp.Volume results in a smaller area than the coordinates in vertices mp.Volume(vertices=...) is not a bounding box (& is undocumented) Sep 9, 2024
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

2 participants