%%%% dodec_01.ldf %%%% Created by Laurence D. Finston (LDF) Thu Sep 27 17:57:57 CEST 2007 %% * (1) Copyright and License. %%%% This file is part of GNU 3DLDF, a package for three-dimensional drawing. %%%% Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 The Free Software Foundation %%%% 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. %%%% It is also available from %%%% http://www.dante.de/software/ctan/, the Dante www-server %%%% and from http://wwwuser.gwdg.de/~lfinsto1, %%%% the author's website. %%%% Please send bug reports to lfinsto1@gwdg.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 %%%% lfinsto1@gwdg.de %%%% s246794@stud.uni-goettingen.de %% Run like this: %% 3dldf dodec_01.ldf %% mpost dodec_01.mp %% tex dodec_01.txt %% dvips -o dodec_01.ps dodec_01.dvi %% All on one line: if false: 3dldf dodec_01.ldf; mpost dodec_01.mp; tex dodec_01.txt; \ dvips -o dodec_01.ps dodec_01.dvi fi; %% View using Ghostview like this: %% gv dodec_01.ps & % * (1) Beginning of 3DLDF code. %% ** (2) Dodecahedron net for cardboard model and pentagons %% for cutting out coverings made of watercolor paper %% LDF 2007.09.27. %% *** (3) reg_polygon d; point center; point p[]; path q[]; sign := 1; %% *** (3) Parameters radius := 3; rows := 4; columns := 3; horiz_skip := 2 * radius + .5; vert_skip := horiz_skip; %% *** (3) d := unit_pentagon scaled (radius, 0, radius); center := get_center d; for i = 0 upto 4: p[i] := get_point (i) d; endfor; for i = 0 upto 3: q[i] := mediate(p[i], p[i + 1], 1.3) -- mediate(p[i + 1], p[i], 1.3); endfor; q4 := mediate(p4, p0, 1.3) -- mediate(p0, p4, 1.3); beginfig(1); if false: % true dotlabel.top("$0$", p0); dotlabel.lft("$1$", p1); dotlabel.llft("$2$", p2); dotlabel.lrt("$3$", p3); dotlabel.rt("$4$", p4); fi; for k = 1 upto rows: for i = 1 upto columns: draw d; for j = 0 upto 4: draw q[j] dashed evenly; shift q[j] by (sign * horiz_skip); endfor; shift d by (sign * horiz_skip); endfor; shift d (-sign * horiz_skip, 0, -vert_skip); for m = 0 upto 4: shift q[m] (-sign * horiz_skip, 0, -vert_skip); endfor; if is_odd sign: sign *= -1; fi; endfor; %% *** (3) End of figure 1 endfig with_projection parallel_x_z; verbatim_metapost "end;"; end; %% *** (3) %% ** (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: