Folds and the strain ellipsoid: a general model