Summary Motivated by an application to the clustering of milking kinetics of dairy goats, we propose a novel approach for functional data clustering. This issue is of growing interest in precision livestock farming, which is largely based on the development of data acquisition automation and on the development of interpretative tools to capitalize on high throughput raw data and to generate benchmarks for phenotypic traits. The method that we propose in the paper falls in this context. Our methodology relies on a piecewise linear estimation of curves based on a novel regularized change-point-estimation method and on the k-means algorithm applied to a vector of coefficients summarizing the curves. The statistical performance of our method is assessed through numerical experiments and is thoroughly compared with existing experiments. Our technique is finally applied to milk emission kinetics data with the aim of a better characterization of interanimal variability and towards a better understanding of the lactation process.