A heated, computer-controlled nozzle glided smoothly back and forth, then up and down, depositing a thin trail of sugar in the shape of a delicate, miniature cage.

A scene from a high-tech pastry kitchen? A 21st-century reboot of Willy Wonka's candy factory?

Far from it. The sugar cage was a first step toward manufacturing blood vessels for artificial organs, made with a custom-built 3-D "printer" in a bioengineering lab at the University of Pennsylvania.

Once they harden, these crisscrossing lines of sugar can be surrounded with a gel that contains cells from the desired type of organ - say, a liver. The sugar dissolves, leaving behind a cube of liver cells with a network of hollow channels, which can then be lined with other cells to create rudimentary blood vessels.

The resulting cubes of tissue are small, and the Penn researchers are many years away from making functional organs on the scale needed for human patients. But the team's results, published this month in the journal Nature Materials, represent a promising advance in a field that is eager for alternatives to donated organs from cadavers.

The key to the Penn project was the 3-D printer, a type of machine used in industry for decades and now commonly assembled by do-it-yourselfers. Working from what is on a computer screen, a 3-D machine can spit out a solid object, building it up with layer upon layer of plastic.

The Internet is loaded with plans for anyone who wants to "print" out a toy action figure or a spare part for a dishwasher. Why not a kidney? But instead of plastic, you'd use some kind of cells from the patient and coax them into performing the function of the organ.

The idea of "printing" organs has caught the attention of the traditional medical community, said Roslyn Mannon, president of the American Society of Transplantation.

"Who would've thought of that?" said Mannon, a professor of medicine and surgery at the University of Alabama at Birmingham. "The opportunities are quite limitless."

If they can get it to work. Thus far, scientists in the field, known as tissue engineering, have used human cells to grow replacement corneas, bladders and skin - only the thinnest of body parts.

But thicker organs such as livers and kidneys need a robust, three-dimensional network of blood vessels. When researchers print out clumps of tissue with hollow channels to accommodate blood, the layer-by-layer approach can yield a leaky product. In addition, living cells do not always fare well when squirted through a nozzle.

Enter Jordan S. Miller, a postdoctoral fellow in the lab of Penn engineering professor Christopher S. Chen. A few years ago, Miller saw one of the Body Worlds exhibits, in which human cadavers are pumped full of silicone rubber to create an eye-catching display.

He and Chen wondered whether there were some way they could reverse that process, creating channels for blood vessels and building up the organs around them.

Then one time at a restaurant, Miller saw a cage of spun sugar that the chef had created, apparently by drizzling the sugar on a bowl, letting it harden and removing the bowl.

An idea was born. Print a lattice structure from sugar, surround it with organ cells, then dissolve the sugar to leave channels for vein and arteries.

Other researchers were starting to explore similar ideas, but with materials that needed to be dissolved with toxic solvents. Chen and Miller saw that sugar would have a key advantage: it was nontoxic, and would dissolve in water.

The result was an unusual collaboration. In addition to working with colleagues at the Massachusetts Institute of Technology, Miller also sought help from members of Hive76, a "hacker space" located in a studio on Spring Garden Street.

The members of Hive76 certainly know their way around a computer, but their studio also contains a drill press, saws, an oscilloscope, various electronics components and 3-D printers.

As far as Miller knew, no one had tried to print sugar before. But he built a printer that would do just that with the help of Hive76 members, including electrical engineer Robert Vlacich and artist Christopher Thompson.

Chen acknowledged that sugar might seem to be an odd fit for a bioengineering lab.

"It always smells like candy when we're walking around over there," the engineering professor said.

Yet it seems to work.

The team showed that once the sugar dissolved, the resulting hollow channels could withstand the pressure of blood flow. The group also was able to line the channels with endothelial cells, which prevent blood from clotting.

In addition, the researchers succeeded in coaxing the growth of smaller capillary "sprouts," which branched off the sides of the main channels for artificial blood vessels.

Future research will involve trying to create much larger chunks of tissue - at least 100 times the volume of what the group has made so far - and also connecting the artificial organs with real blood vessels in a mouse.

If approaches like the one at Penn are successful, there would be advantages beyond simply alleviating the shortage of donor organs, said Mannon, the president of the transplantation society. Because patients would, in theory, get new organs built from their own adult stem cells, they would not need to take the immune-suppressing drugs that are required to prevent rejection of a donor organ.

In the meantime, Penn's 3-D printer might have more immediate success in the kitchen.

Thompson, the artist and Hive76 member, said he and Miller would like to explore printing chocolate. If they could print out any sort of intricate design from a computer screen, no pastry artisan could top them, he figures.

"Imagine an Eiffel Tower," Thompson said.

A sweet idea, indeed.

To see how a 3D printer helps researchers try to build artificial organs, see www.philly.com/bloodEndText

Contact staff writer Tom Avril at 215-854-2430 or tavril@phillynews.com