On the way to the green factory: data-driven optimisation for 3D printing