%%%% stlltn01.ldf %%%% Created by Laurence D. Finston (LDF) Wed Jun 9 19:19:04 CEST 2010 %%%% $Id: stlltn01.ldf,v 1.6 2011/01/14 17:57:42 lfinsto1 Exp $ %% * (1) Copyright and License. %%%% This file is part of GNU 3DLDF, a package for three-dimensional drawing. %%%% Copyright (C) 2010, 2011 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 %% Run the following commands: %% 3dldf stlltn01.ldf %% mpost stlltn01.mp %% tex stlltn01.txt %% dvips -o stlltn01.ps stlltn01.dvi %% * (1) Beginning of 3DLDF code. verbatim_metapost "prologues := 3;"; % verbatim_metapost "verbatimtex \font\large=cmr12 scaled \magstep2 etex;"; % verbatim_metapost "verbatimtex \font\Large=cmr17 scaled \magstep2 etex;"; %% ** (2) Stellation Patterns 1a, 1b, and 1c %% Created: June 9, 2010 %% Last updated: January 12, 2011 input "stlltns.lmc"; %% ** (2) point p[]; picture v; path frame; transform t[]; numeric frame_width; numeric frame_height; color frame_color; frame_color := dark_grey; frame_width := 19.5cm; frame_height:= 22cm; frame := (-.5frame_width, 0, -.5frame_height) -- (.5frame_width, 0, -.5frame_height) -- (.5frame_width, 0, .5frame_height) -- (-.5frame_width, 0, .5frame_height) -- cycle; pickup pencircle scaled (.5mm, .5mm, .5mm); %% ** (2) picture crosshair_picture; beginfig(0); pickup pencircle scaled (.5mm, .5mm, .5mm); p0 := (get_point 0 frame) shifted (1, 0, 1); p1 := p0 shifted ( 0, 0, .5); p2 := p0 shifted ( 0, 0, -.5); p3 := p0 shifted (-.5, 0); p4 := p0 shifted ( .5, 0); % label ("$p_{0}$", p0); % dotlabel.top("$p_{1}$", p1); % dotlabel.bot("$p_{2}$", p2); % dotlabel.lft("$p_{3}$", p3); % dotlabel.rt ("$p_{4}$", p4); draw p1 -- p2; draw p3 -- p4; t0 := identity rotated_around (mediate(get_point 0 frame, get_point 1 frame), mediate(get_point 0 frame, get_point 1 frame)); t1 := identity rotated_around (mediate(get_point 0 frame, get_point 3 frame), mediate(get_point 1 frame, get_point 2 frame)); t2 := identity shifted (3, 0); draw (p1 -- p2) * t0; draw (p3 -- p4) * t0; draw (p1 -- p2) * t1; draw (p3 -- p4) * t1; draw (p1 -- p2) * t0 * t1; draw (p3 -- p4) * t0 * t1; t2 := identity shifted by (mediate(p0, p0 * t0) - p0); draw (p1 -- p2) * t2; draw (p3 -- p4) * t2; draw (p1 -- p2) * t2 * t1; draw (p3 -- p4) * t2 * t1; crosshair_picture := current_picture; clear current_picture; endfig; %% ** (2) bool testing; testing := false; % true; if testing: shift frame (1cm, 0); shift crosshair_picture (1cm, 0); else: shift frame (0, 0, 1cm); shift crosshair_picture (0, 0, 1cm); fi; %% ** (2) 1a: Plain star beginfig(1); draw frame with_color frame_color; current_picture += crosshair_picture; % Arguments to generate_star: % bool do_labels % bool do_double_lines % bool do_help_lines % bool do_cutout % numeric diam % numeric length_zero % numeric rotation_zero % numeric length_one % numeric rotation_one % numeric divisions % numeric center_offset % numeric double_line_offset % numeric scale_factor generate_star (v) {false, false, false, false, 5, .75, 12.5, 0.375, 20, 10, 4, 0, 1.5}; current_picture += v; endfig with_projection parallel_x_z no_sort; %% ** (2) 1b: Star with double lines. clear v; beginfig(2); draw frame with_color frame_color; current_picture += crosshair_picture; generate_star (v) {false, true, false, false, 5, .75, 12.5, .375, 20, 10, 4, 1.25mm, 1.5}; current_picture += v; endfig with_projection parallel_x_z no_sort; %% ** (2) 1c: Star with double lines and cutouts clear v; beginfig(3); draw frame with_color frame_color; generate_star (v) {false, true, true, true, 5, .75, 12.5, .375, 20, 10, 4, 1.25mm, 1.5}; current_picture += crosshair_picture; current_picture += v; endfig with_projection parallel_x_z no_sort; %% *** (3) verbatim_metapost "end"; end; %% ** (2) End of 3DLDF code %% * (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) (ignore '( %% )) (setq outline-regexp "%% [*\f]+")) %% * (1) Local variables for Emacs. %% Local Variables: %% mode:Metafont %% eval:(outline-minor-mode t) %% abbrev-mode:t %% eval:(read-abbrev-file "~/.abbrev_defs") %% outline-regexp:"%% [*\f]+" %% End: