Adjacent faces to a vertex of a vertex of a polytope

138 Views Asked by At

I am a total newbie in Matlab. For a given faces of a polytope, how can I collect adjacent faces of a vertex of a polytope in matlab? Example: v = [ -1 0 0 %vertex 1 1 0 0 %vertex 2 1 1 0 %vertex 3 0 1 0 %... 0 0 1 1 0 1 1 1 1 1 1 1 ];

% faces are defined by vertex number f = [ 1 2 6 5 %face 1 2 3 7 6 %face 2 3 4 8 7 %face 3 4 1 5 8 %... 1 2 3 4 5 6 7 8 ]; Here, the size of each vectors of 'f' can be different. How can I collect the adjacent faces of each vertex using matlab.

1

There are 1 best solutions below

0
On

Try the patch function

patch(v, f, 'r'), where v stays for the vector of the vertex, f for the faces, 'r' stays for red