fdtd icon indicating copy to clipboard operation
fdtd copied to clipboard

Paraview exporting with pyEVTK

Open 0xDBFB7 opened this issue 3 years ago • 4 comments

When testing 3D geometries, it seemed pretty helpful to dump .vtk files with object and field grids. The pyEVTK lib makes this pretty clean, might perhaps be worth an optional dependency?

On the other hand, perhaps this is something best handled by user code...

0xDBFB7 avatar Apr 27 '21 20:04 0xDBFB7

I think this is something that fits pretty well in fdtd.visualize. It's indeed something that generally speaking can be useful to handle in user code too, but I think having a default way of visualizing in 3D is definitely something we need.

Feel free to open a PR for this, maybe just move the vtk related imports into the dump_to_vtk function to ensure this remains an optional dependency.

flaport avatar Apr 28 '21 09:04 flaport

I'd be happy to contribute an example showing how to integrate these simulations with napari a python multidimensional image viewer (note, I'm one of the maintainers of that package so am heavily biased!). We do 2D and 3D rendering, including timeseries, so should be able to cover the needs here. What's nice about the napari approach is I can be working on my simulations in a notebook and interacting with them in napari at the same time.

I've been using napari to visualize some of my own simulations, here's a 2D one with a lens :-)

https://user-images.githubusercontent.com/6531703/117239577-ec62a000-ade3-11eb-9c99-8d0eb35d377a.mov

sofroniewn avatar May 06 '21 03:05 sofroniewn

Hey @sofroniewn , This is pretty cool! I would definitely like to see a PR for such an example 🙂

flaport avatar May 06 '21 07:05 flaport

Hey @sofroniewn , This is pretty cool! I would definitely like to see a PR for such an example 🙂

Great, I'll try and put this together into an example script when I get a chance!

sofroniewn avatar May 06 '21 17:05 sofroniewn