Modeling of 3D Printer Based on a Flexible Cartesian Mechanism