Making stitch marks as hesightmap

hi, i was trying to make stitch marks around a simple flower shape i painted on a surface, since the shape is just a mask it has no uv distinction so i was looking for a way to repeat a brush pattern along a path(mask) does anyone know any method to repeat the height map brush around a mask which rotates the brush according to the shape? i have photoshop and substance painter too if necessary. thanks in advance :grinning: