martinRenou / Odysis

Jupyter Interactive Widgets library for 3-D mesh analysis
MIT License
15 stars 2 forks source link

PyVista compatibility #26

Closed banesullivan closed 5 years ago

banesullivan commented 5 years ago

Resolve #24

All PyVista mesh types can be passed to Mesh.from_vtk now

martinRenou commented 5 years ago

Thanks a lot for opening this PR!

banesullivan commented 5 years ago

Looks like all is working:

import pyvista as pv
from pyvista import examples

pvmesh = examples.download_st_helens().warp_by_scalar()
ugrid = pvmesh.cast_to_unstructured_grid()

import odysis as ody
mesh = ody.Mesh.from_vtk(ugrid)

ody.scene(mesh=mesh)
color = ody.color_mapping()
ody.plot()

2019-10-13 12 24 54

martinRenou commented 5 years ago

That is super cool!

banesullivan commented 5 years ago

@martinRenou, can you add the "Hacktoberfest" label to this PR? FYI, you should check out Hacktoberfest if you haven't already. You might also want to open issue with feature requests and add that label to try to solicit help from outside

banesullivan commented 5 years ago

This is ready to go from me. Let me know if you need changes.

Also, PyVista's examples module is packed with example datasets if you want to use them to show off what this library can do

martinRenou commented 5 years ago

Thanks again. This is greatly appreciated :)

benbovy commented 5 years ago

Wow this is great!