A computer-implemented method of machine-learning, the method comprising: - providing a dataset of training samples each including a pair of 3D modeled object portions labelled with a respective value that indicates whether or not the two portions belong to a same segment of a 3D modeled object; and - learning a neural network based on the dataset, the neural network being configured for taking as input two portions of a 3D modeled object representing a mechanical part and for outputting a respective value that indicates an extent to which the two portions belong to a same segment of the 3D modeled object, the neural network being thereby usable for 3D segmentation, wherein the learning of the neural network comprises minimizing a loss comprising a term penalizing, for pairs of the dataset, a disparity between the respective value that indicates whether or not the two portions of a pair belong to a same segment of a 3D modeled object and the respective value outputted by the neural network for the two portions, wherein the neural network transforms the input two portions each into a corresponding intermediary feature, and the loss further comprises another term penalizing, for said pairs of the dataset, a disparity between the respective value that indicates whether or not the two portions of a pair belong to a same segment of a 3D modeled object and a proximity between the intermediary features corresponding to the two portions, characterized in that the term is of the type: ∑ i = 1 N d CE g w f w X i 1, f w X i 2, p i, where X 1 1 X 2 2,..., X N 1 X N 2 are pairs of the dataset, g w f w X i 1, f w X i 2 is the respective value outputted by the neural network for the pair X i 1 X i 2, g w ∘ f w is the neural network, p i is the respective value that indicates whether or not the portions X i 1 and X i 2 belong to a same segment of a 3D modeled object, and d CE is a loss penalizing a disparity between g w f w X i 1, f w X i 2 and p i, and the other term is of the type: ∑ i = 1 N d M f w X i 1, f w X i 2, p i, where, f w X i 1 and f w X i 2 are the intermediary features corresponding to the portions X i 1 and X i 2 of the pair X i 1 X i 2, and d M is a loss penalizing a disparity between p i and a proximity between f w X i 1 and f w X i 2. - providing a dataset of training samples each including a pair of 3D modeled object portions labelled with a respective value that indicates whether or not the two portions belong to a same segment of a 3D modeled object; and - learning a neural network based on the dataset, the neural network being configured for taking as input two portions of a 3D modeled object representing a mechanical part and for outputting a respective value that indicates an extent to which the two portions belong to a same segment of the 3D modeled object, the neural network being thereby usable for 3D segmentation, wherein the learning of the neural network comprises minimizing a loss comprising a term penalizing, for pairs of the dataset, a disparity between the respective value that indicates whether or not the two portions of a pair belong to a same segment of a 3D modeled object and the respective value outputted by the neural network for the two portions, wherein the neural network transforms the input two portions each into a corresponding intermediary feature, and the loss further comprises another term penalizing, for said pairs of the dataset, a disparity between the respective value that indicates whether or not the two portions of a pair belong to a same segment of a 3D modeled object and a proximity between the intermediary features corresponding to the two portions, characterized in that the term is of the type: ∑ i = 1 N d CE g w f w X i 1, f w X i 2, p i, where X 1 1 X 2 2,..., X N 1 X N 2 are pairs of the dataset, g w f w X i 1, f w X i 2 is the respective value outputted by the neural network for the pair X i 1 X i 2, g w ∘ f w is the neural network, p i is the respective value that indicates whether or not the portions X i 1 and X i 2 belong to a same segment of a 3D modeled object, and d CE is a loss penalizing a disparity between g w f w X i 1, f w X i 2 and p i, and the other term is of the type: ∑ i = 1 N d M f w X i 1, f w X i 2, p i, where, f w X i 1 and f w X i 2 are the intermediary features corresponding to the portions X i 1 and X i 2 of the pair X i 1 X i 2, and d M is a loss penalizing a disparity between p i and a proximity between f w X i 1 and f w X i 2.