CREATERHOMBODODECAHEDRON Create a 3D mesh representing a rhombododecahedron. [V, E, F] = createRhombododecahedron V is a 14-by-3 array with vertex coordinate, E is a 12-by-2 array containing indices of neighbour vertices, F is a 8-by-3 array containing vertices array of each face. [V, F] = createRhombododecahedron; Returns only the vertices and the face vertex indices. MESH = createRhombododecahedron; Returns the data as a mesh structure, with fields 'vertices', 'edges' and 'faces'. Example [v, e, f] = createRhombododecahedron; drawMesh(v, f); See also meshes3d, drawMesh
0001 function varargout = createRhombododecahedron() 0002 %CREATERHOMBODODECAHEDRON Create a 3D mesh representing a rhombododecahedron. 0003 % 0004 % [V, E, F] = createRhombododecahedron 0005 % V is a 14-by-3 array with vertex coordinate, 0006 % E is a 12-by-2 array containing indices of neighbour vertices, 0007 % F is a 8-by-3 array containing vertices array of each face. 0008 % 0009 % [V, F] = createRhombododecahedron; 0010 % Returns only the vertices and the face vertex indices. 0011 % 0012 % MESH = createRhombododecahedron; 0013 % Returns the data as a mesh structure, with fields 'vertices', 'edges' 0014 % and 'faces'. 0015 % 0016 % Example 0017 % [v, e, f] = createRhombododecahedron; 0018 % drawMesh(v, f); 0019 % 0020 % 0021 % See also 0022 % meshes3d, drawMesh 0023 0024 % ------ 0025 % Author: David Legland 0026 % E-mail: david.legland@inrae.fr 0027 % Created: 2005-02-10 0028 % Copyright 2005-2024 INRA - TPV URPOI - BIA IMASTE 0029 0030 nodes = [0 0 2;... 0031 1 -1 1;1 1 1;-1 1 1;-1 -1 1;... 0032 2 0 0;0 2 0;-2 0 0;0 -2 0;... 0033 1 -1 -1;1 1 -1;-1 1 -1;-1 -1 -1;... 0034 0 0 -2]; 0035 0036 edges = [... 0037 1 2;1 3;1 4;1 5;... 0038 2 6;2 9;3 6;3 7;4 7;4 8;5 8;5 9;... 0039 6 10;6 11;7 11;7 12;8 12;8 13;9 10;9 13; ... 0040 10 14;11 14;12 14;13 14]; 0041 0042 faces = [... 0043 1 2 6 3;... 0044 1 3 7 4;... 0045 1 4 8 5;... 0046 1 5 9 2;... 0047 2 9 10 6;... 0048 3 6 11 7;... 0049 4 7 12 8;... 0050 5 8 13 9;... 0051 6 10 14 11;... 0052 7 11 14 12;... 0053 8 12 14 13;... 0054 9 13 14 10]; 0055 0056 % format output 0057 varargout = formatMeshOutput(nargout, nodes, edges, faces); 0058