Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.glorb.com!news.mv.net!newspump.sol.net!posts.news.twtelecom.net!nnrp2.twtelecom.net!not-for-mail From: Alexey Newsgroups: comp.soft-sys.math.mathematica Subject: Re: Questions concerning export of 3d plots Date: Thu, 28 Apr 2011 10:35:51 +0000 (UTC) Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Sender: steve@smc.vnet.net Approved: Steven M. Christensen , Moderator Message-ID: References: Lines: 60 NNTP-Posting-Date: 28 Apr 2011 09:36:36 GMT NNTP-Posting-Host: b65042e2.news.twtelecom.net X-Trace: DXC=gcgAl:8HON:>Y`AN6T`Vj1C_A=>8kQj6=;[h;PUXBgb4AbB79SZHZ= In Mathematica > (and OpenGL, ...) you say something like > > Polygon[{p1,p2,...}, VertexColors->{c1,c2,...}] > > and specify the color at each vertex. The whole polygon is then drawn by > interpolating the colors of the vertices at each position. It > "seems" (and here I'm really not sure) that either the PDF file format > does not support this or it needs the hell of space for this. In really recent versions of PDF and EPS fully support vertex colors. See this thread: http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/thread/f2327233ca2faa9f/2dad0f66979ad134 and this video (14 Mb): http://research.microsoft.com/en-us/um/people/jiansun/videos/GMesh_336.wmv > So if you have for instance Inkscape installed to convert from svg to > pdf, then you could compare these 3 pdf files: > > ExportSVG[filename_String, gr : (Graphics3D[___] | Graphics[___])] := > > Block[{svg = ExportString[Normal[gr], "SVG"], stream}, > Export[filename, StringReplace[svg, > Shortest[ > StringExpression[""]] :> > ""], "Text"] > ] > > gr = Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, Mesh -> None, > MaxRecursion -> 5, PlotPoints -> 20, BoundaryStyle -> None, > ImageSize -> 500]; > > Export["grMma1.pdf", gr] > Export["grMma2.pdf", gr, "AllowRasterization" -> False] > ExportSVG["grInk.svg", gr] > > Run["inkscape", "-D", "-A grInk.pdf", "grInk.svg"] > > On my machine I have sizes: > > 17M grMma1.pdf > 860K grMma2.pdf > 1.1M grInk.pdf > > and the last pdf looks pretty ok. Very interesting! Thank you for sharing! You can be also interested in Jens Nockel's thoughts on the matter: http://pages.uoregon.edu/noeckel/MathematicaGraphics.html#ExportShading Alexey