A computer-implemented method for defining seams of a virtual garment or upholstery comprising a plurality of two-dimensional patterns, each pattern being delimited by a plurality of edges (E0 - E7) and the patterns being assembled by their edges (E0 - E7), the method comprising the steps of: a) arranging said patterns around a three-dimensional avatar, the position of each pattern approximating its situation within the assembled garment or upholstery; and then b) for each edge of each pattern, except edges previously identified to be seamless or to correspond to styling elements, said styling elements being included in each pattern: b1) automatically identifying at least one edge (E1 - E7), called candidate edge, which is suitable to be seamed to it; b2) if a plurality of candidate edges have been identified, selecting one of them based on at least one geometric criterion; and b3) defining a seam between the edge and the selected, or the only, candidate edge; wherein said steps b1), b2) and b3) being performed automatically by a computer; wherein said step b1) comprising identifying as candidate all the edges which have not been identified as seamless, for which no seam has already been defined and having a length equal to that of said edge within a predetermined tolerance; and wherein said step b2) comprises selecting one candidate edge based on at least one criterion chosen among: - minimal distance from said edge; - minimal orientation mismatch with said edge; - orientation mismatch with said edge lower than a threshold; and - the fact that a seam with said edge would not intersect the avatar. a) arranging said patterns around a three-dimensional avatar, the position of each pattern approximating its situation within the assembled garment or upholstery; and then b) for each edge of each pattern, except edges previously identified to be seamless or to correspond to styling elements, said styling elements being included in each pattern: b1) automatically identifying at least one edge (E1 - E7), called candidate edge, which is suitable to be seamed to it; b2) if a plurality of candidate edges have been identified, selecting one of them based on at least one geometric criterion; and b3) defining a seam between the edge and the selected, or the only, candidate edge; wherein said steps b1), b2) and b3) being performed automatically by a computer; wherein said step b1) comprising identifying as candidate all the edges which have not been identified as seamless, for which no seam has already been defined and having a length equal to that of said edge within a predetermined tolerance; and wherein said step b2) comprises selecting one candidate edge based on at least one criterion chosen among: - minimal distance from said edge; - minimal orientation mismatch with said edge; - orientation mismatch with said edge lower than a threshold; and - the fact that a seam with said edge would not intersect the avatar. b1) automatically identifying at least one edge (E1 - E7), called candidate edge, which is suitable to be seamed to it; b2) if a plurality of candidate edges have been identified, selecting one of them based on at least one geometric criterion; and b3) defining a seam between the edge and the selected, or the only, candidate edge; - minimal distance from said edge; - minimal orientation mismatch with said edge; - orientation mismatch with said edge lower than a threshold; and - the fact that a seam with said edge would not intersect the avatar.