File: wave_2.ldf

package info (click to toggle)
3dldf 2.0.3%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 12,508 kB
  • ctags: 7
  • sloc: makefile: 892; sh: 117; cpp: 5
file content (142 lines) | stat: -rw-r--r-- 4,097 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
%%%% wave_2.ldf
%%%% Created by Laurence D. Finston (LDF) Fri Mar  3 20:46:19 CET 2006

%% * (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, 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 the maintainer of 
%%%% GNU 3DLDF to send announcements to users. 
%%%% To subscribe to these mailing lists, send an 
%%%% email with ``subscribe <email-address>'' as the subject.  

%%%% The author can be contacted at: 

%%%% Laurence D. Finston 
%%%% c/o The Free Software Foundation, Inc.
%%%% 51 Franklin St, Fifth Floor 
%%%% Boston, MA  02110-1301 
%%%% USA 

%%%% Laurence.Finston@gmx.de 
 


%% !! Important:  LDF 2010.10.18.
%% I've commented-out some code and rearranged some other code.

%% The MetaPost code generated from this file (in `wave_2.mp') must be altered
%% slightly by hand.  I've check the latter file into the CVS repository.

%% This is necessary, because problems have arisen with |Picture::output| that didn't exist
%% with an older version of GCC.

%% *** (3) Wave form 2.  LDF 2006.03.03.

w := 6.4cm;
h := 4.8cm;

w *= 4;
h *= 4;

w /= 1.1375;
h /= 1.1375;

pen_width := .75mm; 

frame_w := w - .5pen_width;
frame_h := h - .5pen_width;

path frame;
frame := origin -- (frame_w, 0) -- (frame_w, frame_h) 
                -- (0, frame_h) -- cycle;

shift frame (0, -.5frame_h);

picture frame_picture;

beginfig(0); 
draw frame with_pen pencircle scaled (.5mm, .5mm, .5mm);
frame_picture := current_picture;
endfig; 

point p;

path q;

pen medium_pen;
pen thick_pen;

medium_pen := pencircle scaled (.75mm, .75mm);
thick_pen := pencircle scaled (1mm, 1mm);

pickup medium_pen;

picture save_picture;

for k = 0 upto 6:
   r := k + 1;
   for j = 0 upto 19:
      q := null_path;
      beginfig(j + k * 38); 
      	 draw (0,0) -- (frame_w, 0) with_color red;
      	 for i = 16 * k upto 16 * r:
      	     m := i * 360 / 32;
      	     n := .25 * j * sind m;

      	     p := (.25 * i, n); 

      	     q += p;
      	 endfor;
      draw q with_pen thick_pen;
      q += ..;
      draw origin -- (.25 * 16 * k, 0) with_pen thick_pen;
      save_picture := current_picture;
%      output current_picture with_projection parallel_x_y;
%      clear current_picture;
%      output frame_picture with_projection parallel_x_y;


      endfig with_projection parallel_x_y;

      clip_to frame;
      draw frame with_pen pencircle scaled (.5mm, .5mm, .5mm);

      beginfig(r * 38 - j) ; 
          current_picture := save_picture;
%         output save_picture with_projection parallel_x_y;
%         clip_to frame;
%         output frame_picture with_projection parallel_x_y;
      endfig with_projection parallel_x_y;
   endfor;
endfor;

verbatim_metapost "end";
end;