We present a method for reduced piecewise fitting of ab initio potential energy data for use in rovibrational calculations of polyatomic molecules. The procedure involves fitting of the 1-, 2-, 3, and 4-mode potential fragments by a least squares refinement of polynomial terms which are automatically generated by the geometries of the data points. The method is tested for H2CS, for which we have an analytical six-dimensional potential energy surface, which is used to generate potential data in order to mimic the interface between the variational code MULTIMODE and electronic structure packages. (C) 2001 Published by Elsevier Science B.V.