TABLE OF CONTENTS


::pwtk::boundingBox

SYNOPSIS

proc ::pwtk::boundingBox {atmPos} {

PURPOSE

Get the bounding box of the atomic positions "atmPos" (useful for molecules).

ARGUMENTS

RETURN VALUE

Bounding box as a list of "xmin xmax ymin ymax zmin zmax".

SOURCE

    foreach i {1 2 3} {
        set min($i) +1e20
        set max($i) -1e20
    }
    foreach atom [split [purifyCoor $atmPos] \n] {
        incr ia
        lassign $atom atm tau(1,$ia) tau(2,$ia) tau(3,$ia)
        foreach i {1 2 3} {
            if { $tau($i,$ia) < $min($i) } { set min($i) $tau($i,$ia) }
            if { $tau($i,$ia) > $max($i) } { set max($i) $tau($i,$ia) }
        }
    }    
    return [list $min(1) $max(1) $min(2) $max(2) $min(3) $max(3)]
}