This relates to methods and devices for achieving contact between the wall of a cavity or passageway and a medical device when used in tortuous anatomy. An electromigration quality value is computed for each of the routings, and the routing with the best electromigration quality value is selected. Electrically charged rails are placed around the beam.