function polyhedron=Polyhedra(ptype); %one of five regular polyhedra %in a format consistent with hieracrhical %modeler scaled to fit inside a unit sphere if (strcmp(ptype,'tetrahedron')) polyhedron.vertices=[... 0.453608 0.890430 0.037037 0.544331 -0.628540 -0.555555 -0.090722 -0.366647 0.925925 -0.907218 0.104757 -0.407407 ]; polyhedron.faces=1+[... 0 1 2 0 1 3 0 2 3 1 2 3 ]; elseif (strcmp(ptype,'cube')) polyhedron.vertices=0.5774*[... 0 0 0; 1 0 0; 1 1 0; 0 1 0; ... 0 0 1; 1 0 1; 1 1 1; 0 1 1;] ; polyhedron.vertices=polyhedron.vertices *2 - 0.5774; polyhedron.faces=[ 1 2 6 5; 2 3 7 6; 3 4 8 7; 4 1 5 8; ... 1 2 3 4; 5 6 7 8; ] ; elseif (strcmp(ptype,'octahedron')) polyhedron.vertices=[... 0.408248 0.707107 -0.577350 0.408248 -0.707107 -0.577350 0.816496 0.000000 0.577350 -0.408248 0.707107 0.577350 -0.408248 -0.707107 0.577350 -0.816496 0.000000 -0.577350 ]; polyhedron.faces=1+[... 3 2 0 3 0 5 5 0 1 0 2 1 3 5 4 5 1 4 4 1 2 4 2 3 ]; elseif (strcmp(ptype,'dodecahedron')) polyhedron.vertices=[... 0.175988 0.745447 -0.642912 0.230032 0.972675 0.031428 0.276500 -0.379561 -0.882882 0.392664 -0.847627 -0.356851 0.417990 0.215329 0.882563 0.480109 -0.479965 0.734253 0.643598 0.214231 -0.734769 0.731044 0.581893 0.356335 0.831555 -0.543116 0.116366 0.986641 0.113149 -0.117200 -0.175988 -0.745447 0.642912 -0.230033 -0.972675 -0.031428 -0.276499 0.379562 0.882882 -0.392664 0.847627 0.356851 -0.417989 -0.215329 -0.882563 -0.480109 0.479965 -0.734254 -0.643598 -0.214231 0.734769 -0.731044 -0.581893 -0.356336 -0.831555 0.543115 -0.116366 -0.986641 -0.113149 0.117200 ]; polyhedron.faces=1+[... 17 19 18 18 15 14 17 18 14 1 0 15 15 18 13 1 15 13 6 2 14 14 15 0 6 14 0 3 11 17 17 14 2 3 17 2 10 16 19 19 17 11 10 19 11 12 13 18 18 19 16 12 18 16 16 10 5 5 4 12 16 5 12 11 3 8 8 5 10 11 8 10 2 6 9 9 8 3 2 9 3 0 1 7 7 9 6 0 7 6 13 12 4 4 7 1 13 4 1 7 4 5 5 8 9 7 5 9 ]; elseif (strcmp(ptype,'icosahedron')) polyhedron.vertices=[... 0.250254 -0.916162 -0.313083 0.320072 -0.078054 -0.944171 0.437594 -0.598061 0.671442 0.550563 0.758025 -0.349682 0.623196 0.436642 0.648821 0.975676 -0.177816 -0.128204 -0.250253 0.916161 0.313082 -0.320073 0.078054 0.944172 -0.437593 0.598061 -0.671442 -0.550563 -0.758024 0.349683 -0.623195 -0.436643 -0.648822 -0.975676 0.177817 0.128204 ]; polyhedron.faces=1+[... 3 4 5 4 7 2 3 5 1 5 2 0 3 1 8 1 0 10 3 8 6 8 10 11 3 6 4 6 11 7 2 5 4 9 2 7 0 1 5 9 0 2 10 8 1 9 10 0 11 6 8 9 11 10 7 4 6 9 7 11 ]; else error('type must be:tetrahedron, cube, octahedron,dodecahedron,icosahedron'); end