Can I ask an easy beginner's question, to which I'm unable to find an easy to understand answer in any of the texts I have (which are admittedly quite old, predating version 6 in some cases)? How do you use the polyhedra as if they were graphics primitives like Sphere and Cuboid? Ie, centred at a point and scaled. Here are silly examples to illustrate the point:
(* spheres along a path *)
data = Table[{Cos[t], Sin[t], Sin[t] Cos[2 t]}, {t, 0, 2 Pi, Pi/24}];
Graphics3D[Sphere[#, 0.3] & /@ data]
(* cubes along a path *)
Graphics3D[Cuboid[#, # + 0.1] & /@ data]
So how to place icosahedra at specific points and scale, writing something like
Graphics3D[icosahedron[#, 0.1] & /@ data]
Edit: I think my problem is how to make GraphicsComplex
and Graphics3D
work together. Eg, where I currently have:
shapes[ct_, siz_] := {Sphere[ct - .2, siz ], Sphere[ct - 0.1, siz]};
Graphics3D[{{shapes[#, size] & /@ data}}]
I'd like to replace that Sphere[]
with icosahedron[]
. Am currently trying to make Heike's solution work...
Edit 2: Working fine now, thanks Heike. Not sure I'll get it 3D-printed though - looks a bit uncomfortable to wear...
You could do something like this:
icosahedron = PolyhedronData["Icosahedron"][[1]];
Graphics3D[Translate[Scale[icosahedron, .1], #] & /@ data]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With