PyVista is a helper module for the Visualization Toolkit (VTK) that takes a different approach on interfacing with VTK through NumPy and direct array access.
Questions tagged [pyvista]
147 questions
1
vote
1 answer
How to use different scalars for a mesh with subplots in pyvista?
I want to make a multi-window plot of varies scalars of 3D mesh and update it with new values.
Ques. 1 (resolved by setting key copy_mesh)
However, when I am plotting multiple scalars with a same mesh in one window, a similar problem (subplots are…

WCCC
- 11
- 2
1
vote
1 answer
How to access various Plotter methods outside my class?
I'm plotting a mesh with PyVista using UnstructuredGrid. It's going pretty well and I managed to plot the geometry I want using grid.plot().
I now want to access methods outside of UnstructuredGrid: for example, I want to be able to click and select…

man-teiv
- 419
- 3
- 16
1
vote
1 answer
How can I intersect 2 lines using PyVista?
I would like to intersect 2 lines using PyVista, get the coordinates of this intersection and plot the result.
I tried the following code:
import pyvista as pv
line1 = pv.Line(pointa=(-1,0,0), pointb=(2,0,0))
line2 = pv.Line(pointa=(0,-1,0),…

ChristianHS
- 25
- 3
1
vote
1 answer
Visualizing Error Between Two 3D Images using Marching Cubes
I am attempting to visualize the error between 2 3D nrrd images using marching cubes and Pyvista. I computed the Euclidean distance between the two images and am attempting to take the isosurface of an image and use the Euclidean distance…

glorfindel12
- 11
- 3
1
vote
1 answer
How can I intersect 2 planes using PyVista?
I want to intersect 2 planes using PyVista and visualize the result but I got an error.
I tried the following code:
import pyvista as pv
p1 = pv.Plane(center=(0, 0, 0), direction=(0, 0, 1))
p2 = pv.Plane(center=(0, 0, 0), direction=(1, 0,…

ChristianHS
- 25
- 3
1
vote
1 answer
How to write a pyvista PolyData to stream or in-memory Buffer?
The overall construct is an FastAPI Webserver to which a GemPy Model is send. This is then plotted as a 3D Model. From this I can extract the Layers as PyVista/VTK PolyData Objects. Until this point is works fine, however these Objects should idealy…

j_kaden
- 21
- 4
1
vote
1 answer
Extrude a concave, complex polygon in PyVista
I wish to take a concave and complex (containing holes) polygon and extrude it 'vertically' into a polyhedron, purely for visualisation. I begin with a shapely Polygon, like below:
poly = Polygon(
[(0,0), (10,0), (10,10), (5,8), (0,10), (1,7),…

Anti Earth
- 4,671
- 13
- 52
- 83
1
vote
1 answer
How do I create a custom constrained delaunay diagram in pyvista with a hole boundary inside the mesh?
I am working on a manual implementation of Ruppert's algorithm for my final project. The algorithm requires a constrained delaunay diagram as an input, which PyVista can produce by using the delaunay_2d() function. However, I am finding some…

Alexander Hu
- 21
- 2
1
vote
1 answer
PyVista download of examples raises error
I recently discovered PyVista (which looks awesome) and wanted to go through some of the examples. However, I get an error when running examples.download_ functions. For example, the lines
import pyvista as pv
from pyvista import examples
vol =…

Paul
- 211
- 1
- 8
1
vote
0 answers
Enabling/disabling renderer multiple times changes appearance of second actor in pyVista
I am trying to enable/disable interacting with a pyvista.renderer by means of a callback function. This works fine when only one actor is present in the scene. In the example below, pressing 's' activates and deactivates interacting with with the…

Harry Matthews
- 143
- 1
- 10
1
vote
1 answer
Getting coordinates of surface nodes using pyvista
I'm wondering if anyone could help me figure out how to apply pyvista to extract the surface nodes of a 3D object. For example, suppose I have a collection of points that builds out a sphere, including 'interior' and 'surface' points:
import numpy…

jim
- 175
- 8
1
vote
1 answer
How to extract and store x, z coordinates associated to a specific y coordinate on a UnstructuredGrid in Python?
Starting from an image I did some processing (like thresholding) and I obtained its representation as UnstructuredGrid using VTK and PyVista. I would like to create an array of shape (n, 3) filled with x, y, z coordinates associated with a specific…

MIM
- 11
- 2
1
vote
1 answer
How to set group name when exporting pyvista mesh to wavefront obj
I am generating some cylinder meshes from some csv data and adding them to a PyVista plotter, using this I then export them to an '.obj' file using the export_obj method. The problem is I want to associate a group name with each mesh inside the obj…

White Wizard
- 608
- 3
- 19
1
vote
0 answers
Why jupyter notebook or lab doesn't show an interactive pyvista scene?
I am unable to interact with pyvista plots either on jupyter notebook or lab. I am working on a geometric problem and want to check output of the code both in graphs and text (e.g., check vertex coordinates or face normals of a mesh). I get…

modinar
- 13
- 2
1
vote
1 answer
How to remove or replace the PyVista window icon?
How can I remove or change the PyVista render window's icon? I have tried to search the issue also from the docs but didn't find any answers.

user19520529
- 11
- 2