Вот минимальный воспроизводимый пример:
- файл .vtk размещен по адресу https://pomf2.lain.la/f/xg36ieja.vtk и
- точки находятся по адресу https://pomf2.lain.la/f/rprogbs9.npy
Код: Выделить всё
import pyvista as pv
import numpy as np
mesh = pv.read("xg36ieja.vtk")
mesh.set_active_scalars('Resistivity[Ohm-m]')
points = np.load("rprogbs9.npy")
pointset = pv.PointSet(points)
pointset_sample = pointset.sample(mesh)
print(pointset_sample.point_data['vtkValidPointMask'])
plot = pv.Plotter()
plot.add_mesh(pointset_sample, scalars = 'Resistivity[Ohm-m]', cmap = 'turbo_r',
render_points_as_spheres=True, point_size=20,
log_scale=True, clim=[5e0, 5e2])
plot.add_mesh(mesh, scalars = 'Resistivity[Ohm-m]', cmap = 'turbo_r',
opacity=0.3, show_edges=True, line_width=2, edge_opacity=1.0,
log_scale=True, clim=[5e0, 5e2])
plot.show()
Код: Выделить всё
[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]
Подробнее здесь: https://stackoverflow.com/questions/793 ... do-i-preve