A computer-implemented method for processing a 3D signal of a shape attribute over a real object, the shape attribute being a normal, a curvature, or a type of primitive, the method comprising: - providing: • a graph having nodes and arcs, each node representing a respective point of a measured 3D discrete representation of the real object, each arc connecting two nodes representing neighboring points of the discrete representation; and • a set of values representing a distribution of the shape attribute over the real object, each value being associated to a respective node of the graph and representing the shape attribute at the respective point represented by the respective node; and - modifying the set of values by minimizing an energy defined on a Markov Random Field formed on the graph, the energy penalizing, for each arc connecting a first node to a second node, the first node being associated to a first value and the second node being associated to a second value, a highness of an increasing function of each of: • a distance between the first value and the second value, • a distance between a first point, represented by the first node, and a medial geometrical element of the discrete representation, the medial geometrical element being a medial axis of the discrete representation or a medial surface of the discrete representation, and • a distance between a second point, represented by the second node, and the medial geometrical element. - providing: • a graph having nodes and arcs, each node representing a respective point of a measured 3D discrete representation of the real object, each arc connecting two nodes representing neighboring points of the discrete representation; and • a set of values representing a distribution of the shape attribute over the real object, each value being associated to a respective node of the graph and representing the shape attribute at the respective point represented by the respective node; and • a graph having nodes and arcs, each node representing a respective point of a measured 3D discrete representation of the real object, each arc connecting two nodes representing neighboring points of the discrete representation; and • a set of values representing a distribution of the shape attribute over the real object, each value being associated to a respective node of the graph and representing the shape attribute at the respective point represented by the respective node; and - modifying the set of values by minimizing an energy defined on a Markov Random Field formed on the graph, the energy penalizing, for each arc connecting a first node to a second node, the first node being associated to a first value and the second node being associated to a second value, a highness of an increasing function of each of: • a distance between the first value and the second value, • a distance between a first point, represented by the first node, and a medial geometrical element of the discrete representation, the medial geometrical element being a medial axis of the discrete representation or a medial surface of the discrete representation, and • a distance between a second point, represented by the second node, and the medial geometrical element. • a distance between the first value and the second value, • a distance between a first point, represented by the first node, and a medial geometrical element of the discrete representation, the medial geometrical element being a medial axis of the discrete representation or a medial surface of the discrete representation, and • a distance between a second point, represented by the second node, and the medial geometrical element.