2

Is it possible to add new point (X, Y, Z) to PolyData points array, without creating new PolyData? I want to make new Triangulate Surface (TIN) really fast, but creating a new PolyData from NumPy array takes around 1 second. Meanwhile, e.g. function extrude (which creates new nodes) takes around 0.002s (technically I want to add 1 new node with known coordinates).

After I update PolyData I'm using "delaunay_2d" function (which takes also around 0.002s) and plot the results (TIN surface).

Or maybe somebody know other way to update and process XYZ data to TIN and visulize it around 10 times per second in Python 3? PyVista seems to be really, really cool, but I can't manage to make such a trivial thing: (

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
dany
  • 173
  • 1
  • 8

1 Answers1

0

It's possible to modify the points on a mesh with:

>>> import numpy as np
>>> import pyvista as pv
>>> mesh = pv.Sphere()
>>> print(mesh.n_points)
>>> mesh.points = np.vstack((mesh.points, [0, 0, 0]))
>>> print(mesh.n_points)
842
843
Alex Kaszynski
  • 1,817
  • 2
  • 17
  • 17
  • Looks like your comment didn't display property. Feel free to post an issue at https://github.com/pyvista/pyvista-support/issues, it might be easier there to have a code conversation. – Alex Kaszynski Sep 29 '20 at 14:22
  • 1
    Thank you! :D Issue posted on github – dany Sep 29 '20 at 15:36