- Notifications
You must be signed in to change notification settings - Fork25
Export MATLAB figure as U3D file or directly to 3D interactive PDF
License
johnyf/fig2u3d
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Export figure as a U3D file or directly to 3D interactive graphics within a PDF.Licensed under 2-clause BSD.
PDF created for figure below (3d needsAdobe Reader).
TheLaTeX
needed looks like:
\documentclass{article}\usepackage{graphicx}\usepackage[dvipdfmx]{media9}\begin{document}\begin{figure}\centering\includemedia[width=0.8\textwidth,activate=pagevisible,%deactivate=pageinvisible,3Dtoolbar,3Dviews=./example_supercyclide.vws]{\includegraphics[width=0.8\textwidth]{example_supercyclide.pdf}}{./example_supercyclide.u3d}\caption{An implicitly defined elliptic supercyclide.}\label{fig:example_supercyclide}\end{figure}\end{document}
fig2u3d
saves the figure as aU3D
file for inclusion as an interactive 3-dimensional figure within aPDF
. EitherLaTeX
or Adobe Acrobat can be used to embed theU3D
file in thePDF
.
Theidtf2u3d
executables are included fromthis project (see dependencies below).
Avws
file is also created, which contains the current camera view of the axes saved. This file can be used to set the figure's default view in the PDF to be the same with the open figure window inMATLAB
.
Themedia9 LaTeX package can import U3D files with their associated VWS files in a PDF document.
For PDF readers which do not render 3D figures, it is possible to include an alternative 2D image as a substitute to the 3D object. For conveniency, the script saves a 2D image together with U3D file. File type and other options for exporting this 2D image can be specified as additional arguments.
fig2pdf3d
Converts the figure directly to a PDF containing only an interactive 3D graphics object.
Graphics object supported for export include:
- line
- surface
- patch
- quivergroup
- contourgroup
Line colors and marker styles, surfaces andquivers
withNaN
s and surface shading are supported. Multiple instances of various objects can be plotted in the same axes and exported. Note that some limitations apply, for example filled contours are not yet supported.
Download & unpack from therelease the:
MATLAB
code,- idtf2u3d converter Mac OS X, Linux, Windows binaries, place this under
idtf2u3d/bin
(result:idtf2u3d/bin/glx…
etc), - required
MATLAB
packages, place them anywhere.
Add all the above and their subdirectories to yourMATLAB
path, e.g. using thepathtool
command.
fig2pdf3d
needs a latex distribution (e.g.MikTeX,TeXLive,MacTeX) andmedia9
(preferred) ormovie15
LaTeX package (replaced bymedia9
).
- idtf2u3d converter binaries packaging taken fromhere
- MATLAB mesh to PDF with 3d interactive object
- Generate vertices, faces and color for U3D format
- Generate U3D files from STL models for making multi-layer 3D PDF figures
- Arclength
- Vectorized MeshGrid
- Plot 2/3d Point(s)
- Plot 2/3d Vector(s)
- Take & restore hold
- Normalize n-dim vectors
- Cell Extrema
- Vector Norm
- Verbatim
This project is licensed under the 2-clause BSD license.The license file includes the authors of all dependencies, so that they can be distributed with this project.
Development ongithub, releases here and also viaFile Exchange.
3d, u3d, graphics, export, save, plot, surface, vector, quiver, quivergroup, mesh, contourgroup, contour, data export, mathematics, vision, latex, pdf, media9, movie15, pdflatex, xelatex
About
Export MATLAB figure as U3D file or directly to 3D interactive PDF