I have a list of vertices of a simple 3D shape like a pyramid, a cube or a dodecahedron, is there an algorithm to find all the connections between the "outer vertices" that make up a face? Face being the regular 2d shape (square for a cube, triagles for a pyramid...)
for example, once projected a pyramid to 2D I have a matrix of 8 coordinates x,y for each vertice: int[] coords = new int [8][2]
and came up with this way of calculating them
for(int i = 0; i<4; i++){
for(int a = 1; a<=4; a++){
if(i+a!=3){
if(a>i){
edges.add(new Line( coords[i][0] * GROWTH + displacement ,
coords[i][1] * GROWTH + displacement,
coords[a][0] * GROWTH + displacement,
coords[a][1] * GROWTH + displacement));
}
}
}
}
This only works with pyramids, I wonder if there's a way of calculating all the edges of a given [n][2] set of coordinates representing a projected 3D shape.