NASA can send robots to Mars, no problem. But if it's ever going to put humans on the red planet, it has to figure out how to feed them over a years-long mission.

So the agency has funded research for a nerd-worthy solution: a 3-D printer to create entrees or desserts at the touch of a button.

Yes, it's another case of life imitating "Star Trek." (Remember the food replicator?) In this case, though, the creators hope there is an application beyond deep-space pizza parties. The technology could also be used to feed hungry populations here on Earth.

Texas-based Systems and Materials Research Corp. has been selected for a $125,000 grant from NASA to develop a 3-D printer that will create "nutritious and flavorful" food for astronauts, according to the company's proposal. Using a "digital recipe," the printers will combine powders to produce food with the structure and texture of, well, actual food. Including smell.

The project - the details of which NASA plans to finalize this week - was presented at the Humans 2 Mars Summit in Washington this month. At the presentation, Anjan Contractor, an engineer at SMRC and the project manager, explained how the idea originated: He had used a 3-D printer to print chocolate for his wife.

That experiment led the company to think about other foods that could be printed. A space-food printer doesn't exist yet - it's still a concept, which the company hopes to develop by the end of the year using NASA's grant money.

NASA's current astro-food system "is not adequate in nutrition or acceptability through the five-year shelf life required for a mission to Mars, or other long-duration missions," spokesman David Steitz said.

Astronauts carry pre-packaged food a little like the meals ready to eat, or MREs, eaten by the military.

The preparations are short on flavor and heavy on processing, which tends to "degrade the micronutrients in the foods," Steitz said. There also isn't much choice or variety.

The company said 3-D printed food could be tailored to each astronaut's nutritional needs, improving health and, maybe more important, alleviating boredom.

One of the first goals for SMRC's printer is the pizza, because it contains a variety of nutrients and flavors, said David Irvin, director of research at SMRC. More important, it is made up of layers, a key principle used in 3-D printing technology.