Thermoforming of polymers