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

Add domain rendering script #5735

Merged
merged 1 commit into from
Feb 23, 2024
Merged

Conversation

nilsvu
Copy link
Member

@nilsvu nilsvu commented Feb 2, 2024

Shows elements and grid lines. A second high-resolution dataset can be used to draw smooth element outlines. This rendering is a starting point for visualizations of the domain geometry, e.g. for publications.

For example:

punctures_domain

Proposed changes

Upgrade instructions

Code review checklist

  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.
  • The PR lists upgrade instructions and is labeled bugfix or
    new feature if appropriate.

Further comments

@nilsvu nilsvu requested a review from yoonso0-0 February 2, 2024 08:30
@nilsvu nilsvu added the cli/pybindings Command line interface & Python bindings label Feb 11, 2024
@nilsvu nilsvu force-pushed the vis_domain branch 10 times, most recently from 3ed98e4 to ec31754 Compare February 21, 2024 01:03
@yoonso0-0
Copy link
Contributor

output

@yoonso0-0
Copy link
Contributor

yoonso0-0 commented Feb 21, 2024

It's working really well. Thanks for implementing this.

The above output image is what I get when I fix the clip normal to 0.0, 0.0, 1.0 (Z axis, default) but shifted the clip origin into 10.0, 0.0, 0.0. In principle it should show the same image as below :

output

Is this a paraview behavior or a bug is somewhere?

@nilsvu
Copy link
Member Author

nilsvu commented Feb 21, 2024

Should be fixed (see fixup commit). Camera positioning is a bit tricky with ParaView... I'm sure this can be made more robust, but I think this is ok for a start.

@yoonso0-0
Copy link
Contributor

Checked the fixup solved issue. Please squash

Shows elements and grid lines. This rendering is a starting point
for visualizations of the domain geometry, e.g. for publications.
Copy link
Contributor

@knelli2 knelli2 left a comment

Choose a reason for hiding this comment

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

Let me know if you want to do anything about my suggestion. Not necessary though

Comment on lines +177 to +178
camera.SetFocalPoint(*clip_origin)
camera.SetPosition(*(np.array(clip_origin) + np.array(clip_normal) * 10.0))
Copy link
Contributor

Choose a reason for hiding this comment

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

This factor of 10 seems a bit arbitrary. I could imagine this not working for a BBH with an outer boundary of like 1000.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually ParaView ignores this factor, so I kept it at 10 :D It sets the zoom factor automatically to show the entire domain. As I said above, we can surely make the camera handling better here, but I haven't played around with it enough to understand what ParaView actually does with the camera.

@knelli2 knelli2 merged commit 914b2e8 into sxs-collaboration:develop Feb 23, 2024
22 checks passed
@nilsvu nilsvu deleted the vis_domain branch March 12, 2024 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli/pybindings Command line interface & Python bindings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants