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

« back to all changes in this revision

Viewing changes to datasrc/pics/zahn.inc

  • 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 2005 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 Dreifachlicht = 1;
20
 
#declare Hintergrund = 0;
21
 
 
22
 
#include "cuyopov.inc"
23
 
 
24
 
 
25
 
 
26
 
#declare Kiefer_Radius = 1/3;
27
 
#declare Zahnfleisch_Radius = 1/20;
28
 
#declare Zahn_Duennheit = 8;
29
 
 
30
 
#declare Zahn_Farbe = <1,1,2/3>;
31
 
#declare Haut_Farbe = <1,1/2,2/3>;
32
 
 
33
 
#declare Haut_finish = finish {
34
 
  specular 1/4
35
 
}
36
 
 
37
 
 
38
 
 
39
 
#macro Zahn_streck(l,w)
40
 
  #if (l=1)
41
 
    (3/5)
42
 
  #end
43
 
  #if (l=2)
44
 
    #if (mod(w,90)=45)
45
 
      1.4
46
 
    #else
47
 
      1
48
 
    #end
49
 
  #end
50
 
#end
51
 
 
52
 
 
53
 
 
54
 
#macro Zahn(l,w)
55
 
  intersection {
56
 
    sphere {
57
 
      0 1
58
 
      scale <Zahn_streck(l,w),1/Zahn_Duennheit,1/Zahn_Duennheit>
59
 
    }
60
 
    box {<0,-1,-1> <2,1,1>}
61
 
    Textur(pigment {rgb Zahn_Farbe})
62
 
    rotate w*z
63
 
  }
64
 
#end
65
 
 
66
 
 
67
 
 
68
 
#declare Rechts_Rampe = function(x) {select(x,exp(-1/(4*x*x)),0)}
69
 
 
70
 
#declare Doppel_Rampe = function(x1,x2,y1,y2,x)
71
 
  {(y2*Rechts_Rampe((x1-x)/(x2-x1))+y1*Rechts_Rampe((x-x2)/(x2-x1)))
72
 
    / (Rechts_Rampe((x1-x)/(x2-x1))+Rechts_Rampe((x-x2)/(x2-x1)))}
73
 
 
74
 
#declare Kiefer_f = function(x,y,z) {
75
 
  Doppel_Rampe (0.5,1.5,-2,0,
76
 
    pow(
77
 
      pow(pow(x/Kiefer_Radius,2)+pow(y/Kiefer_Radius,2),2)+
78
 
      pow(z/(1/Zahn_Duennheit+2*Zahnfleisch_Radius),4),
79
 
      1/4))
80
 
  }
81
 
 
82
 
 
83
 
 
84
 
#declare Kreis = function(r,x,y) {
85
 
    sqrt(pow(x/r,2)+pow(y/r,2))
86
 
  }
87
 
 
88
 
#declare Torus = function (r,rr,x,y,z) {
89
 
    Kreis (r,x,sqrt(y*y+z*z)-rr)
90
 
  }
91
 
 
92
 
#declare atanf=function(b,a)                            // b=sin, a=cos
93
 
  {(select((b),
94
 
    select((a),
95
 
      select((a)-(b),
96
 
        atan2(-(b),-(a))-pi,
97
 
        -pi/2-atan2(-(a),-(b))),
98
 
      select((a)+(b),
99
 
        atan2((a),-(b))-pi/2,
100
 
        -atan2(-(b),(a)))),
101
 
    select((a),
102
 
      select((a)+(b),
103
 
        pi-atan2((b),-(a)),
104
 
        pi/2+atan2(-(a),(b))),
105
 
      select((a)-(b),
106
 
        pi/2-atan2((a),(b)),
107
 
        atan2((b),(a)))
108
 
      )))}
109
 
 
110
 
#declare Zahnfleisch_f = function(r,w,x,y,z) {
111
 
    Doppel_Rampe (0.5,1.5,-2,0,
112
 
      Torus (Zahnfleisch_Radius,r,
113
 
        sqrt(x*x+y*y)-Kiefer_Radius,
114
 
        (mod(3.5*pi+atanf(y,x)-w*pi/180,pi)-pi/2)*Kiefer_Radius,
115
 
        z))
116
 
  }
117
 
 
118
 
#macro Zahnfleisch(l,w)
119
 
  #local rr = sqrt(1-pow(Kiefer_Radius/Zahn_streck(l,w),2))/Zahn_Duennheit
120
 
    +Zahnfleisch_Radius;
121
 
  +Zahnfleisch_f(rr,w,x,y,z)
122
 
#end
123
 
 
124
 
 
125
 
 
126
 
#macro Gebiss(H,V,D1,D2)
127
 
  union {
128
 
    isosurface {
129
 
      function {
130
 
        Kiefer_f (x,y,z)
131
 
        #if (H>0)
132
 
          Zahnfleisch(H,0)
133
 
        #end
134
 
        #if (V>0)
135
 
          Zahnfleisch(V,90)
136
 
        #end
137
 
        #if (D1>0)
138
 
          Zahnfleisch(D1,45)
139
 
        #end
140
 
        #if (D2>0)
141
 
          Zahnfleisch(D2,135)
142
 
        #end}
143
 
      threshold -1
144
 
      max_gradient 90
145
 
      contained_by {box {
146
 
        -(Kiefer_Radius+2*Zahnfleisch_Radius)
147
 
        (Kiefer_Radius+2*Zahnfleisch_Radius)}}
148
 
    }
149
 
    #if (H>0)
150
 
      Zahn(H,0)
151
 
      Zahn(H,180)
152
 
    #end
153
 
    #if (V>0)
154
 
      Zahn(V,90)
155
 
      Zahn(V,270)
156
 
    #end
157
 
    #if (D1>0)
158
 
      Zahn(D1,45)
159
 
      Zahn(D1,225)
160
 
    #end
161
 
    #if (D2>0)
162
 
      Zahn(D2,135)
163
 
      Zahn(D2,315)
164
 
    #end
165
 
    Textur(texture{
166
 
      pigment {rgb Haut_Farbe}
167
 
      finish {Haut_finish}})
168
 
    no_shadow
169
 
  }
170
 
#end
171