Generate mesh surface from protein structure
PyMOL and Chimera can do that, and both can be script-driven. The PyMOL wiki is full of examples, and probably already has some how-to that would get you started. Chimera also has a complete documentation.