Structure-based representation of polymers