Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: Converting 3D graphics to 2D polygons

  • To: mathgroup at smc.vnet.net
  • Subject: [mg86864] Re: Converting 3D graphics to 2D polygons
  • From: "wyelen at gmail.com" <wyelen at gmail.com>
  • Date: Mon, 24 Mar 2008 01:44:09 -0500 (EST)
  • References: <fs4rq3$p7j$1@smc.vnet.net>

On Mar 23, 2:02 pm, Szabolcs Horv=E1t <szhor... at gmail.com> wrote:
> In versions prior to 6 it was possible to convert 3D graphics to 2D like
> this:
>
> Graphics@Graphics3D[Cuboid[{0, 0, 0}]] // Show
>
> This does not work any more in v6.  (Note that I am not trying to embed
> a 3D graphic into a 2D graphic, which can be done with Inset, but I
> would like to get the 2D projection of 3D points, lines and polygons.)
>
> Is there a way to do this in v6?
>
> One can use an ugly hack like
> ImportString@ExportString[Graphics3D[Cuboid[]], "PDF"]
> but this will break up all the polygons to many little pieces.

This topic sounds interesting, and I've ever thought about something
similar. Wish the following example be helpful :)

GraphicsGrid[{MapIndexed[Function[{meshf, coord}, Plot3D[(Pi - (x^2 +
y^2))/4, {x, -5, 5}, {y, -5, 5}, PlotRange -> All,
        PlotPoints -> 40, MeshFunctions -> meshf, Mesh -> 40,
RegionFunction -> Function[{x, y, z},
          3 > Abs[(x - 1)^2 + y + ((3*z)/4)^2] > 1], PlotStyle ->
None] /. Graphics3D[x_, y__] :>
        Graphics[x, AspectRatio -> Automatic] /. GraphicsComplex[x_,
y_, z__] :> GraphicsComplex[(Drop[#1, coord] & ) /@ x, y]],
    {#1 & , #2 & , #3 & }]}]


  • Prev by Date: Re: Re: Re: Re: smallest
  • Next by Date: Re: Writing variables in strings (opened from text files)
  • Previous by thread: Converting 3D graphics to 2D polygons
  • Next by thread: Bug: AbsoluteOptions does not work with ViewMatrix