Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Graphics3D exported to pdf

45 views
Skip to first unread message

Gianluca Gorni

unread,
Jun 8, 2007, 5:27:38 AM6/8/07
to

Hello!

I am meeting some problems when exporting 3D graphics
to pdf format, problems that are new to Mathematica 6.

$Version is "6.0 for Mac OS X PowerPC (32-bit) (April 20, 2007)"

Take for example two simple 3D squares, one black and one
partially transparent:

myGraph =
Graphics3D[{{Black, Polygon[{{0, 0, 0}, {1, 0, 0}, {1, 1, 0}, {0,
1, 0}}],
Opacity[.5], Polygon[{{1, 0, 0}, {2, 0, 0}, {2, 1, 0}, {1, 1,
0}}]}},
Boxed -> False, BoxRatios -> {8, 4, 1}]

The display in the FrontEnd is fine. Let us export to pdf:

Export["~/Desktop/myGraph.pdf", myGraph]

Looking at the plot with AdobeViewer, or with Apple's Preview,
I clearly see thin white lines crossing both the squares.
If I change the preview settings to "not antialiasing of text and
line art", strangely enough, the white lines on the black square disappear,
but the white lines on the transparent square turn black and more
visible.

When exporting Plot3D output to pdf, the white lines are so many
and so dense that the whole picture looks "dirty".

I wish that the pdf output did not show those junctions.

I have found a workaround: select the picture by clicking on it,
go to File>PrintSelection menu, and print to pdf. The result is
a high resolution *bitmap* pdf that closely matches what the FrontEnd
displays. One annoyance is that the picture is on a full-page pdf,
that I have to crop manually.

Do we have to give up on vector pdf's for 3D graphics?
Any thoughts?

Happy computing,
Gianluca


Szabolcs

unread,
Jun 9, 2007, 5:28:43 AM6/9/07
to

It may not be possible to solve this problem

Consider the attached PostScript file. The two squares are perfectly
aligned, yet when the drawing is converted to PDF and displayed in Adobe
Reader, the white line is still there.

Most probably it will not be visible on a _printed_ drawing.

But I do not know why is it necessary to break those two squares in your
example into so many little polygons.

Szabolcs

------------>8--------------

%!PS-Adobe-2.0

/draw-square {
newpath
0 0 moveto
100 0 rlineto
0 100 rlineto
-100 0 rlineto
closepath
fill
} def

200 100 translate
40 rotate
draw-square
100 0 translate
draw-square

showpage

xavier....@_at**uclouvain.be

unread,
Nov 21, 2007, 6:08:23 AM11/21/07
to
Try exporting to png:
Export["myGraph.png",myGraph,"PNG",ImageSize®{640,Automatic},
ImageResolution®144]
the image looks good to me in acrobat

ragfield

unread,
Nov 22, 2007, 4:50:52 AM11/22/07
to
If you want a bitmap PDF of your 3d graphic, do the following:

* click on the graphic to select it (orange frame)
* choose File > Save Selection As
* choose PDF in the format popup menu
* click the "Options..." button
* choose "Use Bitmap Representation" for the "Graphics Containing
Transparency" popup menu
* click OK in the options dialog
* click Save in the save dialog

-Rob

0 new messages