Run do_step function until the diagramms have diverged from each other.
        Also determines how big the figure is going to be by calculating the borders
        from new residue coordinates. These are then added some buffer space.

def make_new_projection_values(self,width=160):
        """Run do_step function until the diagramms have diverged from each other.
        Also determines how big the figure is going to be by calculating the borders
        from new residue coordinates. These are then added some buffer space.

        """
        #Make gap between residues bigger if plots have a lot of rings - each ring after the 4th
        #give extra 12.5px space
        start = timer()
        if self.topology_data.ring_number>4:
            width = width + (self.topology_data.ring_number-4)*12.5
        values = [v for v in self.nearest_points_projection.values()]
        xy_values = [v for v in self.nearest_points_coords.values()]
        coeff_value = [v for v in self.b_for_all.values()]
        energy = 100
        while energy > 0.2:
            values, energy = self.do_step(values,xy_values,coeff_value, width)
            time = timer() - start
            i=0
            xy_values =[]
            for residue in  self.nearest_points_coords:
                b = self.a.boundary.parallel_offset(self.topology_data.closest_atoms[residue][0][1]*50+50,"left",join_style=2).convex_hull
                self.nearest_points_projection[residue] = values[i]
                self.nearest_points[residue] = b.boundary.interpolate(self.nearest_points_projection[residue] % b.boundary.length)
                self.nearest_points_coords[residue] = self.nearest_points[residue].x, self.nearest_points[residue].y
                xy_values.append(self.nearest_points_coords[residue])
                i+=1
            values = [v for v in self.nearest_points_projection.values()]
            if time>30:
                self.molsize1 = self.molsize1 + self.molsize1 * 0.2 #Increase molecule svg size
                self.molsize2 = self.molsize2 + self.molsize2 * 0.2
                self.draw_molecule()
                break

        #Calculate the borders of the final image
        max_x = max(v[0] for k,v in self.nearest_points_coords.items())
        min_x = min(v[0] for k,v in self.nearest_points_coords.items())
        min_y = min(v[1] for k,v in self.nearest_points_coords.items())
        max_y = max(v[1] for k,v in self.nearest_points_coords.items())
        if min_x<0:
            self.x_dim =(max_x-min_x)+600 #600 acts as buffer
        elif max_x<self.molsize1 and min_x<0: #In case all residues are grouped on one end of the molecule
            self.x_dim = (self.molsize1-min_x)+600
        elif max_x<self.molsize1 and min_x>0:
            self.x_dim = self.molsize1+600
        else:
            self.x_dim = max_x+600
        if min_y<0:
            self.y_dim = (max_y-min_y)+400 #400 acts as buffer
        elif max_y<self.molsize2 and min_y<0:
            self.y_dim = (self.molsize2-min_y)+400
        elif max_y<self.molsize2 and min_y>0:
            self.y_dim = self.molsize2+400
        else:
            self.y_dim = max_y+400
        end = timer()
        print "Drawing molecule:"+str(end-start)