CREATEDURERPOLYHEDRON Create a mesh representing Durer's polyhedron . [V, F] = createDurerPolyhedron [V, E, F] = createDurerPolyhedron Returns a mesh data structure that represents Durer's polyhedron shown in "Melancholia". Vertices are stored in V as Nv-by-3 array of 3D coordinates, faces are stored in Nf-by-1 cell array containing the vertex indices of each face. Several hypotheses exist on the exact geometry of the solid. The one described in Mathworld (see references) is used here. Durer's polyhedron is generated from a centered unit cube. Several transforms are applied succesively: * Rotation around Oz by PI / 4 * Rotation around Oy by asec(sqrt(3)) * z-scaling by sqrt(1 + 3 / sqrt(5) ) * truncation by two horizontal planes located at a distance of (3 - sqrt(5)) / 2 from each azimutal vertex. Durer's polyhedron is composed of six pentagonal faces and 2 triangular faces. Pentagonal faces have angles 126, 108, 72, 108, and 126 degrees. triangular faces are equilateral. Example % Display Durer's polyhedron [v f] = createDurerPolyhedron; figure; hold on; set(gcf, 'renderer', 'opengl'); drawMesh(v, f, 'FaceColor', [.7 .7 .7]); axis equal; axis([-1 1 -1 1 -1 1]); view(3) See also meshes3d, createCube, createOctahedron References http://mathworld.wolfram.com/DuerersSolid.html http://en.wikipedia.org/wiki/Dürer_graph
0001 function varargout = createDurerPolyhedron(varargin) 0002 %CREATEDURERPOLYHEDRON Create a mesh representing Durer's polyhedron . 0003 % 0004 % [V, F] = createDurerPolyhedron 0005 % [V, E, F] = createDurerPolyhedron 0006 % Returns a mesh data structure that represents Durer's polyhedron shown 0007 % in "Melancholia". Vertices are stored in V as Nv-by-3 array of 3D 0008 % coordinates, faces are stored in Nf-by-1 cell array containing the 0009 % vertex indices of each face. 0010 % Several hypotheses exist on the exact geometry of the solid. The one 0011 % described in Mathworld (see references) is used here. 0012 % 0013 % Durer's polyhedron is generated from a centered unit cube. Several 0014 % transforms are applied succesively: 0015 % * Rotation around Oz by PI / 4 0016 % * Rotation around Oy by asec(sqrt(3)) 0017 % * z-scaling by sqrt(1 + 3 / sqrt(5) ) 0018 % * truncation by two horizontal planes located at a distance of 0019 % (3 - sqrt(5)) / 2 from each azimutal vertex. 0020 % 0021 % Durer's polyhedron is composed of six pentagonal faces and 2 triangular 0022 % faces. Pentagonal faces have angles 126, 108, 72, 108, and 126 degrees. 0023 % triangular faces are equilateral. 0024 % 0025 % Example 0026 % % Display Durer's polyhedron 0027 % [v f] = createDurerPolyhedron; 0028 % figure; hold on; set(gcf, 'renderer', 'opengl'); 0029 % drawMesh(v, f, 'FaceColor', [.7 .7 .7]); 0030 % axis equal; axis([-1 1 -1 1 -1 1]); 0031 % view(3) 0032 % 0033 % See also 0034 % meshes3d, createCube, createOctahedron 0035 % 0036 % References 0037 % http://mathworld.wolfram.com/DuerersSolid.html 0038 % http://en.wikipedia.org/wiki/Dürer_graph 0039 0040 % ------ 0041 % Author: David Legland 0042 % E-mail: david.legland@inrae.fr 0043 % Created: 2012-07-31, using Matlab 7.9.0.529 (R2009b) 0044 % Copyright 2012-2024 INRA - Cepia Software Platform 0045 0046 % start from a cube basis 0047 [v, f] = createCube; 0048 0049 % recenter, rotate, and rescale 0050 v = v -.5; 0051 rot1 = createRotationOz(pi/4); 0052 rot2 = createRotationOy(asec(sqrt(3))); 0053 sca = createScaling3d([1 1 sqrt(1+3/sqrt(5))]); 0054 v = transformPoint3d(v, sca * rot2 * rot1); 0055 0056 % compute the height of the two clipping planes 0057 d = (3 - sqrt(5)) / 2; 0058 zmax = max(v(:,3)); 0059 z1 = zmax - d; 0060 0061 % clip by two horizontal planes 0062 plane1 = createPlane([0 0 z1], [0 0 1]); 0063 [v, f] = clipConvexPolyhedronByPlane(v, f, plane1); 0064 plane2 = createPlane([0 0 -z1], [0 0 -1]); 0065 [v, f] = clipConvexPolyhedronByPlane(v, f, plane2); 0066 0067 % complete with edge information 0068 e = meshEdges(f); 0069 0070 % format output 0071 varargout = formatMeshOutput(nargout, v, e, f);