%%%% stgrddc1.ldf %%%% Created by Laurence D. Finston (LDF) Mon Jan 5 16:02:40 CET 2009 %% * (1) Great Stellated Dodecahedron %% $Id: stgrddc1.ldf,v 1.14 2022/12/16 14:05:14 lfinsto1 Exp $ %% * (1) Copyright and License. %%%% This file is part of GNU 3DLDF, a package for three-dimensional drawing. %%%% Copyright (C) 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 stgrddc1.ldf %% mpost stgrddc1.mp %% tex stgrddc1.txt %% dvips -o stgrddc1.ps stgrddc1.dvi %% All on one line: if false: 3dldf stgrddc1.ldf; mpost stgrddc1.mp; tex stgrddc1.txt; \ dvips -o stgrddc1.ps stgrddc1.dvi fi; %% View using Ghostview like this: %% gv stgrddc1.ps & %% or %% ggv stgrddc1.ps & %% (Gnome Ghostview) % * (1) Beginning of 3DLDF code. %% ** (2) Great Stellated Dodecahedron %% The Great Stellated Dodecahedron can be constructed using %% triangular pyramids attached to an icosahedron. point c[]; %% centers point p[][]; reg_polygon_vector rpv[]; point v[][]; transform t[]; triangle w[]; verbatim_metapost "verbatimtex \font\largebf=cmbx12 etex;"; pen dot_pen; dot_pen := pencircle scaled (1mm, 1mm); %% ** (2) Figure 1 beginfig(1); %% Diameter == 4 --> Edge length == 6. %% *** (3) The net rpv := get_net icosahedron with_diameter 4; for i = 0 upto 19: rotate rpv[i] (0, 90); c[i] := get_center rpv[i]; p[i]0 := get_point 0 rpv[i]; p[i]1 := get_point 1 rpv[i]; p[i]2 := get_point 2 rpv[i]; label(i, c[i]); endfor; % draw rpv with_color red dashed evenly % with_pen pencircle scaled (.375mm, .375mm, .375mm); pickup pencircle scaled (.5mm, .5mm, .5mm); for i = 0 step 4 until 16: % draw p[i][0] -- p[i][1]; draw p[i][0] -- p[i][2]; draw p[i][1] -- p[i][2] dashed evenly; endfor; for i = 3 step 4 until 19: % draw p[i][0] -- p[i][1]; draw p[i][0] -- p[i][2]; draw p[i][1] -- p[i][2] dashed evenly; endfor; %draw p[1][0] -- p[1][1]; draw p[18][0] -- p[18][1]; for i = 1 step 4 until 18: draw p[i][0] -- p[i][2] dashed evenly; endfor; for i = 2 step 4 until 17: draw p[i][0] -- p[i][1] dashed evenly; endfor; %% *** (3) The tabs point tab[]; %% **** (4) tab0 := mediate(p[0][0], p[0][1], .2); tab1 := mediate(p[0][0], p[0][1], .8); % dotlabel.llft("$t_0$", tab0); % dotlabel.llft("$t_1$", tab1); tab3 := unit_vector(tab0 - tab1); tab3 /= 2; shift tab3 by tab0; tab4 := tab0 shifted (0, 1); rotate_around tab3 (tab0, tab4) 110; %dotlabel.top("$t_3$", tab3); tab5 := tab3 rotated_around (c[0], p[0][2]) 180; %dotlabel.top("$t_5$", tab5); draw tab0 -- tab3 -- tab5 -- tab1; draw tab0 -- tab1 dashed evenly; draw p[0][0] -- tab0; draw p[0][1] -- tab1; tab6 := p[4][0] - p[0][0]; tab7 := mediate(tab0, tab1); tab8 := mediate(tab3, tab5); %draw tab7 -- tab8; %dotlabel.llft("$t_7$", tab7); %dotlabel.urt("$t_8$", tab8); tab9 := mediate(tab7, tab8); %dotlabel.rt("$t_9$", tab9); tab10 := tab9 shifted (0, 1); tab11 := tab7 rotated_around(tab9, tab10) 90; %dotlabel.rt("$t_{11}$", tab11); bool_point bp; bp := (tab9 -- tab11) intersection_point (tab1 -- tab5); % message "bp:"; % show bp; tab12 := bp; %dotlabel.ulft("$t_{12}$", tab12); tab13 := tab12 rotated_around (tab9, tab10) 180; %dotlabel.rt("$t_{13}$", tab13); draw tab12 -- tab13 dashed evenly; for j := 1 upto 5: tab[j + 13] := mediate(tab12, tab13, j/6); drawdot tab[j + 13] with_pen dot_pen; endfor;%% *** (3) %% *** (3) Tab traces on triangles tab20 := tab0; tab21 := tab1; tab23 := tab3; tab25 := tab5; tab32 := tab12; tab33 := tab13; t4 := identity rotated_around (c0, p[0][0]) 180; rotate_around t4 (p[0][0], p[0][2]) 180; tab20 *= tab21 *= tab23 *= tab25 *= tab32 *= tab33 *= t4; % dotlabel.bot("$t_{20}$", tab20); % dotlabel.bot("$t_{21}$", tab21); % dotlabel.lft("$t_{23}$", tab23); % dotlabel.ulft("$t_{25}$", tab25); % dotlabel.lft("$t_{32}$", tab32); % dotlabel.rt("$t_{33}$", tab33); draw tab21 -- tab25 -- tab23 -- tab20 dashed evenly; draw tab32 -- tab33 dashed evenly; for j = 1 upto 5: tab[33 + j] := mediate(tab32, tab33, j/6); drawdot tab[33 + j] with_pen dot_pen; endfor; %% *** (3) t0 := identity shifted by tab6; for i = 4 step 4 until 16: tab0 *= tab1 *= tab3 *= tab5 *= tab12 *= tab13 *= t0; tab20 *= tab21 *= tab23 *= tab25 *= tab32 *= tab33 *= t0; draw tab0 -- tab3 -- tab5 -- tab1; draw tab0 -- tab1 dashed evenly; draw p[i][0] -- tab0; draw p[i][1] -- tab1; draw tab12 -- tab13 dashed evenly; for j := 1 upto 5: tab[j + 13] := mediate(tab12, tab13, j/6); drawdot tab[j + 13] with_pen dot_pen; endfor; draw tab21 -- tab25 -- tab23 -- tab20 dashed evenly; draw tab32 -- tab33 dashed evenly; for j = 1 upto 5: tab[33 + j] := mediate(tab32, tab33, j/6); drawdot tab[33 + j] with_pen dot_pen; endfor; endfor; t1 := identity shifted by (p[19][1] - p[16][0]); rotate_around t1 (p[19][0], p[19][1]) 180; tab0 *= tab1 *= tab3 *= tab5 *= tab12 *= tab13 *= t1; draw tab0 -- tab3 -- tab5 -- tab1; draw tab0 -- tab1 dashed evenly; % dotlabel.top("$t_{12}$", tab12); % dotlabel.top("$t_{13}$", tab13); draw tab12 -- tab13 dashed evenly; for j := 1 upto 5: tab[j + 13] := mediate(tab12, tab13, j/6); drawdot tab[j + 13] with_pen dot_pen; endfor; % dotlabel.top("$t_0$", tab0); % dotlabel.top("$t_1$", tab1); % dotlabel.top("$t_3$", tab3); % dotlabel.top("$t_5$", tab5); draw p[19][0] -- tab1; draw p[19][1] -- tab0; i := 3; % label.lft(0, p[i]0) with_text_color red; % label.bot(1, p[i]1) with_text_color red; % label.lft(2, p[i]2) with_text_color red; i := 1; % label.lft(0, p[i]0); % label.bot(1, p[i]1); % label.lft(2, p[i]2); tab20 *= tab21 *= tab23 *= tab25 *= tab32 *= tab33 *= t1; c190 := c19 shifted (0, 1); t5 := identity rotated_around (c19, c190) 120; tab20 *= tab21 *= tab23 *= tab25 *= tab32 *= tab33 *= t5; draw tab21 -- tab25 -- tab23 -- tab20 dashed evenly; draw tab32 -- tab33 dashed evenly; % dotlabel.top("$t_{32}$", tab32); % dotlabel.top("$t_{33}$", tab33); for j = 1 upto 5: tab[33 + j] := mediate(tab32, tab33, j/6); drawdot tab[33 + j] with_pen dot_pen; endfor; %% *** (3) t2 := identity shifted by (p[15][0] - p[19][0]); for i = 15 step -4 until 3: tab0 *= tab1 *= tab3 *= tab5 *= tab12 *= tab13 *= t2; tab20 *= tab21 *= tab23 *= tab25 *= tab32 *= tab33 *= t2; draw tab0 -- tab3 -- tab5 -- tab1; draw tab0 -- tab1 dashed evenly; draw p[i][1] -- tab0; draw p[i][0] -- tab1; draw tab12 -- tab13 dashed evenly; for j := 1 upto 5: tab[j + 13] := mediate(tab12, tab13, j/6); drawdot tab[j + 13] with_pen dot_pen; endfor; draw tab21 -- tab25 -- tab23 -- tab20 dashed evenly; draw tab32 -- tab33 dashed evenly; for j = 1 upto 5: tab[33 + j] := mediate(tab32, tab33, j/6); drawdot tab[33 + j] with_pen dot_pen; endfor; endfor; %% **** (4) t3 := identity shifted by (p[1][1] - p[3][1]); tab0 *= tab1 *= tab3 *= tab5 *= tab12 *= tab13 *= t3; draw tab0 -- tab3 -- tab5 -- tab1; draw tab0 -- tab1 dashed evenly; draw tab12 -- tab13 dashed evenly; for j := 1 upto 5: tab[j + 13] := mediate(tab12, tab13, j/6); drawdot tab[j + 13] with_pen dot_pen; endfor; %draw p[i][1] -- tab0; %draw p[i][0] -- tab1; % dotlabel.top("$t_0$", tab0); % dotlabel.top("$t_1$", tab1); % dotlabel.top("$t_3$", tab3); % dotlabel.top("$t_5$", tab5); draw p[1][0] -- tab1; draw p[1][1] -- tab0; %% *** (3) The last tab trace % dotlabel.top("$t_0$", tab0); % dotlabel.top("$t_1$", tab1); % dotlabel.llft("$t_3$", tab3); % dotlabel.llft("$t_5$", tab5); % dotlabel.ulft("$t_{12}$", tab12); % dotlabel.rt("$t_{13}$", tab13); t6 := identity shifted by (p[18][0] - p[1][1]); tab0 *= tab1 *= tab3 *= tab5 *= tab12 *= tab13 *= t6; % dotlabel.top("$t_0$", tab0); % dotlabel.top("$t_1$", tab1); % dotlabel.llft("$t_3$", tab3); % dotlabel.llft("$t_5$", tab5); % dotlabel.ulft("$t_{12}$", tab12); % dotlabel.rt("$t_{13}$", tab13); % label.rt(0, p[1][0]); % label.llft(1, p[1][1]); % label.bot(2, p[1][2]); % label.lft(0, p[18]0); % label.bot(1, p[18]1); % label.lft(2, p[18]2); draw tab1 -- tab5 -- tab3 -- tab0 dashed evenly; draw tab12 -- tab13 dashed evenly; for j = 1 upto 5: tab[13 + j] := mediate(tab12, tab13, j/6); drawdot tab[13 + j] with_pen dot_pen; endfor; %% *** (3) Inner triangles for stitch holes. % dotlabel.top(0, p0[0]); % dotlabel.top(1, p0[1]); % dotlabel.top(2, p0[2]); for j = 0 upto 19: set w[j + 4] with_points (p[j][0], p[j][1], p[j][2]); scale w[j + 4] (.5, 0, .5); c[20 + j] := get_center w[j + 4]; shift w[j + 4] by (c[j] - c[20 + j]); draw w[j + 4] dashed withdots; v[j][0] := get_point 0 w[j + 4]; v[j][1] := get_point 1 w[j + 4]; v[j][2] := get_point 2 w[j + 4]; % dotlabel.urt(0, v[j][0]); % dotlabel.top(1, v[j][1]); % dotlabel.lft(2, v[j][2]); for i = 0 upto 3: drawdot mediate(v[j][0], v[j][1], i/4) with_pen dot_pen; drawdot mediate(v[j][2], v[j][0], i/4) with_pen dot_pen; drawdot mediate(v[j][1], v[j][2], i/4) with_pen dot_pen; endfor; endfor; %% *** (3) endfig with_projection parallel_x_z; %% ** (2) Figure 2 --- Pyramids point q[]; beginfig(2); edge := magnitude (p[0][0] - p[0][2]); % message "edge:"; % show edge; q0 := origin; q1 := (edge, 0); %dotlabel.lft("$q_0$", q0); %dotlabel.rt("$q_1$", q1); phi := (1 + sqrt 5) / 2; % message "phi:"; % show phi; side := phi * edge; % message "side:"; % show side; a := arccosd (.5edge / side); % message "a"; % show a; q2 := (side, 0) rotated (0, a); %dotlabel.top("$q_2$", q2); draw q0 -- q1; draw q0 -- q2 dashed evenly; draw q1 -- q2 dashed evenly; % message "q1"; % show q1; % message "q2"; % show q2; q3 := q0 rotated_around (q1, q2) 180; %dotlabel.top("$q_3$", q3); draw q1 -- q3 -- q2; q4 := q1 rotated_around (q0, q2) 180; %dotlabel.top("$q_4$", q4); draw q0 -- q4 -- q2; q5 := q1 rotated (0, -60); %dotlabel.bot("$q_5$", q5); draw q0 -- q5 -- q1; %% *** (3) set w0 with_points (q0, q4, q2); set w1 with_points (q0, q1, q2); set w2 with_points (q1, q3, q2); set w3 with_points (q0, q5, q1); q6 := get_center w0; q7 := get_center w1; q8 := get_center w2; q9 := get_center w3; % label(0, q6); % label(1, q7); % label(2, q8); % label(3, q9); %% *** (3) % dotlabel.top("$q_0$", q0); % dotlabel.top("$q_1$", q1); % dotlabel.top("$q_5$", q5); set w40 with_points (q0, q5, q1); scale w40 (.5, 0, .5); c40 := get_center w40; shift w40 by (q9 - c40); draw w40 dashed withdots; point b[]; b0 := get_point 0 w40; b1 := get_point 1 w40; b2 := get_point 2 w40; for i = 0 upto 3: drawdot mediate(b0, b1, i/4) with_pen dot_pen; drawdot mediate(b1, b2, i/4) with_pen dot_pen; drawdot mediate(b2, b0, i/4) with_pen dot_pen; endfor; %% *** (3) q10 := mediate(q0, q5, 1/9); %dotlabel.lft("$q_{10}$", q10); q11 := mediate(q5, q0, 1/9); %dotlabel.rt("$q_{11}$", q11); q12 := (unit_vector (q5 - q11) * .5) shifted q11; q13 := q11 shifted (0, 1); rotate_around q12 (q11, q13) -120; %dotlabel.lft("$q_{12}$", q12); q14 := q12 shifted by (q10 - q11); q15 := q10 shifted (0, 1); rotate_around q14 (q10, q15) 60; %dotlabel.lft("$q_{14}$", q14); draw q11 -- q12 -- q14 -- q10; %% *** (3) q16 := mediate(q10, q11); %dotlabel.rt("$q_{16}$", q16); q17 := mediate(q14, q12); %dotlabel.lft("$q_{17}$", q17); q18 := mediate(q16, q17); %dotlabel.lrt("$q_{18}$", q18); q19 := q18 shifted (0, 1); q20 := q16 rotated_around (q18, q19) 90; %dotlabel.urt("$q_{20}$", q20); bp := (q18 -- q20) intersection_point (q10 -- q14); q21 := bp; %dotlabel.lft("$q_{21}$", q21); bp := (q18 -- q20) intersection_point (q11 -- q12); q22 := bp; %dotlabel.bot("$q_{22}$", q22); draw q21 -- q22 dashed evenly; %% *** (3) for i = 1 upto 5: q[22 + i] := mediate(q22, q21, i/6); drawdot q[22 + i] with_pen dot_pen; endfor; q28 := mediate(q0, q1); %dotlabel.top("$q_{28}$", q28); t0 := identity rotated_around (q28, q5) 180; q10 *= q11 *= q12 *= q14 *= q21 *= q22 *= q23 *= q24 *= q25 *= q26 *= q27 *= t0; % dotlabel.top("$q_{10}$", q10); % dotlabel.top("$q_{11}$", q11); % dotlabel.top("$q_{12}$", q12); % dotlabel.top("$q_{14}$", q14); draw q11 -- q12 -- q14 -- q10; draw q21 -- q22 dashed evenly; for i = 1 upto 5: drawdot q[22 + i] with_pen dot_pen; endfor; %% *** (3) ang := (q4 - q0) angle (q0 - q5); % message "ang:"; % show ang; q29 := q1 shifted (0, 1); t1 := (identity shifted by (q1 - q10)) rotated_around (q1, q29) 180 - ang; q10 *= q11 *= q12 *= q14 *= q21 *= q22 *= q23 *= q24 *= q25 *= q26 *= q27 *= t1; q30 := (q3 - q11) * .5; t2 := identity shifted by q30; q10 *= q11 *= q12 *= q14 *= q21 *= q22 *= q23 *= q24 *= q25 *= q26 *= q27 *= t2; % dotlabel.top("$q_{10}$", q10); % dotlabel.top("$q_{11}$", q11); % dotlabel.top("$q_{12}$", q12); % dotlabel.top("$q_{14}$", q14); draw q11 -- q12 -- q14 -- q10 dashed evenly; draw q21 -- q22 dashed evenly; for i = 1 upto 5: drawdot q[22 + i] with_pen dot_pen; endfor; %% *** (3) t3 := identity rotated_around (q2, q28) 180; q10 *= q11 *= q12 *= q14 *= q21 *= q22 *= q23 *= q24 *= q25 *= q26 *= q27 *= t3; % dotlabel.top("$q_{10}$", q10); % dotlabel.top("$q_{11}$", q11); % dotlabel.top("$q_{12}$", q12); % dotlabel.top("$q_{14}$", q14); draw q11 -- q12 -- q14 -- q10 dashed evenly; draw q21 -- q22 dashed evenly; for i = 1 upto 5: drawdot q[22 + i] with_pen dot_pen; endfor; %% *** (3) q40 := mediate(q3, q2, 1/8); %dotlabel.lft("$q_{40}$", q40); q41 := q40 shifted (0, 1); q42 := unit_vector (q3 - q2); q42 *= .5; shift q42 by q40; rotate_around q42 (q40, q41) 120; %dotlabel.top("$q_{42}$", q42); q43 := mediate(q3, q2); %dotlabel.llft("$q_{43}$", q43); q44 := unit_vector(q3 - q43); q44 *= .5; shift q44 by q43; q45 := q43 shifted (0, 1); rotate_around q44 (q43, q45) 90; %dotlabel.top("$q_{44}$", q44); q46 := q42 rotated_around (q43, q44) 180; q47 := q40 rotated_around (q43, q44) 180; % dotlabel.top("$q_{46}$", q46); % dotlabel.lft("$q_{47}$", q47); q48 := mediate(q43, q44); %dotlabel.rt("$q_{48}$", q48); q49 := (q3 - q40) shifted q48; %dotlabel.rt("$q_{49}$", q49); bp := (q46 -- q47) intersection_point (q48 -- q49); q50 := bp; %dotlabel.ulft("$q_{50}$", q50); bp := (q40 -- q42) intersection_point (q48 -- q49); q51 := bp; %dotlabel.rt("$q_{51}$", q51); %% *** (3) draw q40 -- q42 -- q46 -- q47; draw q50 -- q51 dashed evenly; for i = 1 upto 9: q[51 + i] := mediate(q51, q50, i/10); drawdot q[51 + i] with_pen dot_pen; endfor; %% *** (3) t7 := (identity rotated_around (q2, q28) 180) rotated_around (q2, q4) 180; q40 *= q42 *= q46 *= q47 *= q50 *= q51 *= q52 *= q53 *= q54 *= q55 *= q56 *= q57 *= q58 *= q59 *= q60 *= t7; draw q40 -- q42 -- q46 -- q47 dashed evenly; draw q50 -- q51 dashed evenly; for i = 1 upto 9: q[51 + i] := mediate(q51, q50, i/10); drawdot q[51 + i] with_pen dot_pen; endfor; %% *** (3) picture save_picture; save_picture := current_picture; endfig with_projection parallel_x_z; beginfig(3); current_picture := save_picture; rotate current_picture (0, 180); endfig with_projection parallel_x_z; %% ** (2) Figure 4, Triangles for cutting out watercolor (or other) paper beginfig(4); point r[]; w0 := w1; %% *** (3) Line 1 % dotlabel.lft("$q_0$", q0); % dotlabel.rt("$q_1$", q1); % dotlabel.top("$q_2$", q2); c0 := get_center w0; %dotlabel.top("$c_0$", c0); q3 := c0 shifted (0, 1); w1 := ((w0 rotated_around (c0, q3) 180) shifted by (q1 - q0)) shifted (.5, 0); q4 := get_point 0 w1; q5 := get_point 1 w1; q6 := get_point 2 w1; q8 := mediate(q0, q1); t0 := identity shifted by (q2 - q5); shift t0 (.5, 0, .5); q7 := q6; q4 *= q5 *= q6 *= w1 *= t0; % dotlabel.top("$q_4$", q4); % dotlabel.top("$q_5$", q5); % dotlabel.bot("$q_6$", q6); % dotlabel.bot("$q_8$", q8); c1 := get_center w1; %dotlabel.top("$c_1$", c1); t1 := identity shifted by (q1 - q0); shift t1 (1, 0); r0 := q0; r1 := q1; r2 := q2; r3 := q3; r4 := q4; r5 := q5; r6 := q6; c2 := c0; c3 := c1; w2 := w0; w3 := w1; string s; j := 0; for i = 0 upto 4: draw w2; draw w3; label(j, c2); j := j + 1; label(j, c3); j := j + 1; c2 *= c3 *= r1 *= r2 *= r3 *= r4 *= r5 *= r6 *= w2 *= w3 *= t1; endfor; draw w2; label(j, c2); j := j + 1; %% *** (3) Line 2 t2 := identity shifted by (q0 - q5); shift t2 (0, 0, -.5); r0 := q0; r1 := q1; r2 := q2; r3 := q3; r4 := q4; r5 := q5; r6 := q6; c2 := c0; c3 := c1; w2 := w0; w3 := w1; c2 *= c3 *= r0 *= r1 *= r2 *= r3 *= r4 *= r5 *= r6 *= w2 *= w3 *= t2; draw w3; label(j, c3); j := j + 1; for i = 0 upto 4: c2 *= c3 *= r0 *= r1 *= r2 *= r3 *= r4 *= r5 *= r6 *= w2 *= w3 *= t1; draw w2; label(j, c2); j := j + 1; label(j, c3); j := j + 1; draw w3; endfor; %% *** (3) Line 3 r0 := q0; r1 := q1; r2 := q2; r3 := q3; r4 := q4; r5 := q5; r6 := q6; w2 := w0; w3 := w1; c2 := c0; c3 := c1; t3 := identity shifted by 2 * (q8 - q2); shift t3 (0, 0, -2); c2 *= c3 *= r0 *= r1 *= r2 *= r3 *= r4 *= r5 *= r6 *= w2 *= w3 *= t3; for i = 0 upto 4: draw w2; label(j, c2); j := j + 1; label(j, c3); j := j + 1; draw w3; c2 *= c3 *= r0 *= r1 *= r2 *= r3 *= r4 *= r5 *= r6 *= w2 *= w3 *= t1; endfor; draw w2; label(j, c2); j := j + 1; %% *** (3) Line 4 r0 := q0; r1 := q1; r2 := q2; r3 := q3; r4 := q4; r5 := q5; r6 := q6; w2 := w0; w3 := w1; c2 := c0; c3 := c1; t3 := identity shifted by (q0 - q5); shift t3 by 2 * (q8 - q2); shift t3 (0, 0, -2.5); c2 *= c3 *= r0 *= r1 *= r2 *= r3 *= r4 *= r5 *= r6 *= w2 *= w3 *= t3; draw w3; for i = 0 upto 4: c2 *= c3 *= r0 *= r1 *= r2 *= r3 *= r4 *= r5 *= r6 *= w2 *= w3 *= t1; draw w2; label(j, c2); j := j + 1; label(j, c3); j := j + 1; draw w3; endfor; %% *** (3) Line 5 r0 := q0; r1 := q1; r2 := q2; r3 := q3; r4 := q4; r5 := q5; r6 := q6; w2 := w0; w3 := w1; c2 := c0; c3 := c1; t4 := identity shifted by 4 * (q8 - q2); shift t4 by (0, 0, -4); c2 *= c3 *= r0 *= r1 *= r2 *= r3 *= r4 *= r5 *= r6 *= w2 *= w3 *= t4; % draw w2 with_color red; % draw w3 with_color blue; for i = 0 upto 4: draw w2; label(j, c2); j := j + 1; label(j, c3); j := j + 1; draw w3; c2 *= c3 *= r0 *= r1 *= r2 *= r3 *= r4 *= r5 *= r6 *= w2 *= w3 *= t1; endfor; draw w2; label(j, c2); j := j + 1; %% *** (3) Line 6 r0 := q0; r1 := q1; r2 := q2; r3 := q3; r4 := q4; r5 := q5; r6 := q6; w2 := w0; w3 := w1; c2 := c0; c3 := c1; t5 := identity shifted by (q0 - q5); shift t5 by 4 * (q8 - q2); shift t5 (0, 0, -4.5); c2 *= c3 *= r0 *= r1 *= r2 *= r3 *= r4 *= r5 *= r6 *= w2 *= w3 *= t5; draw w3; label(j, c3); j := j + 1; for i = 0 upto 4: c2 *= c3 *= r0 *= r1 *= r2 *= r3 *= r4 *= r5 *= r6 *= w2 *= w3 *= t1; draw w2; label(j, c2); j := j + 1; label(j, c3); j := j + 1; draw w3; endfor; %% *** (3) endfig with_projection parallel_x_z; %% ** (2) %% *** (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: