3d pdf: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
(rearrange some tex to avoid dropping comma)
No edit summary
Line 4: Line 4:
== Requirements ==
== Requirements ==
* PyMOL
* PyMOL
* [http://www.iaas.msu.ru/tmp/u3d/u3d-1.2.852.tar.gz u3d converter IDTF to U3D converter]
* [http://sourceforge.net/projects/u3d/files/Universal%203D%20Sample%20Software/ Universal 3D Sample Software - u3d converter - IDTF to U3D]
* LaTeX (pdflatex)
* LaTeX (pdflatex)
== Get IDFT file from PyMOL ==
* Save your molecule to an IDTF file in PyMOL:
<source lang="python">
save pymol.idtf, *
</source>
PyMOL will print a line that looks like:
  3Daac=20.0, 3Droll=0, 3Dc2c=0 0 1, 3Droo=62.45, 3Dcoo=0 0 -62.45
copy this line into the pymol.tex file overwriting the same line in the file.
== Convert the IDTF to U3D ==
# Download '''Universal 3D Sample Software - u3d converter - IDTF to U3D''', and extract to Desktop or C:\Program Files.<br>
# Navigate to the '''bin''' folder: \Desktop\U3D_A_061228_5\Bin\Win32\Release <br>
# Copy '''pymol.idtf''' in here.
# Hold '''shift''' key, right click in folder, click '''Open command window here'''.
Then copy this inot command window:
IDTFConverter -input pymol.idtf -output pymol.u3d
Copy the pymol.u3d into your LaTeX folder
== LaTeX code ==
* The following LaTeX code saved as "pymol.tex":
* The following LaTeX code saved as "pymol.tex":
<source lang="latex">
<source lang="latex">
Line 30: Line 50:
\end{document}
\end{document}
</source>
</source>
== Directions ==
* Save your molecule to an IDTF file in PyMOL:
<source lang="python">
save pymol.idtf, *
</source>
PyMOL will print a line that looks like:
  3Daac=20.0, 3Droll=0, 3Dc2c=0 0 1, 3Droo=62.45, 3Dcoo=0 0 -62.45
copy this line into the pymol.tex file overwriting the same line in the file.
* Convert the IDTF to U3D:
  ./IDTFConverter -input pymol.idtf -output pymol.u3d
* Create the PDF using LaTeX:
* Create the PDF using LaTeX:
   pdflatex pymol.tex
   pdflatex pymol.tex


== Caveats ==
== Caveats ==
Line 57: Line 62:


* Some versions of Acrobat on Linux incorrectly parse the 3D data. Adobe knows about this and plans to fix it. Ironically, I created a 3D PDF on Linux but could only view it on Mac OS X.
* Some versions of Acrobat on Linux incorrectly parse the 3D data. Adobe knows about this and plans to fix it. Ironically, I created a 3D PDF on Linux but could only view it on Mac OS X.


== More on 3D PDFs ==
== More on 3D PDFs ==
* [http://www.adobe.com/manufacturing/3dpdfsamples/3dsolutions/ 3D PDFs at Adobe]
* [http://www.adobe.com/manufacturing/3dpdfsamples/3dsolutions/ 3D PDFs at Adobe]

Revision as of 04:24, 3 March 2013

Overview

PyMOL can convert to formats (vrml2 and idtf) that can be converted to a 3D PDF (will not work with most PDF browser plugins; must be downloaded and viewed with certain viewers liked Adobe Acrobat 9.2+).

Requirements

Get IDFT file from PyMOL

  • Save your molecule to an IDTF file in PyMOL:
save pymol.idtf, *

PyMOL will print a line that looks like:

 3Daac=20.0, 3Droll=0, 3Dc2c=0 0 1, 3Droo=62.45, 3Dcoo=0 0 -62.45

copy this line into the pymol.tex file overwriting the same line in the file.

Convert the IDTF to U3D

  1. Download Universal 3D Sample Software - u3d converter - IDTF to U3D, and extract to Desktop or C:\Program Files.
  2. Navigate to the bin folder: \Desktop\U3D_A_061228_5\Bin\Win32\Release
  3. Copy pymol.idtf in here.
  4. Hold shift key, right click in folder, click Open command window here.

Then copy this inot command window:

IDTFConverter -input pymol.idtf -output pymol.u3d

Copy the pymol.u3d into your LaTeX folder

LaTeX code

  • The following LaTeX code saved as "pymol.tex":
\documentclass[a4paper]{article}
\usepackage[3D]{movie15}
\usepackage[UKenglish]{babel}
\usepackage[colorlinks=true]{hyperref} 
\begin{document}
\title{PyMOL 3D Objects in PDF}
\author{Jason Vertrees}
\maketitle
\begin{center}
\includemovie[
        poster,
        toolbar, %same as `controls'
        label=pymol.ud3
        text=(pymol.u3d),
        3Dlights=CAD,
        % replace the next line with what PyMOL output
        3Daac=20.0, 3Droll=0, 3Dc2c=0 0 1, 3Droo=62.45, 3Dcoo=0 0 -62.45
]{\linewidth}{\linewidth}{pymol.u3d}
\label{ex3d} A PyMOL object embedded in PDF, using U3D data format.
\end{center}
\end{document}
  • Create the PDF using LaTeX:
 pdflatex pymol.tex

Caveats

  • Currently you have to compile the u3d converter on Linux. I did that with:
cmake .
make

which created "IDTFConverter" that I used above.

  • Some versions of Acrobat on Linux incorrectly parse the 3D data. Adobe knows about this and plans to fix it. Ironically, I created a 3D PDF on Linux but could only view it on Mac OS X.

More on 3D PDFs