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

Auto origin and width for plots #2492

Merged

Conversation

shimwell
Copy link
Member

This PR attempts to automate two arguments in the universe.plot method.

Currently the origin defaults to (0,0,0) which is often the center of the geometry. However this PR attempts to find the center of the geometry using the new bounding box class

Currently the width is set to (1,1) which is occasionally the size of the geometry. However this PR attempts to find the axis width for the user using the new bounding box class.

I think these new defaults will help users produce plots quicker and with less knowledge of the geometry being plotted.

However they might slow down the plotting for very large geometry where the bounding box takes time to calculate. In that case the user might want to specify the width and origin manually.

openmc/bounding_box.py Outdated Show resolved Hide resolved
openmc/universe.py Outdated Show resolved Hide resolved
openmc/universe.py Outdated Show resolved Hide resolved
openmc/bounding_box.py Outdated Show resolved Hide resolved
openmc/bounding_box.py Outdated Show resolved Hide resolved
openmc/universe.py Outdated Show resolved Hide resolved
openmc/universe.py Show resolved Hide resolved
openmc/universe.py Outdated Show resolved Hide resolved
openmc/universe.py Outdated Show resolved Hide resolved
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
Copy link
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

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

Thanks @shimwell!

@paulromano paulromano enabled auto-merge (squash) May 2, 2023 15:33
@shimwell shimwell added the Merging Soon PR will be merged in < 24 hrs if no further comments are made. label May 2, 2023
@paulromano paulromano merged commit 4248bef into openmc-dev:develop May 2, 2023
16 checks passed
pshriwise pushed a commit to pshriwise/openmc that referenced this pull request May 12, 2023
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merging Soon PR will be merged in < 24 hrs if no further comments are made.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants