%%%% rhmtrc_01.ldf %%%% Created by Laurence D. Finston (LDF) Fri Oct 26 23:05:59 CEST 2007 %% $Id: rhmtrc_01.ldf,v 1.5 2007/10/31 13:36:51 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 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. %%%% 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 %% Last updated: October 31, 2007 %% Run like this: %% 3dldf rhmtrc_01.ldf %% mpost rhmtrc_01.mp %% tex rhmtrc_01.txt %% dvips -o rhmtrc_01.ps rhmtrc_01.dvi %% All on one line: if false: 3dldf rhmtrc_01.ldf; mpost rhmtrc_01.mp; tex rhmtrc_01.txt; \ dvips -o rhmtrc_01.ps rhmtrc_01.dvi fi; %% View using Ghostview like this: %% gv rhmtrc_01.ps & % * (1) Beginning of 3DLDF code. %% ** (2) draw_rhombic_triacontahedron_net input "rhmtrc_01.lmc"; %% ** (2) Plan for rhombic triacontahedron V(3.5)^2 %% LDF 2007.10.19. %% *** (3) Declarations and Initializations focus f; set f with_position (3, 2, -20) with_direction (3, 2, 10) with_distance 20; %% *** (3) Working on `Rhombic_Triacontahedron::get_net' %% and `Rhombic_Triacontahedron::get_tabs' in %% `rhtchdrn.web' and the macro %% `draw_rhombic_triacontahedron_net', below, %% which calls them. %% LDF 2007.10.24. input "rhmtrc_01.lmc"; %% *** (3) Figure 1 beginfig(1); draw_rhombic_triacontahedron_net {4, false, true, true, 7, 1mm}; rotate current_picture (0, 180 + 75); %% **** (4) End of figure 1 endfig with_projection parallel_x_z no_sort; %% *** (3) Declarations at top level polygon r[]; point p[]; %% Scratch points point c[]; %% Centers path q[]; transform t[]; %% *** (3) Figure 2 rhombus_side_length := 4; k := 1; beginfig(2); %% **** (4) First rhombus r0 := get_rhombus with_side_length rhombus_side_length; p0 := get_point 0 r0; p1 := get_point 1 r0; p2 := get_point 2 r0; p3 := get_point 3 r0; c0 := mediate(p0, p2); c0 *= -1; t0 := identity shifted c0; %% Can't use `-c0' here, because the parser %% rule requires a `point_variable'. p0 *= p1 *= p2 *= p3 *= r0 *= t0; c0 := mediate(p0, p2); %message "c0:"; %show c0; alpha := (p0 - p3) angle (1, 0); t0 := identity rotated (0, 180 - alpha); c0 *= p0 *= p1 *= p2 *= p3 *= r0 *= t0; draw r0; label(k, c0); k += 1; r1 := r0; %% r1 and q10 -- q13 stay at the beginning of the rows. c1 := c0; q0 := unit_vector(p1 - p0) shifted p1 -- unit_vector(p0 - p1) shifted p0; q1 := unit_vector(p2 - p1) shifted p2 -- unit_vector(p1 - p2) shifted p1; q2 := unit_vector(p3 - p2) shifted p3 -- unit_vector(p2 - p3) shifted p2; q3 := unit_vector(p0 - p3) shifted p0 -- unit_vector(p3 - p0) shifted p3; for i = 0 upto 3: q[10 + i] := q[i]; endfor; draw q0 dashed evenly; draw q1 dashed evenly; draw q2 dashed evenly; draw q3 dashed evenly; %% **** (4) Rest of row 1 p4 := (unit_vector(p1 - p2) / 2) shifted p1; p5 := (unit_vector(p2 - p1) / 2) shifted p2; %dotlabel.top("$p_{4}$", p4); %dotlabel.top("$p_{5}$", p5); p6 := p2 - p4; t1 := identity shifted p6; for i = 0 upto 3: c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t1; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; endfor; %% **** (4) Row 2 r0 := r1; c0 := c1; p3 := get_point 3 r0; p7 := (unit_vector(p3 - p2) / 2) shifted p3 shifted 1; p7 -= p1; t0 := identity shifted p7; for i = 0 upto 3: q[i] := q[10 + i]; endfor; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; for i = 0 upto 3: c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t1; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; endfor; %% **** (4) Row 3 r0 := r1; c0 := c1; for i = 0 upto 3: q[i] := q[10 + i]; endfor; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; t2 := inverse t1; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; for i = 0 upto 3: c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t1; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; endfor; %% **** (4) Row 4 r0 := r1; c0 := c1; for i = 0 upto 3: q[i] := q[10 + i]; endfor; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; for i = 0 upto 3: c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t1; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; endfor; %% **** (4) Row 5 r0 := r1; c0 := c1; for i = 0 upto 3: q[i] := q[10 + i]; endfor; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; for i = 0 upto 3: c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t1; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; endfor; %% **** (4) Row 6 r0 := r1; c0 := c1; for i = 0 upto 3: q[i] := q[10 + i]; endfor; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; for i = 0 upto 3: c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t1; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; endfor; %% **** (4) Row 7 r0 := r1; c0 := c1; for i = 0 upto 3: q[i] := q[10 + i]; endfor; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; for i = 0 upto 3: c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t1; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; endfor; %% **** (4) Row 8 r0 := r1; c0 := c1; for i = 0 upto 3: q[i] := q[10 + i]; endfor; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; for i = 0 upto 4: c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t1; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; endfor; %% **** (4) Row 9 r0 := r1; c0 := c1; for i = 0 upto 3: q[i] := q[10 + i]; endfor; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; for i = 0 upto 3: c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t1; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; endfor; %% **** (4) Row 10 r0 := r1; c0 := c1; for i = 0 upto 3: q[i] := q[10 + i]; endfor; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t0; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t2; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; for i = 0 upto 3: c0 *= r0 *= q0 *= q1 *= q2 *= q3 *= t1; draw r0; label(k, c0); k += 1; for j = 0 upto 3: draw q[j] dashed evenly; endfor; endfor; %% **** (4) End of figure 2 endfig with_projection parallel_x_z; %% **** (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: