Printing a molecule - Part 1
Martin, a friend of mine, is currently working on his Ph.D. in chemistry. He is researching an inhibitor for a proteine that is involved in the alzheimer desease. I talked to him last weekend about his research and he mentioned that he's like to have a model of that protein.
At first I imagined something like a hard to print stick-and-ball model most people associate with molecular models but he said he needs a different model that just shows the surface of the molecule. I told him that I have access to a 3D printer at the attraktor makerspace in Hamburg and that I'd like to try to print that in plastic.
If you never heard of a 3D printer read this.
He sent me a file with the extension mol2 that is basically a text file that describes the position of all the atoms in the molecule and the bindings between them. This is pretty useless for a 3D model.
I searched the internet for an application that displays these files. At first I found a free mac software called FieldView that displayed the molecule and let me rotate it.
It's nice I don't have to create a stick-and-ball (that's the actual scientific name). This protein consists of 5215 atoms. Unfortunately FieldView has no option to export the model as an STL file.
STL is the most used file format for CAM (Computer Aided Manufaturing). STL files describe 3-dimensional objects with lots of triangles that make up surfaces. CAM tools can generate the paths for a CNC mill or a 3D printer from these files as G-code.
I tried BallView, an Open Source molecular modeling and visualization tool that seemed perfect for this tasks. Unfortunately the OSX version crashed immediately when I opened the molecule file. But it worked in my vmware ubuntu.
Loaded the mol2 file, set the display model to SES. Thats the type of surface model I need. Unfortunately I know too little about chemistry to elaborate on that. Then I exported the model as an stl file.
There's another open source tool called 'pymol' but ballview seems to have more features when it comes to graphics.
I checked the exported stl file in MeshLab and it looked OK. I think I have to put the colors for the atoms on it afterwards with the airbrush.
Now that I have an stl file I can finally generate the gcode for the 3d printer. I'm using replicatorG for that with a profile for the attraktor's printer.
I loaded the stl and positioned it. Wasn't easy to find the flattest surface :)
Then I let it calculate how to spread the plastic layers. I got a lot of warnings about the meshes in the model. Tried to fix them in MeshLab but there are way too many options in that tool. A web search brought up the free netfabb cloud service. I uploaded the stl to them and they generated a cleaned up model.
ReplicatorG wasn't complaining about the cleaned up stl file and displayed some cool looking toolpaths for each the 180 layers of plastic it will lay down:
If you're courious - this is how the gcode looks like (some thousand of these lines):
G1 X23.48 Y-1.68 Z0.89 F1800.0
This means 'move in a straight line' (G1) to the following XYZ coordinates with a speed of 1800mm per minute:
I'll load it into the attraktor printer as soon as I get some private time with it.