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
22
#include "dungeon.inc"
26
#declare textur = pigment {rgb <0.9,1,0.7>}
28
#declare Wanddicke = 0.1;
29
#declare Plastikdicke = Wanddicke/3;;
30
#declare Lochdicke = 0.03;
31
#declare Lochdicke_ = sqrt(2)*Lochdicke;
32
#declare Leiterbahnenabstand = 0.02;
33
#declare Keinschlitz = 2*Ueberlappung;
35
#declare Eckenrundung = union {
36
cylinder {<Wanddicke,0,0> <Wanddicke,Hoehe,0> Ueberlappung}
37
sphere {<Wanddicke,Hoehe,0> Ueberlappung}
38
cylinder {<Wanddicke,Hoehe,0> <Wanddicke,Hoehe,Wanddicke> Ueberlappung}
41
#declare Ecke = union {
44
<Wanddicke+Ueberlappung,Hoehe,Wanddicke>
48
<Wanddicke,Hoehe+Ueberlappung,Wanddicke>
52
<Wanddicke,Hoehe,Wanddicke+Ueberlappung>
55
object {Eckenrundung rotate 90*y translate <0,0,Wanddicke>}
56
object {Eckenrundung rotate 180*y translate <Wanddicke,0,Wanddicke>}
57
object {Eckenrundung rotate 270*y translate <Wanddicke,0,0>}
61
#declare Schlitz = function(x0,y0,x1,y1,xx,yy,dm) {
64
pow(max(2*(x0-xx)+dm,2*(y0-yy)-dm,2*(xx-x1)-dm,2*(yy-y1)+dm,0),2)
68
#declare fRandom = function {pattern {bozo scale 3}}
70
#declare Platine = function(xx,yy,xm,ym) {
72
pow(ym,2)+pow(select(fRandom(xx-xm,yy-ym,0)-0.49,
75
pow(xm,2)+pow(select(fRandom(xx-xm,yy-ym,0)-0.51,
80
#declare Wand = union {
82
object {Ecke translate (1-Wanddicke)*x}
84
<0,0,Wanddicke/2> <1,Hoehe-Plastikdicke/2,Wanddicke*2/3>
88
Platine(x,y, mod(x,1)-1/2, mod(y,1)-1/2),
89
Platine(x,y, mod(x,1)+1/2, mod(y,1)-1/2),
90
Platine(x,y, mod(x,1)-1/2, mod(y,1)+1/2))
92
colour_map {[0.0625 rgb 1/3] [0.0625 rgb <0,1/2,0>]}
93
scale Leiterbahnenabstand
98
function {min(Plastikdicke,sqrt(pow(z-Plastikdicke/2,2)
99
+pow(max(0,Plastikdicke/2+Lochdicke/2
102
1/2-Wanddicke-Ueberlappung-Keinschlitz,Hoehe-1/8,
103
mod(x-Wanddicke-Ueberlappung,1/2-Wanddicke-Ueberlappung),y,
104
mod(mod(x,1/2)-y+1001*Lochdicke_,2*Lochdicke_)
108
threshold Plastikdicke/2
110
<0,0,-Plastikdicke/2>
111
<1,Hoehe-Plastikdicke/2,Plastikdicke*3/2>
115
box {<0,0,Wanddicke-Plastikdicke> <1,Hoehe-Plastikdicke/2,Wanddicke>}
117
<0,Hoehe-Plastikdicke,Plastikdicke/2>
118
<1,Hoehe,Wanddicke-Plastikdicke/2>
121
<0,Hoehe-Plastikdicke/2,Plastikdicke/2>
122
<1,Hoehe-Plastikdicke/2,Plastikdicke/2> Plastikdicke/2
125
<0,Hoehe-Plastikdicke/2,Wanddicke-Plastikdicke/2>
126
<1,Hoehe-Plastikdicke/2,Wanddicke-Plastikdicke/2> Plastikdicke/2
132
#declare Langwand = union {
133
object{Wand translate -2*x}
134
object{Wand translate -x}
136
object{Wand translate x}
137
object{Ecke translate 2*z}
141
#declare Block = BlockAusWand(Wand)
148
object {Langwand rotate 90*y}
149
object {Langwand rotate 180*y}
150
object {Langwand rotate 270*y}