2
Copyright 2006 by Mark Weyer
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27
let kantenrad = 1.0/.5.0
29
let punktrad = 1.0/.15.0
30
let pi = 4.0*.(atan 1.0)
32
let rand' = rand+.kantenrad
33
let punktp = 0.5-.punktd
34
let punktp' = 0.5+.punktd
36
let grau = rgbrgb 0.9 0.9 1.0
37
let normal = rgbrgb 1.0 1.0 0.8
38
let gras = rgbrgb 1.0 0.9 0.9
42
(if n mod 2 = 1 then [0.5,0.5] else []) @
43
(if n >= 3 then [punktp,punktp; punktp',punktp'] else []) @
44
(if n-2*(n mod 2) >= 2 then [punktp',punktp; punktp,punktp'] else []) @
45
(if n >= 6 then [punktp,0.5; punktp',0.5] else []) @
46
(if n >= 8 then [0.5,punktp; 0.5,punktp'] else []) in
47
let punkte = konvertiere_polygon
48
(List.map (fun p -> Kreis (p,punktrad)) punkte) in
49
let aussen = konvertiere_polygon
50
[Strecke ((rand',rand),(1.0-.rand',rand));
51
Bogen ((1.0-.rand',rand'),kantenrad,true,1.5*.pi,0.0);
52
Strecke ((1.0-.rand,rand'),(1.0-.rand,1.0-.rand'));
53
Bogen ((1.0-.rand',1.0-.rand'),kantenrad,true,0.0,0.5*.pi);
54
Strecke ((1.0-.rand',1.0-.rand),(rand',1.0-.rand));
55
Bogen ((rand',1.0-.rand'),kantenrad,true,0.5*.pi,pi);
56
Strecke ((rand,1.0-.rand'),(rand,rand'));
57
Bogen ((rand',rand'),kantenrad,true,pi,1.5*.pi);] in
60
[Flaechen ([|von_rgb farbe; schwarz|], [aussen,0,None; punkte,1,Some 0]);
61
Strich (schwarz, [aussen; punkte])])
63
(monochrom durchsichtig 1 1)
65
let wuerfel = kombiniere_bildchen 2 4
66
[(0,3,wuerfel grau 0);
67
(1,3,wuerfel normal 1); (0,2,wuerfel normal 2); (1,2,wuerfel normal 3);
68
(0,1,wuerfel normal 4); (1,1,wuerfel normal 5); (0,0,wuerfel normal 6);
75
let gric = int_of_string Sys.argv.(1) in
77
gib_xpm_aus (rgb_grau 1.0) "mrpAlle" (berechne gric wuerfel)