A computer-implemented method for designing a plurality of versions of a virtual garment or upholstery in a three-dimensional scene comprising the steps of: a) providing a three-dimensional manikin in the three-dimensional scene, a set of pattern parts (P1 - P14) of said virtual garment or upholstery and a set of seam specification, a seam (S1 - S7) including a set of distance constraints between pairs of points of two pattern part edges to be stitched together; b) receiving as inputs from a user a plurality of declarations of tasks, called assembly tasks (A, B, C, D1, D2, E1, E21, E22, F2), for assembling the garment or upholstery, each of said assembly tasks comprising at least one of - a statement declaring garment pattern parts and/or seams, or indicating an action performed on the declared pattern parts or seams, and - one or more settings of an assembly and simulation process; c) receiving as an input from the user declarations of a partial ordering relationship between said assembly tasks, and generating and storing in a memory device a directed acyclic graph data structure comprising nodes linked by directed arcs, each node of the directed acyclic graph data structure storing the definition of one of said assembly tasks and the directed arcs of the directed acyclic graph data structure representing said partial ordering relationship between said assembly tasks; d) executing said assembly tasks according to said partial ordering relationship, each assembly task changing a state (0 - 3, 41, 42, 51, 521, 522, 621, 622) of the garment or upholstery under assembly; e) while executing the assembly tasks, generating and storing in the memory device a tree data structure comprising nodes linked by directed arcs, each node of the tree data structure storing information defining a state of the garment or upholstery and each directed arc of the tree data structure being associated to one of said assembly tasks, the assembly task of an arc connecting a first node of the tree data structure to a second node of the tree data structure changing the state of the garment or upholstery associated to the first node to the state associated to the second node, each leaf node of the tree data structure storing information defining a respective version of the plurality of versions of the virtual garment or upholstery, wherein the tree data structure is used to speed-up design and simulation of the plurality of versions of the virtual garment or upholstery. a) providing a three-dimensional manikin in the three-dimensional scene, a set of pattern parts (P1 - P14) of said virtual garment or upholstery and a set of seam specification, a seam (S1 - S7) including a set of distance constraints between pairs of points of two pattern part edges to be stitched together; b) receiving as inputs from a user a plurality of declarations of tasks, called assembly tasks (A, B, C, D1, D2, E1, E21, E22, F2), for assembling the garment or upholstery, each of said assembly tasks comprising at least one of - a statement declaring garment pattern parts and/or seams, or indicating an action performed on the declared pattern parts or seams, and - one or more settings of an assembly and simulation process; - a statement declaring garment pattern parts and/or seams, or indicating an action performed on the declared pattern parts or seams, and - one or more settings of an assembly and simulation process; c) receiving as an input from the user declarations of a partial ordering relationship between said assembly tasks, and generating and storing in a memory device a directed acyclic graph data structure comprising nodes linked by directed arcs, each node of the directed acyclic graph data structure storing the definition of one of said assembly tasks and the directed arcs of the directed acyclic graph data structure representing said partial ordering relationship between said assembly tasks; d) executing said assembly tasks according to said partial ordering relationship, each assembly task changing a state (0 - 3, 41, 42, 51, 521, 522, 621, 622) of the garment or upholstery under assembly; e) while executing the assembly tasks, generating and storing in the memory device a tree data structure comprising nodes linked by directed arcs, each node of the tree data structure storing information defining a state of the garment or upholstery and each directed arc of the tree data structure being associated to one of said assembly tasks, the assembly task of an arc connecting a first node of the tree data structure to a second node of the tree data structure changing the state of the garment or upholstery associated to the first node to the state associated to the second node, each leaf node of the tree data structure storing information defining a respective version of the plurality of versions of the virtual garment or upholstery, wherein the tree data structure is used to speed-up design and simulation of the plurality of versions of the virtual garment or upholstery.