TABLE OF CONTENTS


::pwtk::shiftCoor

SYNOPSIS

proc ::pwtk::shiftCoor {dx dy dz coor} {

PURPOSE

Displace given coordinates by ($dx,$dy,$dz) vector.

ARGUMENTS

SOURCE

    # multiply by 1.0 to force the use of floating-point arithmetics
    # (dx can be expression such as 1/2)
    set dx [expr 1.0*$dx]
    set dy [expr 1.0*$dy]
    set dz [expr 1.0*$dz]
    
    set result ""
    foreach line [split $coor \n] {     
        if { [llength $line] == 4 } {
            lassign $len sym x y z
            # multiply x,y,z by 1.0 to force the use of floating-point arithmetics
            append result [format $::pwtk::fmt_coor(4) \
                               $sym [expr 1.0*$x + $dx] [expr 1.0*$y + $dy] [expr 1.0*$z + $dz]]
        }
    }
    return $result
}