%%%% dodec_02.ldf %%%% Created by Laurence D. Finston (LDF) Tue Oct 16 22:49:15 CEST 2007 %% $Id: dodec_02.ldf,v 1.7 2007/10/19 15:46:13 lfinsto1 Exp $ %% * (1) Copyright and License. %%%% This file is part of GNU 3DLDF, a package for three-dimensional drawing. %%%% Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 The Free Software Foundation, Inc. %%%% GNU 3DLDF is free software; you can redistribute it and/or modify %%%% it under the terms of the GNU General Public License as published by %%%% the Free Software Foundation; either version 3 of the License, or %%%% (at your option) any later version. %%%% GNU 3DLDF is distributed in the hope that it will be useful, %%%% but WITHOUT ANY WARRANTY; without even the implied warranty of %%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %%%% GNU General Public License for more details. %%%% You should have received a copy of the GNU General Public License %%%% along with GNU 3DLDF; if not, write to the Free Software %%%% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA %%%% GNU 3DLDF is a GNU package. %%%% It is part of the GNU Project of the %%%% Free Software Foundation %%%% and is published under the GNU General Public License. %%%% See the website http://www.gnu.org %%%% for more information. %%%% GNU 3DLDF is available for downloading from %%%% http://www.gnu.org/software/3dldf/LDF.html. %%%% Please send bug reports to Laurence.Finston@gmx.de %%%% The mailing list help-3dldf@gnu.org is available for people to %%%% ask other users for help. %%%% The mailing list info-3dldf@gnu.org is for sending %%%% announcements to users. To subscribe to these mailing lists, send an %%%% email with ``subscribe '' as the subject. %%%% The author can be contacted at: %%%% Laurence D. Finston %%%% c/o Free Software Foundation, Inc. %%%% 51 Franklin St, Fifth Floor %%%% Boston, MA 02110-1301 %%%% USA %%%% Laurence.Finston@gmx.de %% Run like this: %% 3dldf dodec_02.ldf %% mpost dodec_02.mp %% tex dodec_02.txt %% dvips -o dodec_02.ps dodec_02.dvi %% All on one line: if false: 3dldf dodec_02.ldf; mpost dodec_02.mp; tex dodec_02.txt; \ dvips -o dodec_02.ps dodec_02.dvi fi; %% View using Ghostview like this: %% gv dodec_02.ps & % * (1) Beginning of 3DLDF code. %% ** (2) draw_dodecahedron_net input "dodec_02.lmc"; %% *** (3) Global declarations and initializations focus f; set f with_position (3, 2, -20) with_direction (3, 2, 10) with_distance 20; polyhedron d[]; point p[]; point n[]; %% normals point c[]; %% centers reg_polygon r[]; string s; %% *** (3) Figure 1 beginfig(1); %% !!TODO: Find out why I couldn't make `path_pen' and `dot_pen' as typed %% arguments! %% LDF 2007.10.16. draw_dodecahedron_net {4, true, 6, .375mm, .75mm, identity}; endfig with_projection parallel_x_z no_sort; %% *** (3) Figure 2 beginfig(2); d0 := unit_dodecahedron scaled 2 rotated (180, 190); draw d0; for i = 0 upto 11: r[i] := get_reg_polygon (i) d0; c[i] := get_center r[i]; if false: s := decimal i; label(s, c[i]); fi; endfor; if false: for i = 0 upto 4: s := "$2_" & decimal i & "$"; label.top(s, get_point (i) r2); endfor; for i = 0 upto 4: s := "$9_" & decimal i & "$"; label.lft(s, get_point (i) r9); endfor; for i = 0 upto 4: s := "$10_" & decimal i & "$"; label.rt(s, get_point (i) r10); endfor; fi; label(1, c1); label(2, c2); label(9, c9); label(11, c11); label(10, c10); %label(2, c2) with_text_color red; %label.bot(1, c1) with_text_color blue; % filldraw r1 with_draw_color blue; % filldraw r2; % filldraw r0; % filldraw r6; filldraw r1; filldraw r2; filldraw r9; filldraw r10; filldraw r11; % filldraw r10; % filldraw r11; n1 := ((get_normal r1) * -1) shifted c1; %label.urt("$n_1$", n1) with_text_color blue; %drawarrow c1 -- n1 with_color blue; endfig with_focus f no_sort; %% *** (3) Figure 3 beginfig(3); d0 := unit_dodecahedron scaled 2 rotated (180, 10); draw d0; for i = 0 upto 11: r[i] := get_reg_polygon (i) d0; c[i] := get_center r[i]; if false: s := decimal i; label(s, c[i]); fi; endfor; filldraw r3; filldraw r4; filldraw r5; filldraw r7; filldraw r8; % draw r0; % draw r1; % draw r2; % draw r3; % draw r5; % draw r6; % draw r7; % draw r8; % draw r9; % draw r10; % draw r11; label(3, c3); label(4, c4); label(5, c5); label(7, c7); label(8, c8); endfig with_focus f no_sort; %% *** (3) Figure 4 beginfig(4); transform t[]; t0 := identity rotated (0, 0, -90); draw_dodecahedron_net {6, true, 6, .4mm, .75mm, t0}; rotate current_picture (0, -75); endfig with_projection parallel_x_z no_sort; %% *** (3) Figure 5. Pentagons for cutting out, 4cm. %% **** (4) Declarations path q[]; %% **** (4) Figure 5 beginfig(5); %% ***** (5) First pentagon, r0 r0 := unit_pentagon scaled 2; c0 := get_center r0; %label("$r_0$", c0); draw r0; for i = 0 upto 4: p[i] := get_point (i) r0; endfor; %dotlabel.top("$p_0$", p0); %dotlabel.top("$p_1$", p1); %dotlabel.top("$p_2$", p2); %dotlabel.top("$p_3$", p3); %dotlabel.top("$p_4$", p4); j := 0; for i = 0 upto 3: q[i] += --; p[10 + j] := unit_vector (p[i] - p[i + 1]) shifted p[i]; q[i] += p[10 + j]; j += 1; p[10 + j] := unit_vector (p[i + 1] - p[i]) shifted p[i + 1]; q[i] += p[10 + j]; j += 1; endfor; p[18] := unit_vector (p[4] - p[0]) shifted p[4]; p[19] := unit_vector (p[0] - p[4]) shifted p[0]; q[4] := p[18] -- p[19]; %dotlabel.top("$p_{10}$", p10); %dotlabel.top("$p_{11}$", p11); %dotlabel.top("$p_{12}$", p12); %dotlabel.top("$p_{13}$", p13); %dotlabel.top("$p_{14}$", p14); %dotlabel.top("$p_{15}$", p15); %dotlabel.top("$p_{16}$", p16); %dotlabel.top("$p_{17}$", p17); %dotlabel.top("$p_{18}$", p18); %dotlabel.top("$p_{19}$", p19); for i := 0 upto 4: draw q[i] dashed evenly; endfor; %% ***** (5) Second pentagon, r1 t0 := identity shifted by (p15 - p14); r1 := r0 transformed t0; draw r1; c1 := get_center r1; % %label("$r_1$", c1); for i = 0 upto 4: p[20 + i] := get_point (i) r1; q[20 + i] := q[i] transformed t0; draw q[20 + i] dashed evenly; endfor; for i = 0 upto 9: p[30 + i] := p[10 + i] transformed t0; endfor; %dotlabel.bot("$p_{20}$", p20); %dotlabel.bot("$p_{21}$", p21); %dotlabel.bot("$p_{22}$", p22); %dotlabel.bot("$p_{23}$", p23); %dotlabel.bot("$p_{24}$", p24); %dotlabel.bot("$p_{30}$", p30); %dotlabel.bot("$p_{31}$", p31); %dotlabel.bot("$p_{32}$", p32); %dotlabel.bot("$p_{33}$", p33); %dotlabel.bot("$p_{34}$", p34); %dotlabel.bot("$p_{35}$", p35); %dotlabel.bot("$p_{36}$", p36); %dotlabel.bot("$p_{37}$", p37); %dotlabel.bot("$p_{38}$", p38); %dotlabel.bot("$p_{39}$", p39); %% ***** (5) Third pentagon, r2 r2 := r1 transformed t0; c2 := get_center r2; % %label("$r_2$", c2); draw r2; for i = 0 upto 4: p[40 + i] := get_point (i) r2; q[40 + i] := q[i + 20] transformed t0; draw q[40 + i] dashed evenly; endfor; for i = 0 upto 9: p[50 + i] := p[30 + i] transformed t0; endfor; %dotlabel.bot("$p_{40}$", p40); %dotlabel.bot("$p_{41}$", p41); %dotlabel.bot("$p_{42}$", p42); %dotlabel.bot("$p_{43}$", p43); %dotlabel.bot("$p_{44}$", p44); %dotlabel.bot("$p_{50}$", p50); %dotlabel.bot("$p_{51}$", p51); %dotlabel.bot("$p_{52}$", p52); %dotlabel.bot("$p_{53}$", p53); %dotlabel.bot("$p_{54}$", p54); %dotlabel.bot("$p_{55}$", p55); %dotlabel.bot("$p_{56}$", p56); %dotlabel.bot("$p_{57}$", p57); %dotlabel.bot("$p_{58}$", p58); %dotlabel.bot("$p_{59}$", p59); %% ***** (5) Fourth pentagon, r3 r3 := r2 transformed t0; c3 := get_center r3; % %label("$r_3$", c3); draw r3; for i = 0 upto 4: p[60 + i] := get_point (i) r3; q[60 + i] := q[i + 40] transformed t0; draw q[60 + i] dashed evenly; endfor; for i = 0 upto 9: p[70 + i] := p[50 + i] transformed t0; endfor; %dotlabel.bot("$p_{60}$", p60); %dotlabel.bot("$p_{61}$", p61); %dotlabel.bot("$p_{62}$", p62); %dotlabel.bot("$p_{63}$", p63); %dotlabel.bot("$p_{64}$", p64); %dotlabel.bot("$p_{70}$", p70); %dotlabel.bot("$p_{71}$", p71); %dotlabel.bot("$p_{72}$", p72); %dotlabel.bot("$p_{73}$", p73); %dotlabel.bot("$p_{74}$", p74); %dotlabel.bot("$p_{75}$", p75); %dotlabel.bot("$p_{76}$", p76); %dotlabel.bot("$p_{77}$", p77); %dotlabel.bot("$p_{78}$", p78); %dotlabel.bot("$p_{79}$", p79); %for i = 0 upto 3: % filldraw r[i]; %endfor; %% ***** (5) Second row t0 := identity shifted by (p16 - p17); for i = 0 upto 3: c[i] *= r[i] *= t0; s := "$r_{" & decimal i & "}$"; draw r[i]; % label(s, c[i]); endfor; for i = 0 upto 4: q[i] *= q[20 + i] *= q[40 + i] *= q[60 + i] *= t0; draw q[i] dashed evenly; draw q[20 + i] dashed evenly; draw q[40 + i] dashed evenly; draw q[60 + i] dashed evenly; endfor; %% ***** (5) Third row t1 := identity shifted by (p13 - p12); for i = 0 upto 3: s := "$r_{" & decimal i & "}$"; c[i] *= r[i] *= t1; draw r[i]; % label(s, c[i]); endfor; for i = 0 upto 4: q[i] *= q[20 + i] *= q[40 + i] *= q[60 + i] *= t1; draw q[i] dashed evenly; draw q[20 + i] dashed evenly; draw q[40 + i] dashed evenly; draw q[60 + i] dashed evenly; % label(s, c[i]); endfor; %% ***** (5) Fourth row for i = 0 upto 3: s := "$r_{" & decimal i & "}$"; c[i] *= r[i] *= t0; draw r[i]; % label(s, c[i]); endfor; for i = 0 upto 4: q[i] *= q[20 + i] *= q[40 + i] *= q[60 + i] *= t0; draw q[i] dashed evenly; draw q[20 + i] dashed evenly; draw q[40 + i] dashed evenly; draw q[60 + i] dashed evenly; endfor; %% ***** (5) Fifth row for i = 0 upto 3: s := "$r_{" & decimal i & "}$"; c[i] *= r[i] *= t1; draw r[i]; % label(s, c[i]); endfor; for i = 0 upto 4: q[i] *= q[20 + i] *= q[40 + i] *= q[60 + i] *= t1; draw q[i] dashed evenly; draw q[20 + i] dashed evenly; draw q[40 + i] dashed evenly; draw q[60 + i] dashed evenly; endfor; %% ***** (5) Sixth row for i = 0 upto 3: s := "$r_{" & decimal i & "}$"; c[i] *= r[i] *= t0; draw r[i]; % label(s, c[i]); endfor; for i = 0 upto 4: q[i] *= q[20 + i] *= q[40 + i] *= q[60 + i] *= t0; draw q[i] dashed evenly; draw q[20 + i] dashed evenly; draw q[40 + i] dashed evenly; draw q[60 + i] dashed evenly; endfor; %% ***** (5) End of figure 5 endfig with_projection parallel_x_z no_sort; %% *** (3) Figure 6 beginfig(6); %% ***** (5) First pentagon, r0 r0 := unit_pentagon scaled 3; draw r0; c0 := get_center r0; % %label("$r_0$", c0); for i = 0 upto 4: p[i] := get_point (i) r0; endfor; %dotlabel.top("$p_0$", p0); %dotlabel.top("$p_1$", p1); %dotlabel.top("$p_2$", p2); %dotlabel.top("$p_3$", p3); %dotlabel.top("$p_4$", p4); j := 0; for i = 0 upto 3: q[i] := null_path; q[i] += --; p[10 + j] := unit_vector (p[i] - p[i + 1]) shifted p[i]; q[i] += p[10 + j]; j += 1; p[10 + j] := unit_vector (p[i + 1] - p[i]) shifted p[i + 1]; q[i] += p[10 + j]; j += 1; draw q[i] dashed evenly; endfor; p[18] := unit_vector (p[4] - p[0]) shifted p[4]; p[19] := unit_vector (p[0] - p[4]) shifted p[0]; q[4] := p[18] -- p[19]; draw q[4] dashed evenly; %dotlabel.top("$p_{10}$", p10); %dotlabel.top("$p_{11}$", p11); %dotlabel.top("$p_{12}$", p12); %dotlabel.top("$p_{13}$", p13); %dotlabel.top("$p_{14}$", p14); %dotlabel.top("$p_{15}$", p15); %dotlabel.top("$p_{16}$", p16); %dotlabel.top("$p_{17}$", p17); %dotlabel.top("$p_{18}$", p18); %dotlabel.top("$p_{19}$", p19); %% ***** (5) Second pentagon, r1 p100 := p15 shifted 1; t0 := identity shifted by (p100 - p14); r1 := r0 transformed t0; c1 := get_center r1; % %label("$r_1$", c1); draw r1; for i = 0 upto 4: p[20 + i] := get_point (i) r1; q[20 + i] := q[i] transformed t0; draw q[20 + i] dashed evenly; endfor; for i = 0 upto 9: p[30 + i] := p[10 + i] transformed t0; endfor; %dotlabel.bot("$p_{20}$", p20); %dotlabel.bot("$p_{21}$", p21); %dotlabel.bot("$p_{22}$", p22); %dotlabel.bot("$p_{23}$", p23); %dotlabel.bot("$p_{24}$", p24); %dotlabel.bot("$p_{30}$", p30); %dotlabel.bot("$p_{31}$", p31); %dotlabel.bot("$p_{32}$", p32); %dotlabel.bot("$p_{33}$", p33); %dotlabel.bot("$p_{34}$", p34); %dotlabel.bot("$p_{35}$", p35); %dotlabel.bot("$p_{36}$", p36); %dotlabel.bot("$p_{37}$", p37); %dotlabel.bot("$p_{38}$", p38); %dotlabel.bot("$p_{39}$", p39); %% ***** (5) Third pentagon, r2 r2 := r1 transformed t0; c2 := get_center r2; % %label("$r_2$", c2); draw r2; for i = 0 upto 4: p[40 + i] := get_point (i) r2; q[40 + i] := q[i + 20] transformed t0; draw q[40 + i] dashed evenly; endfor; for i = 0 upto 9: p[50 + i] := p[30 + i] transformed t0; endfor; %dotlabel.bot("$p_{40}$", p40); %dotlabel.bot("$p_{41}$", p41); %dotlabel.bot("$p_{42}$", p42); %dotlabel.bot("$p_{43}$", p43); %dotlabel.bot("$p_{44}$", p44); %dotlabel.bot("$p_{50}$", p50); %dotlabel.bot("$p_{51}$", p51); %dotlabel.bot("$p_{52}$", p52); %dotlabel.bot("$p_{53}$", p53); %dotlabel.bot("$p_{54}$", p54); %dotlabel.bot("$p_{55}$", p55); %dotlabel.bot("$p_{56}$", p56); %dotlabel.bot("$p_{57}$", p57); %dotlabel.bot("$p_{58}$", p58); %dotlabel.bot("$p_{59}$", p59); %% ***** (5) Second row t0 := identity shifted (0, 0, -6); for i = 0 upto 2: s := "$r_{" & decimal i & "}$"; c[i] *= r[i] *= t0; draw r[i]; % label(s, c[i]); endfor; for i = 0 upto 4: q[i] *= q[20 + i] *= q[40 + i] *= q[60 + i] *= t0; draw q[i] dashed evenly; draw q[20 + i] dashed evenly; draw q[40 + i] dashed evenly; draw q[60 + i] dashed evenly; endfor; %% ***** (5) Third row for i = 0 upto 2: s := "$r_{" & decimal i & "}$"; c[i] *= r[i] *= t0; draw r[i]; % label(s, c[i]); endfor; for i = 0 upto 4: q[i] *= q[20 + i] *= q[40 + i] *= q[60 + i] *= t0; draw q[i] dashed evenly; draw q[20 + i] dashed evenly; draw q[40 + i] dashed evenly; draw q[60 + i] dashed evenly; endfor; %% ***** (5) Fourth row for i = 0 upto 2: s := "$r_{" & decimal i & "}$"; c[i] *= r[i] *= t0; draw r[i]; % label(s, c[i]); endfor; for i = 0 upto 4: q[i] *= q[20 + i] *= q[40 + i] *= q[60 + i] *= t0; draw q[i] dashed evenly; draw q[20 + i] dashed evenly; draw q[40 + i] dashed evenly; draw q[60 + i] dashed evenly; endfor; %% ***** (5) End of figure 6 endfig with_projection parallel_x_z no_sort; %% **** (4) %% *** (3) End of 3DLDF code verbatim_metapost "end;"; end; %% ** (2) %% * (1) Emacs-Lisp code for use in indirect buffers when using the %% GNU Emacs editor. The local variable list is not evaluated when an %% indirect buffer is visited, so it's necessary to evaluate the %% following s-expression in order to use the facilities normally %% accessed via the local variables list. %% \initials{LDF 2004.02.12}. %% (progn (metafont-mode) (outline-minor-mode t) (setq fill-column 80)) %% * (1) Local variables for Emacs. %% Local Variables: %% mode:Metafont %% eval:(outline-minor-mode t) %% eval:(read-abbrev-file abbrev-file-name) %% outline-regexp:"%% [*\f]+" %% End: