Summary[edit]
//+FN +UA#
#version 3.6;
#include "colors.inc"
global_settings {
assumed_gamma 2.1
ambient_light color rgb 1
}
// ----------------------------------------
camera {
location <1.5, 1.5, 1.5>
direction 1.5*z
right x*image_width/image_height
look_at <0.0, 0.0, 0.0>
}
/*
sky_sphere {
pigment {
gradient y
color_map {
[0.0 rgb <0.6, 0.7, 1.0>]
[0.7 rgb <0.0, 0.1, 0.8>]
}
}
}
*/
light_source {
<0, 0, 20>
color rgb <1, 1, 1>
area_light
x*10, y*10, 5, 5
jitter
rotate -x*45
}
light_source {
<20, 0, 0>
color rgb <1, 1, 1>
area_light
z*10, y*10, 5, 5
jitter
}
#declare MODE_ARMCHAIR = 1;
#declare MODE_RIBBON = 2;
#declare MODE_ZIGZAG = 3;
#macro nanoTube(mode, ba, bb, atomColor)
#local s = sqrt(3)/2;
#local b1 = max(ba, bb);
#switch(mode)
#case(MODE_ARMCHAIR)
#local bb = bb + 6;
#local r = (bb - 6)/pi;
#macro ab2Vector(b, a) <b, sin(a/r)*r, cos(a/r)*r>
#end
#break
#case(MODE_RIBBON)
#macro ab2Vector(a, b) <a, 0, b>
#end
#break
#case(MODE_ZIGZAG)
#local ba = ba + 2;
#local r = (ba*s)/pi;
#macro ab2Vector(a, b) <cos(a/r)*r, sin(a/r)*r, b>
#end
#break
#end
#macro atom(pos)
sphere {
pos, 0.2
texture {
pigment {
color rgb atomColor
}
finish{
specular 0.4
}
}
}
#end
#macro bond(from, to)
cylinder {
from, to, 0.075
texture {
pigment {
color rgb atomColor*0.5 + 0.5
}
finish{
specular 0.6
}
}
}
#end
union {
#local m = -b1;
#while (m < b1)
#local n = -b1;
#while (n < b1)
#local a0 = (n*2 + m)*s;
#local b0 = m*1.5;
#if (abs(a0) < ba & abs(b0) < bb)
union{
#if (b0 > -bb + 2)
atom(ab2Vector(a0, b0))
#end
#if (abs(b0) < bb-2)
bond(ab2Vector(a0, b0), ab2Vector(a0, b0 + 1))
#end
#if (b0<bb-2)
atom(ab2Vector(a0, b0 + 1))
#if (a0 < ba-s)
bond(ab2Vector(a0, b0 + 1), ab2Vector(a0 + s, b0 + 1.5))
#end
#if (a0 > s-ba)
bond(ab2Vector(a0, b0 + 1), ab2Vector(a0-s, b0 + 1.5))
#end
#end
}
#end
#local n = n + 1;
#end
#local m = m + 1;
#end
scale 0.08
}
#end
union {
nanoTube(MODE_ARMCHAIR, 6, 12, <1, 0, 0>)
nanoTube(MODE_ARMCHAIR, 9, 9, <0, 1, 0>)
nanoTube(MODE_ARMCHAIR, 12, 6, <0, 0, 1> )
rotate -clock*60*x
}
Licensing[edit]
|
I, the copyright holder of this work, hereby publish it under the following license:
|
Click on a date/time to view the file as it appeared at that time.
| Date/Time | Thumbnail | Dimensions | User | Comment |
| current | 15:14, 21 April 2011 |  | 640 × 480 (176 KB) | Eric Wieser | Larger render, smaller bonds and atoms for clearer view |
| 15:20, 27 December 2010 |  | 512 × 384 (123 KB) | Eric Wieser | |
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):
The following other wikis use this file:
- Usage on ca.wikipedia.org
- Usage on ko.wikipedia.org
- Usage on pt.wikipedia.org
- Usage on ru.wikipedia.org