Skip to content

option to use PyVista for 3D plotting? #171

@banesullivan

Description

@banesullivan
Member

I'm thinking about adding changes to discretize that would leverage PyVista for 3D plotting if it is available. For example, I'm thinking about adding a condition for mesh.plotGrid that would call .to_vtk() and set up a PyVista figure rather than a Matplotlib figure:

Here's a current implementation (from this example):

ezgif com-video-to-gif-3

That same mesh can be plotted with PyVista:

ezgif com-video-to-gif-3

What are folks thoughts on this?

Activity

prisae

prisae commented on May 25, 2019

@prisae
Member

I would be all in for this! Thumbs up from me.

lheagy

lheagy commented on May 25, 2019

@lheagy
Member

👍 from me on this @banesullivan!! This would be great :)

lheagy

lheagy commented on May 25, 2019

@lheagy
Member

In terms of implementation, I think it would be nice to have a plotting_backend property (or similar) that can be set to pyvista, matplotlib (and potentially others), so that the user can switch between in the case that they want a matplotlib figure even if they have pyvista available. For the default though, 👍 on having pyvista be the default if available.

fourndo

fourndo commented on May 25, 2019

@fourndo
Member

Sounds great to able to spin it around.
I personally never use this call cause it's not very useful to look at a spaghetti of lines.
I would prefer seeing maybe three orthogonal sections in the middle?
Just a thought

banesullivan

banesullivan commented on May 25, 2019

@banesullivan
MemberAuthor

Thanks for the input everybody!

I would prefer seeing maybe three orthogonal sections in the middle?

That's an excellent idea - perhaps something like PyVista's .slice_orthogonal method (or the IPython slicer tool) that would perform the slicing and set up a render window?

thast

thast commented on May 25, 2019

@thast
Member

@micmitch experimented a lot on 3D visualization. Maybe worth to get his inputs too.

RichardScottOZ

RichardScottOZ commented on Apr 7, 2021

@RichardScottOZ

I would like to have it, anyway

dccowan

dccowan commented on Apr 7, 2021

@dccowan
Member

We did something similar in SimPEG recently with plotly. If the user has pyvista, they would have access to functionality that would call pyvista. If they don't have the package, no worries.

banesullivan

banesullivan commented on Apr 7, 2021

@banesullivan
MemberAuthor

I certainly dropped the ball on this one.

It should be fairly low-hanging fruit to implement this.

RichardScottOZ

RichardScottOZ commented on Apr 7, 2021

@RichardScottOZ

Might be a good Transform-2021 thing?

domfournier

domfournier commented on Apr 7, 2021

@domfournier
Contributor

Well that's exactly right @RichardScottOZ . My thought was to communicate through subsurface objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vizAnything about visualization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @fourndo@lheagy@prisae@dccowan@thast

        Issue actions

          option to use PyVista for 3D plotting? · Issue #171 · simpeg/discretize