polyscope icon indicating copy to clipboard operation
polyscope copied to clipboard

Enhance mouse click return

Open otmanon opened this issue 4 years ago • 3 comments

Currently polyscope.get_selection() in python only returns the face/cell you clicked on. It would be super useful for animation and interaction if we could additionally get just a little more info like the position on the mesh of our click!

otmanon avatar Dec 17 '21 14:12 otmanon

This should probably be improved on the C++ side too :)

I think the right way to architect this is to give the structures functions which you can call on the mouse click to get extra structure-specific info. So the psuedocode would be something like:

structure, index, pos = polyscope.get_selection()
if structure is my_ps_mesh:
  barycoords = my_ps_mesh.get_barycoords_for_selection(index, pos)

etc

nmwsharp avatar Dec 17 '21 15:12 nmwsharp

while we're at it we should also expose/bind/document get_world_ray_from_mouse_click()

nmwsharp avatar Dec 17 '21 15:12 nmwsharp

This would be useful! Any plans to revisit this soon?

HarryRos avatar May 23 '23 18:05 HarryRos