Re: Problems updating Graphics3D Polygons
- To: mathgroup at smc.vnet.net
- Subject: [mg77705] Re: Problems updating Graphics3D Polygons
- From: chuck009 <dmilioto at comcast.com>
- Date: Fri, 15 Jun 2007 04:35:22 -0400 (EDT)
Thanks. Jean-Marc noticed in my original post that I just didn't call the function correctly. I like the code you used below, the pts.{{1,0,0},{0,1,0},{0,0,ratio}}. I see what it does just not sure of the construct. I'll figure it out though. Thanks!
> "In[473]:ExpandZ[g_,ratio_]:
> g/.Polygon[pts_]:>Polygon[{#[[1]],#[[2]],#[[3]]*ratio}
> & /@pts];"
>
> There are a couple of "=" signs missing; not sure
> what you're seeing at
> your machine.
>
> This works at mine:
>
> Clear[expandZ]
> expandZ[g_, ratio_] :=
> g /. Polygon[pts_] :>
> Polygon[{#[[1]], #[[2]], #[[3]]*ratio} & /@
> & /@ pts];
>
> But I prefer
>
> Clear[expandZ]
> expandZ[g_, ratio_] :=
> g /. Polygon[pts_] :>
> Polygon[pts.{{1, 0, 0}, {0, 1, 0}, {0, 0,
> 0, 0, ratio}}];
>