-
Notifications
You must be signed in to change notification settings - Fork 2
/
drawpolyhedron.pov
79 lines (69 loc) · 1.33 KB
/
drawpolyhedron.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
#version 3.6;
#include "textures.inc"
#include "colors.inc"
background { White }
camera {
location <0,0,-15>
look_at <0,0,0>
focal_point <0,0,0>
up <0,1,0>
right <1,0,0>
}
light_source {
<-15,-15,-15>
color rgb <1,1,1>
}
light_source {
<15,15,15>
color rgb <1,1,1>
}
light_source {
<-15,15,-15>
color rgb <1,1,1>
}
union {
#declare i=0;
#while (i<dimension_size(tris,1))
#declare k=tris[i][0];
#declare l=tris[i][1];
#declare m=tris[i][2];
polygon {
4,
<cpoints[k][0],cpoints[k][1],cpoints[k][2]>,
<cpoints[l][0],cpoints[l][1],cpoints[l][2]>,
<cpoints[m][0],cpoints[m][1],cpoints[m][2]>,
<cpoints[k][0],cpoints[k][1],cpoints[k][2]>
pigment { facecolour transmit (1.0-faceopacity) }
finish { phong .8 reflection {0.3} }
}
#declare i=i+1;
#end
}
union {
#declare i=0;
#while (i<Nvertices)
sphere {
<layout3D[i][0],layout3D[i][1],layout3D[i][2]>, nodediameter
texture {
pigment { nodecolour }
finish { phong 1 }
}
}
#declare i = i+1;
#end
#declare i=0;
#while (i<Nedges)
#declare uu=edges[i][0];
#declare vv=edges[i][1];
cylinder {
<layout3D[uu][0],layout3D[uu][1],layout3D[uu][2]>,
<layout3D[vv][0],layout3D[vv][1],layout3D[vv][2]>,
edgewidth
texture {
pigment { edgecolour }
finish { phong .5 }
}
}
#declare i=i+1;
#end
}