GIMP can do it using the GIH (gimp image hose) brush type PSP can do it using "tubes".

Not familiar with photoshop. Any particular version of PS?

-Rob A>