Inverse finite element method for three-dimensional frame structures