It seems impossible, but apparently nobody has ever made a chocolate-laying 3-D printer before now. Thankfully, that oversight has been remedied by Dr Liang Hao and his team, of the University of Exeter in England.
The printer works like any other additive 3-D printer, building up the design one layer at a time, only this one works with delicious chocolate which can be eaten afterwards. The final goal is to have the printer available to consumers, so they could go into a store with their design and print out a tasty treat to give as a gift. To this end, an easy-to-use interface to input designs is already in development.
Building the printer wasn't as simple as just swapping in chocolate for other materials. The nature of chocolate means that it has tight tolerances on temperatures, both for flow and to allow the design to set between layers.