ranahanocka / MeshCNN

Convolutional Neural Network for 3D meshes in PyTorch
MIT License
1.56k stars 314 forks source link

how to move up, down, right and left in Mesh object #80

Open yuvaramsingh94 opened 4 years ago

yuvaramsingh94 commented 4 years ago

Hi all, i have a doubt related to how to select next point in respective direction(up,down ...) in the mesh object created by the class Mesh. this class returns object with details related to vertex edge and so on . what I like to do is, after selecting a vertex (X) in the Mesh object, I want to find what will be the next vertex that is in contact with X(edge connection) in the respective direction(say up). in 2D we can just increase the value of the corresponding axis and arrive at the point . but, incase of 3D the next point in the direction cannot be just controlled by single axis (say move, rotate in x,y and z to achieve the next point). is there a way to achieve this so i can just move around the object in any direction.

ranahanocka commented 4 years ago

Hi @yuvaramsingh94 ,

In general, there are a few Mesh data-structures you can look at, which give adjacency information. For example, the "gemm_edges" or "edge_points". This gives the four vertices which are in each edges one ring: image

But note that there is no "global order" to the meshes. This is different than images, which have some notion of "up/down/left/right". The global list of mesh edges has no meaningful order.

For classification, we handle this order ambiguity with a global pooling (e.g average/max pooling), which is the max over the first feature dimension for all the edges, max over the second feature dimension for all the edges, and so on.

For segmentation the result is permutation equivariant. So an input list of edges passed through the network will give some resulting segmentation-per-edge. Now if you permute this list, the resulting segmentations will be permuted. This makes sense, since we segment each edge regardless of where it appears in the (arbitrary) global list of edges.