Surface formation and modification in electrical discharge machining