Singular sets of convex bodies and surfaces with generalized curvatures