MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Visible mesh edges in PDF output of 3D graphic

  • To: mathgroup at smc.vnet.net
  • Subject: [mg130157] Re: Visible mesh edges in PDF output of 3D graphic
  • From: JUN <noeckel at gmail.com>
  • Date: Fri, 15 Mar 2013 01:47:50 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <khpcon$me2$1@smc.vnet.net> <khsbc5$36i$1@smc.vnet.net>

On Thursday, March 14, 2013 4:13:09 AM UTC-7, Peter Pein wrote:
> Am 13.03.2013 09:18, schrieb David Reiss:
> 
> > Consider the following plot:
> 
> >
> 
> > graphicTest=
> 
> > ContourPlot3D[{h==0,g==0},{x,-2,2},{y,-2,2},{z,-2,2},
> 
> > MeshFunctions->{Function[{x,y,z,f},h-g]},
> 
> > MeshStyle->{{Thick,Black,Opacity[1]}},
> 
> > Mesh->{{0}},
> 
> > ContourStyle->{
> 
> > Directive[Orange,Opacity[.5],Specularity[White,30]],
> 
> > Directive[Purple,Opacity[.3],Specularity[Green,30]]},
> 
> > PlotPoints->30,
> 
> > Boxed->False,
> 
> > (*Axes->False,*)
> 
> > BoxRatios->Automatic,
> 
> > PlotRange->{All,All,{-2,2}}
> 
> > ]
> 
> >
> 
> >
> 
> > Then export it as a PDF and look at it in a PDF viewer (insert your
> 
> > directory path at <<<your directory path here>>> to make this work):
> 
> >
> 
> > Export["<<<your directory path here>>>/
> 
> > testGraph.pdf",graphicTest,"PDF"]//SystemOpen
> 
> >
> 
> > Look at the resulting PDF.  You will see the lattice of the underlying
> 
> > plot mesh visible.  Is there any way to get rid of this?  Note that I
> 
> > expect to see the fasceted nature of the graphic, but the explicit
> 
> > differently colored edges are not desired.
> 
> >
> 
> 
> 
> Hi David,
> 
> 
> 
>   as you did not provide us with the definitions of g and h, I invented 
> 
> some toy expressions:
> 
> {g, h} = Plus @@@
> 
>     Through[{Cos, 1 - 2 Sinc[#/2]^2 &}[Pi*{x, y, z}]];
> 
> 
> 
> The plain export to PDF results in a 110 MB file with which the 
> 
> Adobe-Reader has got hard times (it crashes on my 12GB-box). GS-View 
> 
> works and I can see the many lines.
> 
> 
> 
>   If losing the scalability is acceptable,
> 
> 
> 
> Export[ToFileName[{$HomeDirectory, "Desktop"}, "test2.pdf"],
> 
>   Rasterize[graphicTest, ImageSize -> 1200], ImageResolution -> 300]
> 
> 
> 
> might help (resulting in a 633 KB PDF file). I tried an export without 
> 
> explicit rasterization via the options "AllowRasterization"->True and 
> 
> ImageResolution -> 300 in the call to Export[], but it did not look as 
> 
> nice as the result of the above line. Maybe I misunderstood the meaning 
> 
> of this option :(
> 
> 
> 
> hth,
> 
> Peter

What I do in these cases is described here:
http://mathematica.stackexchange.com/a/1551/245

Before making any plots, execute this command:

Map[SetOptions[#, 
    Prolog -> {{EdgeForm[], Texture[{{{0, 0, 0, 0}}}], 
       Polygon[#, VertexTextureCoordinates -> #] &[{{0, 0}, {1, 
          0}, {1, 1}}]}}] &, {Graphics3D, ContourPlot3D, 
   ListContourPlot3D, ListPlot3D, Plot3D, ListSurfacePlot3D, 
   ListVectorPlot3D, ParametricPlot3D, RegionPlot3D, RevolutionPlot3D,
    SphericalPlot3D, VectorPlot3D}];


Jens



  • Prev by Date: Re: Multiple independent random number streams cannot be implemented.
  • Next by Date: Dynamic application of several polynomials
  • Previous by thread: Re: Visible mesh edges in PDF output of 3D graphic
  • Next by thread: Re: Visible mesh edges in PDF output of 3D graphic