MathGroup Archive 2007

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

Search the Archive

Re: Problems updating Graphics3D Polygons



Hi,

your problem is a simple typo, your wrote Expand instead of ExpandZ.

Hope this helps, Daniel



chuck009 wrote:

> Hello guys.  Can you help me write a function which takes a Graphics3D object and multiplies the z-coordinate of each point of all the polygons by a ratio.  This is what I have so far but it's not working:

> 

> In[473]:=

> ExpandZ[g_,ratio_]:=

>     g/.Polygon[pts_]:>Polygon[{#[[1]],#[[2]],#[[3]]*ratio}& /@pts];

> 

> When I test it with this simple Graphics3D object:

> 

> gobject=Graphics3D[{Polygon[{{0.,0.5,1.28},{0.,0.,1.},{0.5,0.,1.28},{0.5,

>             0.5,1.64}}],Polygon[{{

> 0.5,0.5,1.64},{0.5,0.,1.28},{1.,0.,2.71},{1.,0.5,3.49}}]}];

> 

> It doesn't do anything:

> 

> g2=Expand[gobject,2]

> InputForm[g2]

> 

> Out[475]=

> â??Graphics3Dâ??

> 

> Out[476]//InputForm=

> Graphics3D[{Polygon[{{0., 0.5, 1.28}, {0., 0., 1.}, 

>     {0.5, 0., 1.28}, {0.5, 0.5, 1.64}}], 

>   Polygon[{{0.5, 0.5, 1.64}, {0.5, 0., 1.28}, 

>     {1., 0., 2.71}, {1., 0.5, 3.49}}]}]

> 

> I'll keep working on it.  Thanks!

> 




  • Prev by Date: Re: 6.0 Get Graphics Coordinates...
  • Next by Date: Re: Changed order of multiplication in Times[a, b, c] in version
  • Previous by thread: Re: Problems updating Graphics3D Polygons
  • Next by thread: Re: Problems updating Graphics3D Polygons