0

I have made a Python script which takes a mesh and the index of a vertex to apply an operation. Unfortunately, Trimesh -the library I use to process the mesh- does not have an option to select an vertex by clicking on it.

Is it possible to visually select an vertex on the mesh, get the identifier on on that vertex and pass it to another script? Is it worth using a 3rd party program like Meshlab or Blender to select that input or am I missing a more obvious route?

Jorge Diaz
  • 491
  • 5
  • 11
  • Did you ever make any headway with this. So far, the vertex indices unfortunately don't seem to match between meshlab and trimesh! – Dav Clark Dec 05 '20 at 22:34
  • @DavClark, sorry but it went nowhere. Had to scratch everything and stick with Python – Jorge Diaz Dec 07 '20 at 15:16

2 Answers2

0

Trimesh does not have a GUI, just some rendering tools. However, it has tons of features to programatically find vertices of interest if you are able to come up with rules or characteristics of it. The docs, source code examples, and issues all have useful implementations to browse through.

wwwslinger
  • 936
  • 8
  • 14
0

This borders on not answering "the question" but you do mention using third party tools as questions within your explanation, so...

I didn't get to implementing this in trimesh / Python. I used Meshlab to select the vertices I wanted, and manually copied the indices over to Python variables. Trimesh will re-order vertices as part of its optimization process. So if you go this route, be sure to use process=False to maintain vertex order. E.g.:

trimesh.load('./my.obj', process=False)
Dav Clark
  • 1,430
  • 1
  • 13
  • 26