Convex analysis and ideal tensegrities