Class: CrystalCell::Povray::Element

Inherits:
Element
  • Object
show all
Defined in:
lib/crystalcell/povray/element.rb

Overview

VESTA で使われている描画色と ionic radii をまとめたもの。半径もあるが、これは原子半径やイオン半径そのものではない。描画を主眼にして補正をかけている。VESTA は未知のものは 76 76 76 0.8 とするようだ。

Constant Summary collapse

IONIC_RADII =

radii

[
  nil,
  0.2  , 1.22 ,
  0.59 , 0.27 , 0.11 , 0.15 , 1.46 , 1.4  , 1.33 , 1.6  ,
  1.02 , 0.72 , 0.39 , 0.26 , 0.17 , 1.84 , 1.81 , 1.92 ,
  1.51 , 1.12 , 0.745, 0.605, 0.58 , 0.615, 0.83 , 0.78 , 0.745, 0.69 ,
    0.73 , 0.74 , 0.62 , 0.53 , 0.335, 1.98 , 1.96 , 1.98 ,
  1.61 , 1.26 , 1.019, 0.72 , 0.64 , 0.59 , 0.56 , 0.62 , 0.665, 0.86 ,
    1.15 , 0.95 , 0.8  , 0.69 , 0.76 , 2.21 , 2.2  , 0.48 ,
  1.74 , 1.42 , 1.16 , 0.97 , 1.126, 1.109, 1.093, 1.27 , 1.066, 1.053, 1.04 ,
    1.027, 1.015, 1.004, 0.994, 0.985, 0.977, 0.71 , 0.64 , 0.6  , 0.53 , 0.63 ,
    0.625, 0.625, 1.37 , 1.02 , 0.885, 1.19 , 1.03 , 0.94 , 0.62 , 0.8  ,
  1.8  , 1.48 , 1.12 , 1.05 , 0.78 , 0.73 , 0.75 , 0.86 , 0.975, 0.8  , 0.8  ,
    0.8  , 0.8  , 0.8  , 0.8  , 0.8  , 0.8  ,
]
COLOR =
[ nil,
  [ 255, 204, 204], [ 252, 232, 206], 
  [ 134, 224, 116], [  94, 215, 123], [  31, 162,  15], [ 128,  73,  41], 
    [ 176, 185, 230], [ 254,   3,   0], [ 176, 185, 230], [ 254,  55, 181], 
  [ 249, 220,  60], [ 251, 123,  21], [ 129, 178, 214], [  27,  59, 250], 
    [ 192, 156, 194], [ 255, 250,   0], [  49, 252,   2], [ 207, 254, 196], 
  [ 161,  33, 246], [  90, 150, 189], [ 181,  99, 171], [ 120, 202, 255], 
    [ 229,  25,   0], [   0,   0, 158], [ 168,   8, 158], [ 181, 113,   0], 
    [   0,   0, 175], [ 183, 187, 189], [  34,  71, 220], [ 143, 143, 129], 
    [ 158, 227, 115], [ 126, 110, 166], [ 116, 208,  87], [ 154, 239,  15], 
    [ 126,  49,   2], [ 250, 193, 243], 
  [ 255,   0, 153], [   0, 255,  38], [ 102, 152, 142], [   0, 255,   0], 
    [  76, 178, 118], [ 179, 134, 175], [ 205, 175, 202], [ 207, 183, 173], 
    [ 205, 209, 171], [ 193, 195, 184], [ 183, 187, 189], [ 242,  30, 220], 
    [ 215, 128, 187], [ 154, 142, 185], [ 215, 131,  79], [ 173, 162,  81], 
    [ 142,  31, 138], [ 154, 161, 248], 
  [  14, 254, 185], [  30, 239,  44], [  90, 196,  73], [ 209, 252,   6], 
    [ 252, 225,   5], [ 251, 141,   6], [   0,   0, 244], [ 252,   6, 125], 
    [ 250,   7, 213], [ 192,   3, 255], [ 113,   4, 254], [  49,   6, 252], 
    [   7,  65, 251], [  73, 114,  58], [   0,   0, 224], [  39, 252, 244], 
    [  38, 253, 181], [ 180, 179,  89], [ 183, 154,  86], [ 141, 138, 127], 
    [ 179, 176, 142], [ 200, 177, 120], [ 201, 206, 114], [ 203, 197, 191], 
    [ 254, 178,  56], [ 211, 183, 203], [ 149, 137, 108], [  82,  83,  91], 
    [ 210,  47, 247], [   0,   0, 255], [   0,   0, 255], [ 255, 255,   0], 
  [   0,   0,   0], [ 109, 169,  88], [ 100, 158, 114], [  37, 253, 120], 
    [  41, 250,  53], [ 121, 161, 170], [  76,  76,  76], [  76,  76,  76], 
    [  76,  76,  76], [  76,  76,  76], [  76,  76,  76], [  76,  76,  76], 
    [  76,  76,  76], [  76,  76,  76], [  76,  76,  76], [  76,  76,  76], 
    [  76,  76,  76], 
]

Constants inherited from Element

Element::ATOMIC_RADII, Element::SYMBOLS

Class Method Summary collapse

Methods inherited from Element

atomic_radius, num_to_symbol, symbol_to_num

Class Method Details

.color(id) ⇒ Object



61
62
63
64
# File 'lib/crystalcell/povray/element.rb', line 61

def self.color(id)
  id = self.symbol_to_num(id) if id.class == String
  COLOR[id].map {|i| i.to_f / 255.0}
end

.draw_radius(id) ⇒ Object



56
57
58
59
# File 'lib/crystalcell/povray/element.rb', line 56

def self.draw_radius(id)
  id = self.symbol_to_num(id) if id.class == String
  IONIC_RADII[id]
end