MathGroup Archive 2007

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

Search the Archive

Re: Re: Problems updating Graphics3D Polygons


That's tough for me to follow.  Looks like polymorphism.  Was not aware I could do that in Mathematica.  Nice to read and study other peoples code here.  That helps me get better.  The Mathematica syntax is the tough part for me but I'm getting better by hanging out here :)


> A solution doesn't HAVE to be this flexible, but...
> why the heck not?
> 
> Clear[scaleZ, array, threeD]
> array[dims_List] = ArrayQ[#] && Dimensions[#] == dims
> &;
> threeD[m_?(array[{3, 3}])] := m
> threeD[m_?(array[{3}])] := DiagonalMatrix@m
> threeD[f_?NumericQ] := DiagonalMatrix@{1, 1, f}
> scaleZ[graphics_, m_] :=
>   graphics /. Polygon[pts_] :> Polygon[pts.threeD[m]]
> 
> Try it out:
>


  • Prev by Date: Re: Help with formatting output
  • Next by Date: Re: ParametricPlot3D between two curves
  • Previous by thread: Re: Problems updating Graphics3D Polygons
  • Next by thread: Re: Re: Problems updating Graphics3D Polygons