Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1956

Re: Questions concerning export of 3d plots

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 <lehin.p@gmail.com>
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 <steve@smc.vnet.net>, Moderator
Message-ID <ipbfu7$aev$1@smc.vnet.net> (permalink)
References <ip8o51$peu$1@smc.vnet.net>
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=<EFiONJ7[Go6c<[R;kXaCN;
X-Complaints-To abuse@twtelecom.net
Xref x330-a1.tempe.blueboxinc.net comp.soft-sys.math.mathematica:1956

Show key headers only | View raw


> 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["<polygon stroke=\"none\" fill=", color__,
>        " points=", pt__, "/>"]] :>
>      "<polygon stroke=" ~~ color ~~ " stroke-width=\"0.6px\" fill=" ~~
>        color ~~ " points=" ~~ pt ~~ "/>"], "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

Back to comp.soft-sys.math.mathematica | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Questions concerning export of 3d plots Patrick Scheibe <pscheibe@trm.uni-leipzig.de> - 2011-04-27 09:37 +0000
  Re: Questions concerning export of 3d plots Alexey <lehin.p@gmail.com> - 2011-04-28 10:35 +0000
  Re: Questions concerning export of 3d plots Alexey <lehin.p@gmail.com> - 2011-04-28 10:36 +0000

csiph-web