The Jmol3DP script described here was successfully used to programmatically convert CIFs from the COD into 31,239 printable VRML files and 11,732 printable STL files. Our original process involved post-processing of VRML files created by Jmol 14.1 using AccuTrans 3D and Netfabb Professional. This post-processing was necessary in order to remove the high level VRML 2.0 objects (cone, cylinder, sphere) [28] that Jmol 14.1 created and to convert the VRML to STL format, which many 3D printers require. In the process of review of this manuscript, Jmol was developed further, and Jmol 14.6.4 now exports VRML, X3D (the XML version of VRML), and STL files that can be submitted directly to 3D print services and 3D printer software without the need for any additional post-processing.
We note that success of STL and VRML files for 3D printing relies upon careful attention to details. All rendered parts must be closed surfaces—no open ends of cylinders used for bonds; no missing triangles in the geodesics used for atoms. The counter-clockwise winding of all triangles must be designed to project all triangle normals in the proper direction. Infinitely thin surfaces (which appear properly on screens and in images) must be given some thickness. Jmol’s (v14.6.4) STL and VRML exporters take care of all of this automatically. In addition, in Jmol, care has been taken to ensure that no two identical objects are placed in the same location. For example, where two bonds come together, the geodesics used to form the rounded endcaps of the cylinders are only generated once, not twice. Some more advanced features of Jmol, such as slabbed (unclosed) isosurfaces, dot surfaces, and labels, are not supported due to these restrictions.
Two representative examples of CIFs processed with the Jmol3DP script are shown in Fig. 2. The crystal structure of 4′-[(2E)-2-(4-Pyridinylmethylene)hydrazino]-2,2′:6′,2″-terpyridine viewed in Jmol, as loaded with the symmetry operations applied, contains two identical molecules of the pyridinyl terpyridine derivative (differing in orientation), two chloroform molecules, and two water molecules (Fig. 2a). After running the Jmol3DP script, only one pyridinyl terpyridine molecule is selected, scaled, and exported as a VRML file. All other molecules and axes were automatically deleted (Fig. 2b). In the extended solid example, Pb3O4, the crystal structure is loaded in Jmol with symmetry and packing applied (Fig. 2c). After running the Jmol3DP script, the entire Pb3O4 packed structure is selected, scaled, and exported as a VRML file; the axes and unit cells were automatically deleted (Fig. 2d). In both examples, a VRML 3D model file was created containing only the single desired chemical structure.
The quality of the programmatically converted 3D printable crystal data is satisfactory. We manually verified a random set of 115 3D printable files and found 90% accuracy. Accuracy here is being defined as producing the expected digital 3D printable molecule or extended solid from the original CIF. The Jmol3DP script automatically deleted small solvent and counterions, and ultimately produced a 3D printable file containing a single molecule or extended solid with high fidelity to the original selected structure within the crystallographic data. Inaccuracies and undesired results in the data mostly arose from co-crystallized structures where both molecules could be of interest for 3D printing. With our current 3D printing conversion method, only the larger molecule would be available as a 3D printable file, and as a result, the smaller co-crystallized molecule is deleted. A similar situation occurred with large or complex counterions. The molecule of interest contained fewer atoms than its counterion, and as a result was mistakenly deleted. Lastly, racemic mixtures present a further complication for processing. Enantiomers contain the same number of atoms. With the current Jmol3DP script, only one of the enantiomers would be selected at random. At this time it is not clear how to circumvent these challenges with programmatic multi-file processing of crystal structures for 3D printing. One method may be to write a Jmol script that produces a separate 3D printable file for each molecule in (or partly in) the crystal structure unit cell. This would preserve all structures in the original CIF and allow the end-user to select the molecule/extended solid of most interest. Until such a method is developed, it will be necessary for the community to help manually curate 3D printable crystal structure data.
Tests with the NIH 3D Print Exchange web tools [15] confirmed that its process, in contrast to ours, retains all molecular structures in the CIF data, makes no attempt to remove solvent molecules or counterions from small molecules and extended solids, does not apply symmetry, and does not select a defined subset for representation. If a user wishes to selectively 3D print molecules or atoms, that selection must be done manually before uploading to the system. Similarly, the Cif2VRML application does not remove solvent molecules (except for biomolecules) or counterions, does not apply symmetry, and does not automatically select a particular structure for representation. Several of these options are reported to be included in a future release of the Cif2VRML application [18].
The NIH 3D Print Exchange web tool, the Cif2VRML application, and the Jmol3DP script reported herein all have utility and unique benefits that help to advance the creation of 3D printable crystal structures. Looking toward the future, we reiterate, that the ideal solution to programmatically convert crystal structures into 3D printable files may be to produce separate 3D printable files for each molecule/extended solid in the CIF file so that no loss of structural representation occurs and users can select the structure of interest to 3D print.
The available 3D printable crystal structures created in this work will allow researchers and educators to quickly locate a large collection (>30,000) of crystal structures that are 3D print ready; no further modifications to the crystal structure or file format should be needed. In addition to providing the entire collection on figshare, a Jmol 3D Print website was created that allows for discovery of the entire collection of 3D printable files created in this work. The STL and VRML files for the compounds were placed on the chemapps.stolaf.edu server in a set of zip files based on COD id 1000000-1999999, 2000000-2999999, etc. The list of ID numbers for all models was also included. The website works by making two calls to COD from the “Figshare Only” button. It first requests ID numbers for a user’s search involving SMILES, text, reference, elements, or cell parameters. The returned list of hits from COD is then filtered using the ID list for the 31,239 crystal structures, and this filtered list is sent back to COD, now requesting a full report for only these specific structures. Up to 100 structures are returned. The results are then displayed using a modified form of the COD search results page where users can download available VRML or STL files (Fig. 3).
If users wish to create a custom 3D printable file that is not available in the predefined file dataset created in this work, an option is available to search the entire COD and design custom 3D print files using JSmol, the non-Java HTML5 version of Jmol. When a search is executed on the Jmol 3D Print website using the “All Structures” button, hits from the COD are returned in a list with both the predefined VRML and STL files, if available, and a 3D link that opens a JSmol Crystal Symmetry Explorer website to allow custom creation of 3D print files. This JSmol Crystal Symmetry Explorer allows various symmetry load options, molecule selection options, and 3D printable STL and VRML file saving options. Moreover, users can even upload their own CIF data and scripts for custom conversion of their CIFs into 3D printable files (Fig. 3).
Creation of VRML and STL files within the JSmol Crystal Symmetry Explorer is a local operation executed in JavaScript within the web browser; there are no server processes necessary for preparing the 3D visualization and subsequently saving a VRML or STL file. As such, if users open the JSmol Crystal Symmetry Explorer from their local machine (from a copy of the JSmol distribution), CIF data can be readily processed into VRML and STL files without any connection to the internet. This process is in contrast to other web-based 3D crystal structure file converters such as the NIH 3D Print Exchange, which do this processing on a server and thus require an internet connection. Furthermore, since the capability of creating VRML and STL files is built into all versions of Jmol starting with version 14.6.4 (both Java and JavaScript), it will be possible to create 3D printable files of models displayed in Jmol at any website that has upgraded their implementation of Jmol to this version or higher (e.g. Crystallography Open Database, Protein Data Bank, Inorganic Crystal Structure Database, Cambridge Structural Database and more). To do so, users need only to click on the JSmol logo or right-click on the model window to call up a pop-up menu and select File > Export > Export VRML 3D Model or File > Export > Export STL 3D Model.
We have 3D printed several STL structures in-house from the produced dataset and a VRML file outsourced to Shapeways, confirming our programmatic methods successfully created 3D printable files (Fig. 4) [29]. Users can immediately load the 3D files into their 3D printing tool path software and begin fabricating the crystal models. Because many of the crystal models are complex, the use of a removable/dissolvable support material in the 3D printing process is recommended to achieve optimal results and quality of the printed model.