Make a constellation of random polyhedra.
Run the code to get a picture of a dodecahedron. Try other polyhedra, like "Octahedron" or "SnubCube":
Choose a polyhedron at random. Rerun the code to get a different polyhedron:
This gives the complete list of names of polyhedra that are known to the Wolfram Language:
Choose one polyhedron name at random. Rerun the code to get a different choice:
Make a picture of a random polyhedron. Rerun the code to get a different polyhedron:
Wrap the randomly chosen polyhedron name with PolyhedronData to get a picture of it:
Make a picture of 100 random polyhedra. Rerun the code to get different polyhedra:
This gives a graphic of a dodecahedron:
You can get the same result by asking for the GraphicsComplex of the dodecahedron and providing a Graphics3D wrapper:
GraphicsComplex gives the vertices and polygons indexed in terms of those vertices for a 3D graphics object:
The advantage of supplying the Graphics3D wrapper yourself is that you can put more than one polyhedron into the graphic.
This makes a graphic of 100 polyhedra chosen at random. They’re all positioned in the same place, so they intersect:
Move the polyhedra in random directions to spread them out:
Add a translation to spread out the random polyhedra.
This gives a random number between 0 and 20:
This gives three random numbers:
Put each polyhedron at a random position, using RandomReal to generate a random 3D coordinate:
Add color:
RandomColor gives a random color. Rerun the code to get a different choice:
Give each polyhedron a random color (you need to put the color and the polyhedron in a list, indicated by curly brackets):
Share It—make a website that gives a different “polyhedron party” each time it’s visited:
Deploy the “polyhedron party” code to the Wolfram Cloud, where anyone with a browser can use it:
Click the link in the output to visit the site. Refresh the page in your browser to get a new image.
Tell the world about your creation by sharing the link via email, tweet or other message.