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

Support non-cube symmetry groups #3

Closed
roice3 opened this issue Mar 12, 2018 · 8 comments
Closed

Support non-cube symmetry groups #3

roice3 opened this issue Mar 12, 2018 · 8 comments

Comments

@roice3
Copy link
Collaborator

roice3 commented Mar 12, 2018

Henry pointed out that we need to be careful about performance because of the raymarching (cubes can be fast because of quick "inside" checking).

To do this generically and support any Wythoff construction, we'll need to iterate on simplices instead of cubes. That will allow supporting honeycombs like the {4,4,4} or non-loop Coxeter graphs. I guess we'll see how the speed goes with simplices and maybe there are some optimization tricks we can do to reduce the number of steps during ray marching.

@henryseg
Copy link
Collaborator

I suspect that the fastest way to do things may be to do checks in the Klein model - no acoshes or other nasty functions involved, just some dot products.

@henryseg
Copy link
Collaborator

This would also be a particularly good idea for when we do S^3 geometry. There the number of cells isn’t such a big deal, and we really want to be using non-cubes, since the hypercube {4,3,3} has so few cells that it’s hard to interpret what’s going on.

@roice3
Copy link
Collaborator Author

roice3 commented Mar 16, 2018

I wonder if we'll still be able to work in the Klein (i.e. gnomonic) model for S^3. Even though you only get a hemisphere, the far hemisphere repeats the near one (in terms of azimuthal angles). So I suspect it's possible, though it may end up easier to code functions for working in the conformal model.

@henryseg
Copy link
Collaborator

The Klein model is currently only used for checking if the camera is outside of the central cell. Everything else uses the hyperboloid model. For S^3, we can use the gnomonic model for this check, since the central cell will be inside of one hemisphere.

@roice3
Copy link
Collaborator Author

roice3 commented Mar 16, 2018

Perfect, ok!

@henryseg
Copy link
Collaborator

henryseg commented Apr 5, 2018

We could have different styles of cell - an arbitrary n-sided polyhedron, multiple polyhedra (?) or a fundamental simplex. We could, e.g.:

  • Have a cell that is a regular dodecahedron, with 12 checks for being outside, and 12 isometries to move you back in.
  • Have a fundamental simplex, as in the Wythoff construction
  • Have a cell made by gluing together a collection of ideal tetrahedra with various shapes - this would be useful for visualizing manifolds with data from https://www.math.uic.edu/t3m/SnapPy/
  • Alternatively, and maybe better, have a list of separate, unglued ideal tetrahedra. When you are seen to be outside of a tetrahedron, it tells you which other tetrahedron to teleport to as well as what the isometry needed is. With this setup, we wouldn't need to deal with non-convex polyhedra.

@roice3
Copy link
Collaborator Author

roice3 commented Apr 5, 2018

I like the idea of supporting the latter two options. Option 1 is just too specific and I suspect won't even have much of a performance advantage over doing dodecahedra via option 2. And option 2 allows hundreds upon hundreds of outputs. I would think we'd do option 2 first, which could lead naturally to following up with option 3.

I'm going to open a separate issue for the spherical honeycombs, because I think that has some special considerations.

@henryseg
Copy link
Collaborator

henryseg commented May 2, 2018

Currently, when tracing a ray through a cube cell, we query the signed distance function for the geometry within the cell then move that distance forward. If this step takes us outside the cell then we move by the appropriate isometry to get back inside the cell. This means that we can move quite some distance into the next cell, or even all the way through, skipping past some number of cells. We reset the position of the point back by the appropriate isometry and check again if we are inside.

This works at the moment because all local (within a cell) scenes are symmetric.

Does this still work with simplex cells replacing cube cells? I think so.

The alternative would be to stop the ray at the point that we reach the boundary of the cell, so we would always restart the ray from the boundary of the cell it is entering. But I don't think this is necessary.

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

3 participants