File: interference.cs

package info (click to toggle)
cairo 1.18.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 72,788 kB
  • sloc: ansic: 217,451; cpp: 2,108; cs: 1,763; xml: 1,280; sh: 990; python: 433; javascript: 347; awk: 89; makefile: 83
file content (46 lines) | stat: -rw-r--r-- 651 bytes parent folder | download | duplicates (9)
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
/rot { 3 -1 roll } def
/2dup { 2 copy } def

/circle { % context radius -- context
	2dup 0 m pop
	0 0 rot 0 math.2pi arc h
} def

/circles { % context #circles -- context
	1 1 rot { circle } for
} def

/SIDE 600. def
/SIZE 600. def
<< /width SIZE /height SIZE >> surface context
1 1 1 set-source-rgb paint
0 0 0 set-source-rgb
//EVEN_ODD set-fill-rule

/r 4 def
/n SIDE 1.5 mul r div integer def

SIZE SIDE div dup scale

save
  302 200 translate
  r dup scale
  n circles
restore

save
  100 300 translate
  r dup scale
  n circles
restore

save
  500 400 translate
  r dup scale
  n circles
restore

fill

/target get (out.png) write-to-png pop
pop