Can I pick cells in mesh using mouse? How to? #751
-
Dear Marco, |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
you can use a callback function, eg from vedo import *
def callb(evt):
msh = evt.actor
if not msh:
return
pt = evt.picked3d
idcell = msh.closest_point(pt, return_cell_id=True)
msh.cellcolors[idcell] = [255,0,0,255] # red, opaque
m = Mesh(dataurl + "290.vtk")
m.decimate().smooth().compute_normals()
m.compute_quality().cmap("Blues", on="cells")
plt = Plotter()
plt.add_callback("mouse click", callb)
plt.show(m, m.labels("cellid"))
plt.close() |
Beta Was this translation helpful? Give feedback.
-
Hi Marco @marcomusy , Call for help~. 🙂 |
Beta Was this translation helpful? Give feedback.
-
Hi
I use Wing as my IDE. The problem so weird. I suppose the problem maybe disappear someday just like it appeared. |
Beta Was this translation helpful? Give feedback.
-
You have an old version of vedo! try
|
Beta Was this translation helpful? Give feedback.
you can use a callback function, eg