Method of producing a mould portion, the method comprising the steps of: (a) providing a pattern in a filling box, wherein the filling box defines a coordinate system having an x-axis, a y-axis and a z-axis; (b) defining a first matrix (M 1), wherein elements of the first matrix (M 1) represent surface segments in the filling box in an x-y-plane of the pattern or the filling box, and wherein a value of each element of the first matrix (M 1) corresponds to an amount of moulding material for the respective surface element; (c) filling moulding material into the filling box according to the first matrix (M 1), wherein at least two different surface segments in the filling box are filled with different amounts of moulding material, such that the filling box comprises at least two different filling heights (z ∗ 11, z ∗ 21, z ∗ 31) of the moulding material at the two different surface segments after completion of filling moulding material into the filling box; (d) wherein the filling height (z ∗ 11, z ∗ 21, z ∗ 31) of moulding material is larger at a surface segment in the filling box at which the pattern has a lower height that at a surface segment in the filling box at which the pattern has a greater height, after completion of the moulding material filling step; (e) compacting the moulding material in the filling box, thereby providing a mould portion; and (f) wherein the moulding material in the filling box is compacted by a compacting head with a flat surface (31, wherein the flat surface of the compacting head is flat during the filling of the moulding material into the filling box and during the compaction of the moulding material in the filling box. (a) providing a pattern in a filling box, wherein the filling box defines a coordinate system having an x-axis, a y-axis and a z-axis; (b) defining a first matrix (M 1), wherein elements of the first matrix (M 1) represent surface segments in the filling box in an x-y-plane of the pattern or the filling box, and wherein a value of each element of the first matrix (M 1) corresponds to an amount of moulding material for the respective surface element; (c) filling moulding material into the filling box according to the first matrix (M 1), wherein at least two different surface segments in the filling box are filled with different amounts of moulding material, such that the filling box comprises at least two different filling heights (z ∗ 11, z ∗ 21, z ∗ 31) of the moulding material at the two different surface segments after completion of filling moulding material into the filling box; (d) wherein the filling height (z ∗ 11, z ∗ 21, z ∗ 31) of moulding material is larger at a surface segment in the filling box at which the pattern has a lower height that at a surface segment in the filling box at which the pattern has a greater height, after completion of the moulding material filling step; (e) compacting the moulding material in the filling box, thereby providing a mould portion; and (f) wherein the moulding material in the filling box is compacted by a compacting head with a flat surface (31, wherein the flat surface of the compacting head is flat during the filling of the moulding material into the filling box and during the compaction of the moulding material in the filling box.