-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspiny.pov
More file actions
208 lines (200 loc) · 3.58 KB
/
spiny.pov
File metadata and controls
208 lines (200 loc) · 3.58 KB
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
#macro sphereGlass()
sphere {
<0,0,0>,3.0
}
#end
#macro cylinderTemplateZ()
cone {
<0,0,0>,1.5
<0,0,5.0>,0.0
}
#end
#macro cylinderTemplateX()
object {
cone {
<0,0,0>,1.5
<0,0,5.0>,0.0
}
rotate <0.0,90.0,0.0>
}
#end
#macro cylinderTemplateY()
object {
cone {
<0,0,0>,1.5
<0,0,5.0>,0.0
}
rotate <-90.0,0.0,0.0>
}
#end
#macro spinyBall()
merge {
sphere {
<0,0,0>,3.0
}
spinesZ()
spinesX()
spinesY()
}
#end
#macro spinesY()
merge {
object {
cylinderTemplateY()
rotate <0.0,0.0,0.0>
}
object {
cylinderTemplateY()
rotate <0.0,0.0,45.0>
}
object {
cylinderTemplateY()
rotate <0.0,0.0,90.0>
}
object {
cylinderTemplateY()
rotate <0.0,0.0,135.0>
}
object {
cylinderTemplateY()
rotate <0.0,0.0,180.0>
}
object {
cylinderTemplateY()
rotate <0.0,0.0,225.0>
}
object {
cylinderTemplateY()
rotate <0.0,0.0,270.0>
}
object {
cylinderTemplateY()
rotate <0.0,0.0,315.0>
}
}
#end
#macro spinesX()
merge {
object {
cylinderTemplateX()
rotate <0.0,0.0,0.0>
}
object {
cylinderTemplateX()
rotate <0.0,45.0,0.0>
}
object {
cylinderTemplateX()
rotate <0.0,90.0,0.0>
}
object {
cylinderTemplateX()
rotate <0.0,135.0,0.0>
}
object {
cylinderTemplateX()
rotate <0.0,180.0,0.0>
}
object {
cylinderTemplateX()
rotate <0.0,225.0,0.0>
}
object {
cylinderTemplateX()
rotate <0.0,270.0,0.0>
}
object {
cylinderTemplateX()
rotate <0.0,315.0,0.0>
}
}
#end
#macro spinesZ()
merge {
object {
cylinderTemplateZ()
rotate <0.0,0.0,0.0>
}
object {
cylinderTemplateZ()
rotate <45.0,0.0,0.0>
}
object {
cylinderTemplateZ()
rotate <90.0,0.0,0.0>
}
object {
cylinderTemplateZ()
rotate <135.0,0.0,0.0>
}
object {
cylinderTemplateZ()
rotate <180.0,0.0,0.0>
}
object {
cylinderTemplateZ()
rotate <225.0,0.0,0.0>
}
object {
cylinderTemplateZ()
rotate <270.0,0.0,0.0>
}
object {
cylinderTemplateZ()
rotate <315.0,0.0,0.0>
}
}
#end
#macro
openscad_camera_angle(w ,h) (11*pow(w/h,0.5))
#end // OpenSCAD camera angle is dependent on view port aspect ratio. Formula is an estimation"
#macro
scad_camera(openscad_vpt, openscad_vpr, openscad_vpd, openscad_vpw, openscad_vph)
camera {
orthographic
location <0,0,openscad_vpd>
right <-openscad_vpw/openscad_vph,0,0>
angle openscad_camera_angle(openscad_vpw,openscad_vph)
up <0,1.33,0>
rotate openscad_vpr
translate openscad_vpt
look_at <0,0,0>
}
#end
#macro
scad_light_source(openscad_vpt, openscad_vpr, openscad_vpd)
light_source {
<-1,1,1>*openscad_vpd color rgb <1,1,1>
rotate openscad_vpr
translate openscad_vpt
}
light_source {
<1,-1,-1>*openscad_vpd color rgb <1,1,1>
rotate openscad_vpr
translate openscad_vpt
}
#end
#macro scad_background()
#include "coordinates.pov"
#declare openscad_cornfield = color rgb <1,1,0.898039>;
#declare openscad_metalic = color rgb <0.666667,0.666667,1>;
#declare openscad_sunset = color rgb <0.666667,0.266667,0.266667>;
background { openscad_cornfield }
#default { texture { pigment { rgb <1,1,0> } finish { ambient 0.15 diffuse 0.85 } } }
#end
/*
************ spiny_test.ini ************
Width=1600
Height=1200
Input_File_Name="spiny_test.pov"
Antialias=On
Antialias_Threshold=0.1
Display=On
************ spiny_test.sh ************
povray -L${POVRAY_SCAD_LIB} spiny_test.ini
*/
#macro scad_axes(axe_length)
object {
AxisXYZ( axe_length, axe_length, axe_length, Tex_Dark, Tex_White)
}
#end