-
Notifications
You must be signed in to change notification settings - Fork 0
/
WoodTable.pov
134 lines (115 loc) · 3.89 KB
/
WoodTable.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
#version 3.7;
#include "colors.inc"
#include "textures.inc"
#include "shapes.inc"
#include "Utils.pov"
#local debugMode = 0;
#if (debugMode)
global_settings {
assumed_gamma 1
charset utf8
}
#end
// ----------------------------------------
// WoodTable
// ----------------------------------------
#macro WoodTable(tWidth, tHeight, tThickness, absHeight)
#local feetWidth = 0.05 * tWidth;
#local feetHeight = 0.05 * tHeight;
#local feetAbsHeight = absHeight - tThickness;
#local sWidth = tWidth - feetWidth;
#local sHeight = 0.125 * feetAbsHeight;
#local ibThickness = 0.05 * tThickness;
#local sbThickness = 0.10 * tThickness;
#local cbThickness = tThickness - ibThickness - sbThickness;
#local cbXOffset = 0.01 * tWidth;
#local cbZOffset = 0.01 * tHeight;
union {
box {
<-feetWidth/2, 0, -feetHeight/2>,
<feetWidth/2, feetAbsHeight, feetHeight/2>
translate (tWidth/2 - feetWidth/2) * x
translate (tHeight/2 - feetHeight/2) * z
}
box {
<-feetWidth/2, 0, -feetHeight/2>,
<feetWidth/2, feetAbsHeight, feetHeight/2>
translate -(tWidth/2 - feetWidth/2) * x
translate (tHeight/2 - feetHeight/2) * z
}
box {
<-feetWidth/2, 0, -feetHeight/2>,
<feetWidth/2, feetAbsHeight, feetHeight/2>
translate (tWidth/2 - feetWidth/2) * x
translate -(tHeight/2 - feetHeight/2) * z
}
box {
<-feetWidth/2, 0, -feetHeight/2>,
<feetWidth/2, feetAbsHeight, feetHeight/2>
translate -(tWidth/2 - feetWidth/2) * x
translate -(tHeight/2 - feetHeight/2) * z
}
union {
box {
<-sWidth/2 + feetWidth/2, feetAbsHeight - sHeight, -(tHeight/2 - feetHeight)>,
<sWidth/2 - feetWidth/2, feetAbsHeight, -tHeight/2>
}
box {
<-sWidth/2 + feetWidth/2, feetAbsHeight - sHeight, (tHeight/2 - feetHeight)>,
<sWidth/2 - feetWidth/2, feetAbsHeight, tHeight/2>
}
box {
<-tWidth/2, feetAbsHeight - sHeight, -tHeight/2 + feetHeight/2>,
<-tWidth/2 + feetHeight, feetAbsHeight, tHeight/2 - feetHeight/2>
}
box {
<tWidth/2, feetAbsHeight - sHeight, -tHeight/2 + feetHeight/2>,
<tWidth/2 - feetHeight, feetAbsHeight, tHeight/2 - feetHeight/2>
}
}
difference {
union {
box {
<-tWidth/2, feetAbsHeight, -tHeight/2>,
<tWidth/2, feetAbsHeight + ibThickness, tHeight/2>
}
box {
<-tWidth/2 + cbXOffset, feetAbsHeight + ibThickness, -tHeight/2 + cbZOffset>,
<tWidth/2 - cbXOffset, feetAbsHeight + ibThickness + cbThickness, tHeight/2 - cbZOffset>
}
box {
<-tWidth/2, feetAbsHeight + ibThickness + cbThickness, -tHeight/2>,
<tWidth/2, feetAbsHeight + ibThickness + cbThickness + sbThickness, tHeight/2>
}
}
box {
<-tWidth/2 * 0.9, absHeight - cbThickness, -tHeight/2 * 0.9>,
<tWidth/2 * 0.9, absHeight + 1, tHeight/2 * 0.9>
}
}
texture {
DMFWood3
rotate 90 * x
}
}
#end
// ----------------------------------------
// Scene
// ----------------------------------------
#if (debugMode)
camera {
location <0, 1, -1.5>
look_at <0, 0, 1>
}
background { White * 0.5 }
light_source { <-1, 2, -2> color White }
plane {
y, 0
texture {
pigment { checker rgb<0.3, 0.3, 0.3> White }
}
}
object {
WoodTable(1, 0.7, 0.10, 0.8)
}
#end