A gas insulated substation (GIS) barrier with conical insulators from a cast epoxy resin is optimized to withstand AC and DC stresses. The field distribution across insulators with long creepage path and field distortion due to the deposition of charge on the insulator surface is calculated on a parametric geometry model by finite element techniques. The shape of the insulator and surrounding electrodes was improved fairly quickly using a direct search method with constraints. The results of optimization were verified by standard measurements on high voltage insulators in SF 6 gas.