Changeset 1130 for branches/sandbox


Ignore:
Timestamp:
Apr 14, 2011 9:18:11 AM (10 years ago)
Author:
toby
Message:

add labeling to rb plotting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/rb.tcl

    r1127 r1130  
    14221422    puts $fp "box  0.000 Black"
    14231423    puts $fp "background White"
    1424     puts $fp "nolabels"
     1424    #puts $fp "nolabels"
    14251425    puts $fp "cell $a $a $a 90 90 90"
    14261426    puts $fp "spgr P 1"
     
    14311431        incr i
    14321432        puts $fp "atom c $i [expr {$x/$scale}] [expr {$y/$scale}] [expr {$z/$scale}]"
     1433        puts $fp "labeltext [expr {0.02 + $x/$scale}] [expr {0.01 + $y/$scale}] [expr {0.01 + $z/$scale}] $i"
    14331434    }
    14341435    puts $fp "sphere c  [expr 0.100*($a/$scale)] Red"
     
    14521453    puts $fp "atom o 4 0 0 [expr {0.1*$a/$scale}]"
    14531454    puts $fp "bond o o [expr {0.01*$a/$scale}] [expr {-0.1 + $a/$scale}] [expr {0.1 + $a/$scale}] Black"
     1455    puts $fp "labelscale 0.5"
     1456    puts $fp "labeltext [expr {0.11*$a/$scale}] 0 0 x"
     1457    puts $fp "labeltext 0 [expr {0.11*$a/$scale}] 0 y"
     1458    puts $fp "labeltext 0 0 [expr {0.11*$a/$scale}] z"
    14541459    puts $fp "sphere o [expr {0.02*$a/$scale}] Blue"
    14551460    puts $fp "origin   .0 .0 .0"
     
    15581563    # get matching atoms coordinate range
    15591564    set firstind [lsearch $::expmap(atomlist_$phase) $firstatom]
    1560     foreach atom [lrange \
     1565    set matchedatomlist [lrange \
    15611566                      [lrange $::expmap(atomlist_$phase) $firstind end] \
    1562                       0 [expr {$natom-1}]] {
     1567                      0 [expr {$natom-1}]]
     1568    foreach atom $matchedatomlist {
    15631569        foreach s {x y z} {
    15641570            set $s [atominfo $phase $atom $s]
     
    16091615        set type [atominfo $phase $atom type]
    16101616        set typelist($type) 1
    1611         puts -nonewline $fp "atom $type $atom "
     1617        set xyz ""
    16121618        foreach v {x y z} {
    1613             puts -nonewline $fp "[atominfo $phase $atom $v] "
    1614         }
    1615         puts $fp ""
     1619            append xyz "[atominfo $phase $atom $v] "
     1620        }
     1621        puts $fp "atom $type $atom $xyz"
     1622        if {[lsearch $matchedatomlist $atom] != -1} {
     1623            puts $fp "labeltext $xyz $atom"
     1624        }
    16161625               
    16171626        set uiso [atominfo $phase $atom Uiso]
     
    16251634        }
    16261635    }
     1636
    16271637    foreach type [array names typelist] color {Green Blue Magenta Cyan} {
    16281638        if {$type == ""} break
     
    16521662    puts $fp ""
    16531663    puts $fp "background White"
    1654     puts $fp "nolabels"
     1664    #puts $fp "nolabels"
     1665    puts $fp "labelscale 0.5"
    16551666    puts $fp "spgr P 1"
    16561667    puts $fp "pack $rbrange"
     
    16601671        incr i
    16611672        puts $fp "atom c $i $x $y $z"
     1673        puts $fp "labeltext $x $y $z r$i"
    16621674    }
    16631675    foreach bondpair $rbbondlist {
     
    16731685    #puts $fp "bond o o [expr {0.01*$a/$scale}] [expr {-0.1 + $a/$scale}] [expr {0.1 + $a/$scale}] Black"
    16741686    close $fp
     1687    MyMessageBox -parent . -title "Info" \
     1688                -message "Note that the phase is drawn in green, blue, cyan & magenta and the rigid body in red."
    16751689    if {$app != ""} {exec $app $file &}
    16761690}
Note: See TracChangeset for help on using the changeset viewer.