marcomusy / vedo

A python module for scientific analysis of 3D data based on VTK and Numpy
https://vedo.embl.es
MIT License
2.06k stars 267 forks source link

when i run the example, the err is following #440

Closed subenyu closed 3 years ago

subenyu commented 3 years ago

No module named '_vtkmodules_static' """ from vedo import *

ug = UGrid(dataurl+'C:/Users/user/Desktop/111/resistivity.vtk')

ug.c('g',0.2).lc('r').lw(2) ug.cutWithPlane(origin=(5,0,1), normal=(1,1,5))

msh = ug.tomesh(shrink=0.8) # return a polygonal Mesh

show([(ug, doc), msh], N=2, axes=1, viewup='z').close()

marcomusy commented 3 years ago

Remove dataurl.

subenyu commented 3 years ago

Thank you very much and it can work now.

from vedo import Plotter

def slider1(widget, event):
    value = widget.GetRepresentation().GetValue()
    mesh.color(value)

def slider2(widget, event):
    value = widget.GetRepresentation().GetValue()
    mesh.alpha(value)

plt = Plotter(axes=0)
mesh = plt.load("C:/Users/IBM4/Desktop/1/magnolia.vtk")

mesh = plt.load("C:/Users/IBM4/Desktop/1/resistivity.vtk")

plt.addSlider2D(slider1, -9, 9, value=0,
               pos="bottom-right", title="color number")

plt.addSlider2D(slider2, xmin=0.01, xmax=0.99, value=0.5, c="k",
                pos="bottom-right-vertical", title="alpha value (opacity=0.5)")

plt += __doc__
plt.show()
plt.close()