Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

enter image description here

I am trying to view dodecahedrons distributed around a space, but the above code fails. The expression

      ExampleData[{"Geometry3D", "SpaceShuttle"}, "GraphicsComplex"], RandomReal[30, {3}]],

works for space shuttles but not for dodecahedrons.

Now I need to understand how to investigate the ExampleData output and PolyhedronData output, how can I do it?

share|improve this question

closed as too localized by Oleksandr R., s0rce, whuber, Sjoerd C. de Vries, Yves Klett Mar 26 '13 at 19:17

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

What do you mean by "but the above"? Did you read the documentation for PolyhedronData? How about Graphics3D? If you did, what didn't you understand? –  Oleksandr R. Mar 26 '13 at 16:00
As regards the problem of placing dodecahedra (-ons?), there's this... –  cormullion Mar 26 '13 at 16:07
It seems to me that this is not a question of "debugging" as much as it is not understanding the difference between graphics and graphics primitives. To address this problem you need only read the documentation. Please note that in most cases having read and understood the documentation is a prerequisite to writing a meaningful program: it isn't really a bug if, without bothering to inform yourself first, you just type whatever comes to mind and find that it doesn't work. –  Oleksandr R. Mar 26 '13 at 16:29

2 Answers 2

up vote 1 down vote accepted

You might want to use Head to accompany your study of the documentation:

use of head

Then you can see from the Graphics3D page that you can put a GraphicsComplex primitive in a Graphics3D:

Graphics3D[PolyhedronData["Dodecahedron", "Faces"]]

but you can't put a Graphics3D in a Graphics3D:

Graphics3D[ExampleData[{"Geometry3D", "SpaceShuttle"}]] (* doesn't work *)

unless you get a GraphicsComplex primitive first:

Graphics3D[ExampleData[{"Geometry3D", "SpaceShuttle"}, 
share|improve this answer
Thank you +1, it is evil that Mathematica has a lot of false-friends with *ix commands -- typically head(...) meaning stdouting the initial lines. –  hhh Mar 26 '13 at 20:03

I guess the problem is that PolyhedronData returns an image and that Translate doesn't act on images but, rather, on Graphics primitives. Try

gc = PolyhedronData["Dodecahedron", "Faces"];
Graphics3D[{gc, Translate[gc, {3, 3, 3}]}]

enter image description here

Note that the intricacies of PolyhedronData are not exactly fresh in my mind. I simply referred to the documentation to find this invocation.

share|improve this answer
@hhh Well, if you execute the command, you'll see what the return value is, I guess. Also, all the different possible invocations and their outcomes are well documented on the page that I linked to. –  Mark McClure Mar 26 '13 at 17:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.