Encoding Demonstrations and Learning New Trajectories using Canal Surfaces