How do you represent a closed shape mathematically?

I might like to explore scripting, and I'd like to understand mathematically how blender represents a closed shape. Is it a 3xN matrix, an Nx3 matrix? You can represent vertices as vectors, but how do you represent which ones are connected so as to form a closed surface? How do you tell a computer what "closed" means?

1 love
Reply
  • Martin Bergwerf replied

    It depends on what you mean by 'closed', but if you mean Manifold, than you can go through all the Edges and check if every Edge has exactly 2 neighbouring Faces.

    1 love
  • Martin Bergwerf replied

    Or maybe you mean something this:

    A Mesh is written as a 'list' of indexed Vertices and their Positions (mathematically not Vectors). Then a list of indexed Edges and which Vertices they connect and then a list of Faces and which Edges they are surrounded by. 

    1 love