Skip to Main Content Skip to Search
Product Documentation

plot::Tetrahedronregular Tetrahedra

plot::Hexahedronregular Hexahedra

plot::Octahedronregular Octahedra

plot::Dodecahedronregular Dodecahedra

plot::Icosahedronregular Icosahedra

plot::Tetrahedron(), plot::Hexahedron(), plot::Octahedron(), plot::Dodecahedron(), and plot::Icosahedron() create regular polyhedra.

→ Examples

Calls:

plot::Tetrahedron(<a = amin .. amax>, Options)

plot::Hexahedron(<a = amin .. amax>, Options)

plot::Octahedron(<a = amin .. amax>, Options)

plot::Dodecahedron(<a = amin .. amax>, Options)

plot::Icosahedron(<a = amin .. amax>, Options)

Related Domains:

plot::Box, plot::Cone, plot::Cylinder, plot::Parallelogram3d, plot::Sphere, plot::Transform3d

Related Functions:

plot

Details:

Example 1

Using different Centers, the five regular polyhedra are placed side by side:

plot(plot::Hexahedron  (Center = [0, 0, 0]),
     plot::Tetrahedron (Center = [3, 0, 0]),
     plot::Octahedron  (Center = [6, 0, 0]),
     plot::Icosahedron (Center = [9, 0, 0]),
     plot::Dodecahedron(Center = [12, 0, 0]),
     Axes = Frame);

MuPAD graphics

With the attribut Radius, the size of the polyhydra can be changed:

plot(plot::Hexahedron  (Radius = 1.0, Center = [0, 0, 0]),
     plot::Tetrahedron (Radius = 1.5, Center = [4, 0, 0]),
     plot::Octahedron  (Radius = 2.0, Center = [8, 0, 0]),
     plot::Icosahedron (Radius = 2.5, Center = [13, 0, 0]),
     plot::Dodecahedron(Radius = 3.0, Center = [19, 0, 0]),
     Axes = Frame);

MuPAD graphics

Example 2

A tetrahedron and an octahedron are embedded in a hexahedron:

plot(plot::Hexahedron (FillColorFunction = RGB::Red.[0.2],
                       VisibleFromTo = 0..8),
     plot::Tetrahedron(FillColorFunction = RGB::Green.[0.2],
                       VisibleFromTo = 1..5),
     plot::Octahedron (FillColorFunction = RGB::Blue.[0.2],
                       VisibleFromTo = 3..7),
     Axes = None)

MuPAD graphicsimage

Example 3

Transformation objects can be applied to polyhedra as demonstrated below:

H := plot::Hexahedron(Color = RGB::Blue.[0.2],
                      FillColorType = Flat):
T := plot::Tetrahedron(Color = RGB::Red):
plot(plot::Rotate3d(a, [0, 0, 0], [0, 0, 1], a = 0..2*PI,
                    H,
                    plot::Translate3d([0, 0, a], T, a = 0..2)
                   ), Axes = None)

MuPAD graphicsimage

delete T, H:

Example 4

A FillColorFunction can be specified. This will be called with the index of the current facet as its first parameter, followed by the x-, y- and z-coordinate of the current point:

mycolorlist := [RGB::Red, RGB::Blue, RGB::Green, RGB::Yellow]:
plot(plot::Dodecahedron(Center = [0, 0, 0],
                        FillColorFunction =
                          proc(n, x, y, z) begin
                            [(1 + x)/2, (1 + y)/2, (1 + z)/2]
                          end_proc),
     plot::Dodecahedron(Center = [3, 0, 0],
                        FillColorFunction =
                          proc(n, x, y, z) begin
                             mycolorlist[(n mod 4)+1]
                          end_proc),
     Axes = None):

MuPAD graphics

The same holds true for a LineColorFunction:

plot(plot::Icosahedron(Center = [0, 0, 0],
                       LineColorFunction =
                          proc(n, x, y, z) begin
                            [(1 + x)/2, (1 + y)/2, (1 + z)/2]
                          end_proc),
     plot::Icosahedron(Center = [3, 0, 0],
                       LineColorFunction =
                           proc(n, x, y, z) begin
                              mycolorlist[(n mod 4)+1]
                           end_proc),
     Axes = None, LineWidth = 1.0*unit::mm,
     FillColor = RGB::Grey80, FillColorType = Flat):

MuPAD graphics

If the polyhedron is animated, the color functions are called with an additional argument: the current value of the animation parameter:

plot(plot::Octahedron(FillColorFunction =
                        proc(n, x, y, z, a)
                        begin
                          [sin(n*a)^2, cos(n*a)^2, 1]:
                        end_proc,
                      a = 0..2*PI))

MuPAD graphicsimage

delete mycolorlist:

Background:

tetra- 

hexa- 

octa- 

dodeca- 

icosahedron 

R/a

sqrt(6)/4

sqrt(3)/2

sqrt(2)/2

(sqrt(3)*(1 + sqrt(5)))/4

sqrt(10 + 2*sqrt(5))/4

r/a

sqrt(6)/12

1/2

sqrt(6)/6

sqrt(250 + 110*sqrt(5))/20

(sqrt(3)*(3 + sqrt(5)))/12

A/a^2

sqrt(3)

6

2*sqrt(3)

3*sqrt(25 + 10*sqrt(5))

5*sqrt(3)

V/a^3

sqrt(2)/12

1

sqrt(2)/3

(15 + 7*sqrt(5))/4

(5*(3 + sqrt(5)))/12

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS