Try now in the
Open Cloud »
(no sign-in required)

Polyhedron Party

Make a constellation of random polyhedra.

Run the code to get a picture of a dodecahedron. Try other polyhedra, like Octahedron or SnubCube:

In[1]:=
X
Out[1]=

Choose a polyhedron at random. Rerun the code to get a different polyhedron:

SHOW/HIDE DETAILS

This gives the complete list of names of polyhedra that are known to the Wolfram Language:

In[1]:=
X
Out[1]=

Choose one polyhedron name at random. Rerun the code to get a different choice:

In[2]:=
X
Out[2]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Make a picture of a random polyhedron. Rerun the code to get a different polyhedron:

SHOW/HIDE DETAILS

Wrap the randomly chosen polyhedron name with PolyhedronData to get a picture of it:

In[1]:=
X
Out[1]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Make a picture of 100 random polyhedra. Rerun the code to get different polyhedra:

SHOW/HIDE DETAILS

This gives a graphic of a dodecahedron:

In[1]:=
X
Out[1]=

You can get the same result by asking for just the faces of the dodecahedron and providing a Graphics3D wrapper:

In[2]:=
X
Out[2]=

The advantage of supplying the Graphics3D wrapper yourself is that that way you can put more than one polyhedron into the graphic.

This makes a graphic of 100 polyhedra chosen at random. Theyre all positioned in the same place, so they intersect:

In[3]:=
X
Out[3]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Move the polyhedra in random directions to spread them out:

SHOW/HIDE DETAILS

Add a translation to spread out the random polyhedra.

This gives a random number between 0 and 20:

In[1]:=
X
Out[1]=

This gives three random numbers:

In[2]:=
X
Out[2]=

Put each polyhedron at a random position, using RandomReal to generate a random 3D coordinate:

In[3]:=
X
Out[3]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Add color:

SHOW/HIDE DETAILS

RandomColor gives a random color. Rerun the code to get a different choice:

In[1]:=
X
Out[1]=

Give each polyhedron a random color (you need to put the color and the polyhedron in a list, indicated by curly brackets):

In[2]:=
X
Out[2]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Share ItMake a website that gives a different polyhedron party each time its visited:

SHOW/HIDE DETAILS

Deploy the polyhedron party code to the Wolfram Cloud where anyone with a browser can use it:

In[1]:=
X
Out[1]=

Click the link in the output to visit the site. Refresh the page in your browser to get a new image.

Share the link by right-clicking it and choosing Copy Address. Paste the link into an email, tweet, or other message.

HIDE DETAILS
In[1]:=
X
Out[1]=