A teat modeling device includes a housing with an illumination unit operative to project a structured light pattern on at least one teat of a dairy animal and a camera axially aligned with the illumination unit and positioned between the illumination unit and the at least one teat of the dairy animal, wherein the camera is operative to capture images of the structured light pattern reflected off the at least one teat. A teat modeling device further includes a memory unit storing expected shape parameters of the at least one teat based on a pre-defined shape of the at least one teat and a processor operative to compute a three dimensional model of the at least one teat based on the stored parameters, positioning of the reflected pattern on the image and spacing between elements of the reflected pattern.