File:Multi-walled Carbon Nanotube.png

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Multi-walled_Carbon_Nanotube.png(640 × 480 pixels, file size: 176 KB, MIME type: image/png)

Summary[edit]

Description
English: A multi-walled armchair carbon nanotube, rendered in POVRay
Date
Source Own work
Author Eric Wieser
//+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:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
  • share alike – If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current15:14, 21 April 2011Thumbnail for version as of 15:14, 21 April 2011640 × 480 (176 KB)Eric WieserLarger render, smaller bonds and atoms for clearer view
15:20, 27 December 2010Thumbnail for version as of 15:20, 27 December 2010512 × 384 (123 KB)Eric Wieser
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):

Global file usage

The following other wikis use this file: