-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGhostTable.pov
144 lines (124 loc) · 3.64 KB
/
GhostTable.pov
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#version 3.7;
#include "colors.inc"
#include "shapes.inc"
#include "Utils.pov"
#local debugMode = 0;
#if (debugMode)
global_settings {
assumed_gamma 1
charset utf8
}
#end
// ----------------------------------------
// GhostTable
// ----------------------------------------
#macro GhostTable(tWidth, tHeight, tThickness, absHeight, baseRadius)
#local yTop = absHeight - tThickness;
#local sOffset = 0.001 * tWidth;
#local spThickness = 0.05 * absHeight;
#local border = 0.1;
#local padding = (tHeight - border)/2;
#local barHeight = absHeight / 10;
#local barThickness = 0.05;
#local baseCylinder = cylinder {
<0, 0, 0>,
<0, yTop, 0>,
baseRadius
}
union {
object {
RoundedSquare(tWidth - 2 * sOffset, tHeight, tThickness)
translate <0, yTop, 0>
pigment { White }
}
union {
object {
baseCylinder
translate <-tWidth/2 + border, 0, padding>
}
object {
baseCylinder
translate <tWidth/2 - border - baseRadius, 0, padding>
}
object {
baseCylinder
translate <-tWidth/2 + border, 0, -padding>
}
object {
baseCylinder
translate <tWidth/2 - border - baseRadius, 0, -padding>
}
box {
<-tWidth/2 - barThickness/2 + 2 * baseRadius, absHeight/2 - barHeight/2, -tHeight/2 + baseRadius>,
<-tWidth/2 + barThickness/2 + 2 * baseRadius, absHeight/2 + barHeight/2, tHeight/2 - baseRadius>
}
box {
<tWidth/2 - 2 * baseRadius - barThickness/2, absHeight/2 - barHeight/2, -tHeight/2 + baseRadius>,
<tWidth/2 - 2 * baseRadius + barThickness/2, absHeight/2 + barHeight/2, tHeight/2 - baseRadius>
}
box {
<-tWidth/2 + 2 * baseRadius, absHeight/2 - barHeight/2, -barThickness/2>,
<tWidth/2 - 2 * baseRadius, absHeight/2 + barHeight/2, barThickness/2>
}
texture { BlackMetal }
}
}
#end
#macro RoundedSquare(tWidth, tHeight, tThickness)
#local radio = tThickness * 0.8;
#local radioOffset = tThickness * 0.2;
union {
box {
<-tWidth/2, 0, -tHeight/2>,
<tWidth/2, tThickness, tHeight/2>
}
difference {
union {
cylinder {
<-tWidth/2, radioOffset, -tHeight/2>,
<tWidth/2, radioOffset, -tHeight/2>,
radio
}
cylinder {
<-tWidth/2, radioOffset, tHeight/2>,
<tWidth/2, radioOffset, tHeight/2>,
radio
}
}
box {
<-tWidth, 0, -tHeight>,
<tWidth, -tThickness, tHeight>
}
}
}
#end
// ----------------------------------------
// Scene
// ----------------------------------------
#if (debugMode)
camera {
//location <0.5, 0, -2.5>
location <0, 0.5, -2.5>
look_at <0, 0, 1>
}
background { White * 0.5 }
light_source { <-1, 2, -2> color White }
plane {
y, -1
texture {
pigment { checker rgb<0.3, 0.3, 0.3> White }
}
}
#local h = 0.8;
union {
object {
GhostTable(1.5, 0.7, 0.03, h, 0.06)
rotate y * -30
}
/*box {
<-0.6, 0, -0.2>,
<-0.2, h, 0.2>
}*/
translate <0, -1, 1>
}
#end