File: diamond.m4

package info (click to toggle)
circuit-macros 10.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 6,532 kB
  • sloc: makefile: 909; sh: 49
file content (38 lines) | stat: -rw-r--r-- 654 bytes parent folder | download | duplicates (4)
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
.PS
# diamond.m4
gen_init
# See LaTeX Graphics Companion pp 57-58
ifdpic(`
dimen = 1.5
ratio = 0.9
n = 30

North: (0,dimen)
East: (dimen,0)
South: (0,-dimen)
West: (-dimen,0)

define(`square',
 `shade(`$1',
    line from North to East then to South then to West then to North)
 ')

define(`diamond',`[
for i = 2 to n do { 
  square(`$1')
  Tmp: North
  North: ratio between East and North
  East: ratio between South and East
  South: ratio between West and South
  West: ratio between Tmp and West
  }]')

linethick = 0
diamond( i % 2 )
linethick = 0.4
diamond( (n-i)/(n-2) ) with .w at last [].e+(0.25,0)

',
`box "diamond.m4" "requires" "dpic"')

.PE