-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Method to calculate grid isosurfaces #246
Conversation
Codecov Report
@@ Coverage Diff @@
## master #246 +/- ##
==========================================
- Coverage 84.67% 84.63% -0.04%
==========================================
Files 131 131
Lines 20882 20907 +25
==========================================
+ Hits 17682 17695 +13
- Misses 3200 3212 +12
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks good!! :)
A few minor points and you are good to go :)
Everything is done now and I added some tests. I don't know how to specify that the test should fail if |
You simply do this: def test_<>(...):
pytest.importorskip("skimage", reason="scikit-image not available")
<body of test> |
Done 👍 |
Nick, I'm thinking now that instead of returning the vertices, faces, normals, etc... we could return an I'm not familiar with the implementation of shapes, is this possible? |
Good idea, but no.. :( But I will have it in mind if need be :) Thanks for the suggestions! |
Right, I was thinking only about closed isosurfaces, but I didn't notice that isosurfaces do not necessarily create a closed volume. |
When plotting grids with plotly I had the problem that non-orthogonal grids didn't make sense because there was no way to indicate the vectors of the cell.
I submitted an issue in plotly and they proposed a workaround, which is to calculate the isosurfaces first with
skimage.measure.marching_cubes
and then apply a transformation to the vertices to get their real coordinates taking into account the cell vectors.I thought that maybe this is useful for other cases, not only for the plotly visualization module. This would definitely be useful for representing the grids in blender (because it gives you all that you need to build a 3d mesh), and maybe for someone who wants to do some quantitative analysis with isosurfaces (I'm not sure when would this be useful).
If you think it is worth it to include this in the
Grid
class I will write some tests for it. Otherwise I will just do the isosurface calculation in the visualization module.Cheers!