[vtkusers] exporter to u3d (3D PDF)

Michail Vidiassov master at iaas.msu.ru
Fri Jun 12 11:41:03 EDT 2009


Dear All,

On Fri, 12 Jun 2009, Henry Proudhon wrote:
>> I am now revisiting the exporter to U3D,
>> a 3D format that can be embedded into PDF
>> and displayed by Adobe Reader and Acrobat
>> without additional plugins.
>>
> Do you mean you wrote a vtk -> U3D filter ?
>

OK, just a bunch of work-in-progress but works code.

First, U3D library.
http://www.iaas.msu.ru/tmp/u3d/u3d-1.2.852.tgz
Has autoconf build system support for Linux and Mac (./configure; make; make install),
cmake - for Windows and Mac (build but not install yet).

What is produced by compiling the code:

IFXCore
IFXExporting
IFXImporting
IFXScheduling

- dynamically loadable modules, first loads others.

IFXCoreStatic

- optional static lib with minimal functionality to load IFXCore

IDTFConverter

- command-line utility that converts from text format called IDTF to U3D

Among the samples there are HellowWorld and IDTFGen.

HellowWorld uses the library in "native" mode.
Did not look into it, too low level for my "taste".

IDTFGen is really "converter" part of IDTFCoverter
(i.e. IDTF parser is ripped out).
In IDTFGen.cpp the binary structures that correspond 1-2-1 to 
contents of an IDTF file are filled, after that a "convert" procedure
is invoked, that produces U3D file. IDTF file may be also printed out.

There is also a repository of IDTF models, showing individual 
capabilities. Unfortunately, many features are not supported by Adobe.

Headers, IDTF and U3D documentation are also inside.

autoconf install works nicely (I hope), cmake just makes binaries
to be installed by hand. Libraries may be placed in current dir or system 
library search path. If not - their location may be specified by U3D_LIBDIR 
environment variable or by providing -libdir /some/where as the end of 
IDTFConverter command line. Non-Core modules may be put into "Plugins"
subdir for compatibility with original layout from Intel. They dreamed about 
whole trees of plugins...

What is not - in the Intel library from sourceforge there is also an U3D 
viewer, Windows-only and rudimentary. Original Windows binaries can be 
found at http://www.iaas.msu.ru/tmp/u3d/u3dIntelWin.zip

A great tool to explore resulting U3D file is Deep Exploration by Right 
Hemisphere, an old veersion of it was bundled with Acrobat before v9.
Downloadable demo is available. Their Deep View is a free product that may
be of some use.

Small preview PDF generator

http://www.iaas.msu.ru/tmp/u3d/u3dpreview.tgz

Self-documented, unfortunately, but small.

Just an option to avoid calling LaTeX that is usually assumed to
be the most wide-known free tool to make PDF with 3D in it.

Or even smaller version of the above at
http://libharu.org/wiki/Downloads/Contributed

vtkU3DExporter

http://www.iaas.msu.ru/tmp/u3d/vtkU3DExporter.tgz

Has Windows and Mac U3D libs packaged.
Uses IDTFGen approach.
Produces both IDTF and U3D files.

Unfortunately, all the docs are in C++.
What it does and how poor
- exports current camera (may export all).
- exports all lights.
- exports meshes with following limitations
  - both sides are always visible ( easy to fix that to reflect VTK setting)
  - explicitly applied textures not supported, that includes bitmap text
    (not hard to fix)
  - vertex colors in Acrobat disable lighting and transparency
    (Acrobat limitation, AFAIK) thus one has to make VTK compute lighting
    internally (do not know if that is possible), force the use of internal
    1D textures to map scalars to colors or use cell colors.
  - lines can have only per-segment, not per-vertex colors, what happens if
    segments overlap - donno, no textures, no trasparency (Adobe limitation)
  - points can be only black 3x3 pixel,
    (Adobe limitation, colored dots are possible via a workeround)
- followers (aka billboards) and pseudo-volume rendering with sets of
   rectangles with transparent textures - possible via JavaScript
   once we figure out how to assign meaningful names to actors
- map vtk Assemblies to groups of nodes - IDTF part possible, need VTK
   advice
- produce preview PDF immediately and without LaTeX - must be easy to do

      Sincerely, Michail

PS. I'll be offline for a couple of days.
PPS. A reminder (to all but Ian ;) - in case you were lazy googling,
  PDF3D from http://www.pdf3d.co.uk/ has not only VTK->U3D, but
  general VTK->3DPDF converter, hopefully handling most technical details
  internally in user-transparent way.




More information about the vtkusers mailing list