-
Notifications
You must be signed in to change notification settings - Fork 0
/
sacred-n-dna.inc
157 lines (148 loc) · 3.57 KB
/
sacred-n-dna.inc
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
/*
* vesica pisces
*
* we're going to try to create the 'flower of life' (and quite possibly
* extend it into the 'seed of life' later) by creating the first form
* out of circles and CSGs. The 2-d form is created by 7 circles; one
* at the center and 6 radiating out from its center, with radii
* tangental to the center of the first, skewered by 60 degrees apiece.
* Three dimensional will take this into account with two more forms of
* the first 2-d form, each rotated in the y-axis by 60 degrees to
* complete the sphere.
*
* NOTE: This obviously has not been completed yet.
*/
//properly centered
#declare VesicaPisces = intersection {
sphere {
<-2, 0, 0>, 3
}
sphere {
<2, 0, 0>, 3
}
}
//centered
#declare VPEye = union {
difference { //create the hollow 'eye'
object {
VesicaPisces
rotate <0, 0, 90>
}
object {
VesicaPisces
scale <0.99, 0.99, 0.99>
rotate <0, 0, 90>
}
pigment { Col_Glass_Clear }
interior { I_Glass }
finish { F_Glass7 }
}
difference { //iris
sphere {
<0, 0, 0>, 0.99
}
sphere {
<0, 0, 0>, 0.98
}
pigment { Col_Glass_General }
interior { I_Glass }
finish { F_Glass7 }
}
light_source {
<0, 0, 0>
color Red
looks_like {
object {
VesicaPisces
scale <0.25, 0.25, 0.25>
//pigment { color Black }
}
}
}
}
/*
* Flower of Life
* DEBUG: This is buggy as HELL
*/
#declare FlowerOfLife = union {
#local RotAng = 0;
#while (RotAng <= 359)
object {
VesicaPisces
rotate <0, 0, RotAng + 270>
translate <cosd(RotAng) * 2, sind(RotAng) * 2, 0>
}
#declare RotAng = RotAng + 60;
#end
}
//DNA Molecule
#declare DNAStrand = union {
#local MolRad = 0.025;
#local JoinRad = 0.05 / 6;
#local JoinLen = 0.5;
#local Length = 10;
#local TwistPerUnit = 0.5;
#local IncPerTwist = 6;
#local Step = 0;
#local StepInc = 1 / (IncPerTwist / TwistPerUnit);
#local StepDeg = (360 / TwistPerUnit) / IncPerTwist;
#while ((Step * StepInc) <= 10)
sphere {
<(cosd(StepDeg * Step) * JoinLen),
(sind(StepDeg * Step) * JoinLen),
(0 + StepInc)>,
MolRad
pigment { color Blue }
}
sphere {
<(-cosd(StepDeg * Step) * JoinLen),
(-sind(StepDeg * Step) * JoinLen),
(0 + StepInc)>,
MolRad
pigment { color Yellow }
}
#if (Step != 0)
//do one for the above 0[y] coord, one for below
sphere {
<(cosd(StepDeg * Step) * JoinLen),
(sind(StepDeg * Step) * JoinLen),
(0 - StepInc)>,
MolRad
pigment { color Blue }
}
sphere {
<(-cosd(StepDeg * Step) * JoinLen),
(-sind(StepDeg * Step) * JoinLen),
(0 - StepInc)>,
MolRad
pigment { color Yellow }
}
#end
#if ((Step / 2) = 0)
//this one will have a joining bridge
cylinder {
<(cosd(StepDeg * Step) * JoinLen),
(sind(StepDeg * Step) * JoinLen),
(0 + StepInc)>,
<(-cosd(StepDeg * Step) * JoinLen),
(-sind(StepDeg * Step) * JoinLen),
(0 + StepInc)>,
JoinRad
texture { Gold_Nugget }
}
#if (Step != 0)
cylinder {
<(cosd(StepDeg * Step) * JoinLen),
(sind(StepDeg * Step) * JoinLen),
(0 - StepInc)>,
<(-cosd(StepDeg * Step) * JoinLen),
(-sind(StepDeg * Step) * JoinLen),
(0 - StepInc)>,
JoinRad
texture { Gold_Nugget }
}
#end
#end
#declare Step = Step + 1;
#end
}