TABLE OF CONTENTS


::pwtk::xsf::getPrimVec

SYNOPSIS

proc ::pwtk::xsf::getPrimVec  {xsfFile} {

USAGE

   ::pwtk::xsf::getPrimVec xsfFile

PURPOSE

Return the primitive vectors from the XSF file, that is, the PRIMVEC section without the PRIMVEC keyword line, i.e:

        ax ay az
        bx by bz
        cx cy cz

SOURCE

    variable vec_unit

    ::pwtk::fileMustExist $xsfFile XSF
    
    set xsfList [split [::pwtk::skipEmptyLines [::pwtk::readFile $xsfFile]] \n]
    set ind     [lsearch $xsfList *PRIMVEC*]

    if { $ind > -1 } {
        return [join [lrange $xsfList [expr {$ind + 1}] [expr {$ind + 3}]] \n]
    } else {
        ::pwtk::error "$xsfFile is not an XSF file" 1
    }
    return ""
}