~ubuntu-branches/ubuntu/saucy/cuyo/saucy

« back to all changes in this revision

Viewing changes to datasrc/pics/mdPlastik.pov

  • Committer: Bazaar Package Importer
  • Author(s): Angel Abad
  • Date: 2010-07-19 09:54:44 UTC
  • mfrom: (4.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100719095444-ecoegzo1vvvdwra9
Tags: 2.~-1.1.brl3-1ubuntu1
* Merge from debian unstable (LP: #607106). Remaining changes:
  - Don't register MimeType=application/x-executable in
    the .desktop file.
  - Remove UTF-8 in the .desktop file
  - 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
    Copyright 2006 by Mark Weyer
3
 
 
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.
8
 
 
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.
13
 
 
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
17
 
*/
18
 
 
19
 
#declare Breite=4;
20
 
#declare Hoehe=4;
21
 
 
22
 
#include "dungeon.inc"
23
 
 
24
 
 
25
 
 
26
 
#declare textur = pigment {rgb <0.9,1,0.7>}
27
 
 
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;
34
 
 
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}
39
 
}
40
 
 
41
 
#declare Ecke = union {
42
 
  box {
43
 
    <-Ueberlappung,0,0>
44
 
    <Wanddicke+Ueberlappung,Hoehe,Wanddicke>
45
 
  }
46
 
  box {
47
 
    <0,0,0>
48
 
    <Wanddicke,Hoehe+Ueberlappung,Wanddicke>
49
 
  }
50
 
  box {
51
 
    <0,0,-Ueberlappung>
52
 
    <Wanddicke,Hoehe,Wanddicke+Ueberlappung>
53
 
  }
54
 
  object {Eckenrundung}
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>}
58
 
  Textur(textur)
59
 
}
60
 
 
61
 
#declare Schlitz = function(x0,y0,x1,y1,xx,yy,dm) {
62
 
  sqrt((
63
 
    pow(dm,2)+
64
 
    pow(max(2*(x0-xx)+dm,2*(y0-yy)-dm,2*(xx-x1)-dm,2*(yy-y1)+dm,0),2)
65
 
  )/2)
66
 
}
67
 
 
68
 
#declare fRandom = function {pattern {bozo scale 3}}
69
 
 
70
 
#declare Platine = function(xx,yy,xm,ym) {
71
 
  min(
72
 
    pow(ym,2)+pow(select(fRandom(xx-xm,yy-ym,0)-0.49,
73
 
      xm,
74
 
      min(xm,1-xm,0)),2),
75
 
    pow(xm,2)+pow(select(fRandom(xx-xm,yy-ym,0)-0.51,
76
 
      min(ym,1-ym,0),
77
 
      ym),2))
78
 
}
79
 
 
80
 
#declare Wand = union {
81
 
  object {Ecke}
82
 
  object {Ecke translate (1-Wanddicke)*x}
83
 
  box {  // Platine
84
 
    <0,0,Wanddicke/2> <1,Hoehe-Plastikdicke/2,Wanddicke*2/3>
85
 
    Textur(pigment {
86
 
      function {
87
 
        min(
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))
91
 
      }
92
 
      colour_map {[0.0625 rgb 1/3] [0.0625 rgb <0,1/2,0>]}
93
 
      scale Leiterbahnenabstand
94
 
    })
95
 
  }
96
 
  union {
97
 
    isosurface {
98
 
      function {min(Plastikdicke,sqrt(pow(z-Plastikdicke/2,2)
99
 
        +pow(max(0,Plastikdicke/2+Lochdicke/2
100
 
          -Schlitz(
101
 
            Keinschlitz,Hoehe/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_)
105
 
              -Lochdicke)
106
 
        ),2)))
107
 
      }
108
 
      threshold Plastikdicke/2
109
 
      contained_by {box {
110
 
        <0,0,-Plastikdicke/2>
111
 
        <1,Hoehe-Plastikdicke/2,Plastikdicke*3/2>
112
 
      }}
113
 
      max_gradient 1.1
114
 
    }
115
 
    box {<0,0,Wanddicke-Plastikdicke> <1,Hoehe-Plastikdicke/2,Wanddicke>}
116
 
    box {
117
 
      <0,Hoehe-Plastikdicke,Plastikdicke/2>
118
 
      <1,Hoehe,Wanddicke-Plastikdicke/2>
119
 
    }
120
 
    cylinder {
121
 
      <0,Hoehe-Plastikdicke/2,Plastikdicke/2>
122
 
      <1,Hoehe-Plastikdicke/2,Plastikdicke/2> Plastikdicke/2
123
 
    }
124
 
    cylinder {
125
 
      <0,Hoehe-Plastikdicke/2,Wanddicke-Plastikdicke/2>
126
 
      <1,Hoehe-Plastikdicke/2,Wanddicke-Plastikdicke/2> Plastikdicke/2
127
 
    }
128
 
    Textur(textur)
129
 
  }
130
 
}
131
 
 
132
 
#declare Langwand = union {
133
 
  object{Wand translate -2*x}
134
 
  object{Wand translate -x}
135
 
  object{Wand}
136
 
  object{Wand translate x}
137
 
  object{Ecke translate 2*z}
138
 
  translate -2*z
139
 
}
140
 
 
141
 
#declare Block = BlockAusWand(Wand)
142
 
 
143
 
#ifdef (Version)
144
 
  Setze()
145
 
#else
146
 
  union {
147
 
    object {Langwand}
148
 
    object {Langwand rotate 90*y}
149
 
    object {Langwand rotate 180*y}
150
 
    object {Langwand rotate 270*y}
151
 
    rotate -90*x
152
 
  }
153
 
#end
154