Export triangulated mesh into a pdf with a 3D object. The matlab mesh is converted to IDTF with matlab code. The IDTF file is converted to u3d with an external binary file. The u3d file can then be embedded into a pdf with pdflatex and the movie15 package. The user can then interact with the mesh (zoom, rotate etc.) from adobe reader. The package contains demo data and example of output.
Somehow i can't install Universal 3D Sample Software from http://sourceforge.net/projects/u3d/ on my MAC, (Lion, 10.7.5). With the link from the forum, i can use cmake .; make; make install to install it. I don't know is it the correct way to install. And should i keep the original file i downloaded from the forum?
I tried the demo_mesh2pdf.m and it worked after downloading MikTex. Only thing is that it produces letter size pdf. I would like to create a screen size pdf so that it can be used as presentation slide. I tried changing default paper format in MikTex setting to screen but the output pdf was letter. Has anybody figured out any workaround to change paper size?
Otherwise, excellent tool.
After some trouble shouting I fixed my first "problem" :) The input string in Matlab did not work (correctly).
I now have another question: is it possible to incorporate multiple meshes in 1 figure? And is it possible to incorporate several "stand alone" 3D (x,y,z,) points that are located on the mesh (like electrodes on the brain)?
I am running the scripts on max os x and get the same exit code as "bee" does. No .u3d file is made or saved, so consequently the file can not be loaded in Latex. This is when using either the .m file or Terminal.
What could be the issue? And what do you mean with "compiled the u3d converter myself" bee?
Hej I have a problem.
I am trying to run your program on a mac64 with os lion. Unfortunately the program exist with folloing statment:
nb of colors : 17
".../mesh2pdf_2/mesh2pdf/bin/maci/IDTFConverter" -input ".../mesh2pdf_2/mesh2pdf/tex/mesh.idtf" -output ".../mesh2pdf_2/mesh2pdf/tex/mesh.u3d"
Exit code = 80000003
further I wanted to as if it is also working if I want to export slice and contourslice?
If you want to enable the acrobat model measurement tool (so the viewer can use a ruler to measure the distance between points in the model), you should open the pdf using adobe acrobat pro, and use the "Advanced" -> "Extend Features in Acrobat Reader" menu item to enable extra options in the final pdf.
Many thanks to the author for this very useful file exchange submission!
It takes a fair bit of effort to get this submission working, but it does work. I have included detailed steps below to simplify the process for others. The demo results aren't beautiful, but at least it is possible to generate a 3D pdf from matlab.
The only other way I have found for making 3D pdf's out of arbitrary STL files is using meshlab (free) to convert an STL to a U3D file, then adobe acrobat 9 pro to insert the U3D as a 3D object. However that only allows 1 mesh layer and is really ugly (you also need acrobat pro).
Steps for getting this working on my system (Windows Vista Ultimate, Matlab R2011a):
1. download/unpack archive for mesh2pdf.
2. download/install MiKTeK 2.8 (http://miktex.org/2.8/setup)
3. open mesh2pdf_2.0\mesh2pdf\demo_mesh2pdf.m in matlab editor.
4. update lines 16-23 to point to the directory where MiKTeK is installed. Note: you might need to include quote marks to allow spaces in the path. For example...
pdflatex_cmp = ['"C:\Program Files\MiKTeX 2.8\miktex\bin\pdflatex.exe"'];
5. Go to MiKTeK directory and make all files editable by the current windows user. (Right click MiKTeK 2.8 folder, select permissions -> select current user -> check 'allow' for all Permissions -> hit apply)
6. Run mesh2pdf_2.0\mesh2pdf\miktex-update.exe to update packages.
7. Install movie15 package for MiKTeK. Run mesh2pdf_2.0\mesh2pdf\mpm.exe, scroll to movie15, right click on the movie15 item and select '+install'. (Also see http://docs.miktex.org/faq/packages.html for more information)
8. With the matlab working directory (current folder) set to the mesh2pdf_2.0\mesh2pdf directory, run the demo_mesh2pdf.m script. It will call the pdflatex command 3 times and generate a pdf file with a 3D model (I think it's a brain). The demo pdf will be in the mesh2pdf_2.0\mesh2pdf\tex directory.
Hello,
3D pdf with this object looks great. I would like to apply the program on my own mesh model from Matlab. But when i changed "sample data" in demo_mesh2pdf.m and in directory, nothing has changed in the resulting pdf. What should change?
Works fine. But you must run Matlab in command-line mode and check beforehand that you have the rights to run the scripts (IDTFConverter in the folder 'u3d'): chmod is your friend...
To add the packages (after movie15 the application ask for others) is necessary to unpack all zips on a directory, then go to MikTex Settings and, on "root" option, add the directory where the zip were unpacked, click accept and after that the programs works great.
To read the pdf is necessary you need to have at least an acrobat 9.0...
Ok, i'm making some progress installing this tool. I have installed MikTex 2.8 and added '\miktex\bin' to path.
The program ask me for movie15 package.
I went to package manager of MikTex and I tried to install it. But, my work conection to internet is filtered and i can't install the package from intenet, so I tried to do it chossing the option (on MikTex) "repositories shall be installed from directory" and I select a directory where i have downloaded the movie15.zip (537kb). The aplication returns "directorie does seem to be a local package repository".
How can i install movie15 package? Have I the correct package? why MixTex Package manager doesn't recognize the zip?
Thanks.
Regards,
Cristian
What versión of acrobat I should use? i have v8 professional and your programa doesn't work. I recive the following error:
Warning: Name is nonexistent or not a directory: C:\Program Files\MiKTeX2.8\miktex\bin.
> In path at 110
In addpath at 87
In demo_mesh2pdf at 21
"pdflatex.exe" no se reconoce como un comando interno o externo, programa o archivo por lotes ejecutable.
Updates
28 Sep 2009
- fix minor bug on windows
- removing useless files in zip
10 Jan 2010
For windows users, this version does not require anymore to have meshlab installed.