I used atlas mapping which worked well in the first version of this object, but then I changed some things, and it got distorted. So it hasn't got to do with the kind of mapping, just (I guess) with the way points are welded or not. Maybe I should unweld all points, weld the uv's, then merge the points again. Something like that.