This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
 Documentation / Mathematica / Add-ons / Standard Packages / Graphics  /

Graphics`Shapes`

One of the most powerful aspects of graphics in Mathematica is the availability of three-dimensional graphics primitives such as Polygon and Cuboid. You can create three-dimensional graphics objects simply by specifying a list of these primitives. This package provides lists of polygons for some common three-dimensional shapes.


Displaying a three-dimensional shape.

  • This loads the package.
  • In[1]:= <<Graphics`Shapes`

  • Using Short we can look at a "skeleton" version of the polygon list for a cone.
  • In[2]:= Short[ Cone[ ], 5]

    Out[2]//Short=

  • This displays a torus with default values for all parameters.
  • In[3]:= Show[Graphics3D[ Torus[ ] ]]


    Each of the shapes can take various parameters as arguments. These parameters adjust things such as the radii, height, and size of the polygon mesh. If you do not give any arguments, you get the shape with all default values for the parameters. Thus, for example, Torus[] gives a torus with default values for the radius, height, and polygon mesh.


    Shapes.

  • This gives a Möbius strip with a fine mesh.
  • In[4]:= Show[ Graphics3D[ MoebiusStrip[ 2, 1, 80] ]]



    Shapes with default values of parameters.

    You can adjust the position, orientation, and scale of any shape by using TranslateShape, RotateShape, and AffineShape. These functions work by transforming all the coordinates of points given in the polygon list. For example, RotateShape multiplies all the coordinates in the polygon list by a specified rotation matrix.


    Geometric operations on three-dimensional graphics objects.

  • This rotates the Möbius strip by the Euler angles Pi/4, Pi/3 and Pi/2.
  • In[5]:= Show[RotateShape[
    Graphics3D[MoebiusStrip[ ] ],
    Pi/4, Pi/3, Pi/2]]


  • This translates the helix with the smaller radius a distance of in the positive

    direction. The helix with the larger radius has twice as many turns.
  • In[6]:= Show[TranslateShape[
    Graphics3D[ Helix[0.5, 0.5, 2, 20] ],
    {1.5, 0, 0}],
    Graphics3D[ Helix[1, 0.5, 4, 20] ]]



    Making polygons appear transparent.

    WireFrame as well as TranslateShape, RotateShape, and AffineShape will work on any Graphics3D object that contains the primitives Polygon, Line, and Point.

  • WireFrame replaces all the polygon specifications by their edges.
  • In[7]:= WireFrame[
    Polygon[{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}]]

    Out[7]=

  • This gives a wire frame in the shape of a cone.
  • In[8]:= Show[WireFrame[Graphics3D[ Cone[ ] ]],
    Boxed->False]