Triangulated mesh and linked vertices

Hello,

I have an imported triangulated mesh geometry , with all of its vertices inside an arraylist. I am trying to organise the arraylist in a way that from each vertex I can access all the connected vertices to it, but I have no idea of how to do that. If anyone can help, it would be much appreciated.

Thanks for your time!

Answers

  • edited January 2016 Answer ✓

    I would suggest investigating https://en.wikipedia.org/wiki/Winged_edge and here: http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/model/winged-e.html This structure is used in the Wings3D modeler to contain mesh data for it's objects and it works very well. Here's an example of WE classes to work from:

    class WE_Edge {
      WE_Vertex vert1, vert2;
      WE_Face aFace, bFace;
      WE_Edge aPrev, aNext, bPrev, bNext; // clockwise ordering
      WE_EdgeDataObject data;
    }
    class WE_Vertex {
      List<WE_Edge> edges;
      WE_VertexDataObject data;
    }
    class WE_Face {
      List<WE_Edge> edges;
      WE_FaceDataObject data;
    }
    

    As for exactly how to do it in P3, you'll have to get creative. There are some good structures and functions under "Composite" in the language reference that can probably be used. Cheers.

  • thank you very much! I'll give it a try and see what I get

Sign In or Register to comment.