Re: scaling/translating Polyhedra - is this how??
- To: mathgroup at smc.vnet.net
- Subject: [mg38630] Re: scaling/translating Polyhedra - is this how??
- From: atelesforos at hotmail.com (Orestis Vantzos)
- Date: Wed, 1 Jan 2003 03:40:19 -0500 (EST)
- References: <aur7f0$889$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Rules are a much easier way to do this: (* define t0 as in your post *) t1= t0 /. v:{_?NumericQ..}:>(.4 v + {0,0,2}); (* Visualize it.. *) Show[Graphics3D[{t0,t1}]]; Type very carefully!! This seeks all numeric vectors within t0, scales and translatees them in one sweep! Neat, huh? Orestis relishguy at pluggedin.org (Relishguy) wrote in message news:<aur7f0$889$1 at smc.vnet.net>... > I wanted to just display a tetrahedron scaled smaller and translated > along the z-axis like the example on p.517 of the S.Wolfram book > (V.4). After I figured out that the example used a cuboid and the > constructor for the tetrahedron would not work the same way, I devised > a way to accomplish this. However, I have seen so many exercises that > can be accomplished more easily when I gain more knowledge. > > I figured out that the tetrahedron is just a list of polygons, which > are just a list of triples. So, here goes: > > <<Graphics`Polyhedra` > t0=Tetrahedron[] > f0=Function[x,0.2*x] (* make it 20% as big *) > t1=Map[f0,t0,{4}] (* go down to level 4 *) > f1=Function[x,{x[[1]], x[[2]], x[[3]]+0.1}] (* move it up by 0.1 *) > t2=Map[f1, f2, {3}] (*this time it should work on the points *) > Show[Graphics3D[{t2}]] > > Is there some easier way to translate/scale a polyhedron (or polygon)? > > Thanks in advance. > > Regards.. > Note: Of course, I am happy that this can be accomplished at all, > using these weird "map"ings! :-))