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 static mesh, new shapes and variable render resolution #47

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

phohenberger
Copy link
Contributor

  • Add option for meshes to be static, meaning they will only be loaded in once and not changed during the following frames. This significantly improves rendering time for a larger non-moving mesh.
    Can be added to vis.Particle and vis.VectorField by simply giving them the static = True parameter.
    Note that static objects only take in position in the shape of (n_part, n_dim)
  • Add 7 more mesh shapes. Box, Cone, Icosahedron, Octahedron, Tetrahedron, Torus and MobiusLoop
  • Allow to choose the render resolution and samples per pixel for screenshots or exported videos. Default is resolution = [4096, 2160] and spp = 64

Copy link
Member

@SamTov SamTov left a comment

Choose a reason for hiding this comment

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

Great PR! I have a few comments on the mesh objects I would like to discuss briefly. But overall it looks great.

On a second point, I think we can clean up the data flow in the visualiser and the renderer, however, I think this calls for a different PR so we can shelve that for now. Just check out my mesh comments and we can merge the PR.

znvis/mesh/box.py Outdated Show resolved Hide resolved
znvis/mesh/cone.py Outdated Show resolved Hide resolved
znvis/mesh/icosahedron.py Show resolved Hide resolved
@phohenberger
Copy link
Contributor Author

I moved the mesh instantiation to the parent mesh-class. The child-classes now only need a create_mesh function which relies on the specific shape parameters. This reduces the repeated code significantly. What do you think @SamTov

@phohenberger
Copy link
Contributor Author

phohenberger commented Jul 2, 2024

Shapes like Arrow or CustomMesh are special cases and need to overwrite a function in the mesh parent-class. But i think this is still a good solution as they need to instantiate differently and that cannot be generalized.

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

Successfully merging this pull request may close these issues.

None yet

2 participants