| Contents | Index |
plot::Tetrahedron(), plot::Hexahedron(), plot::Octahedron(), plot::Dodecahedron(), and plot::Icosahedron() create regular polyhedra.
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:
Details:
Per default, all polyhedra are centered at the origin. The attribute Center allows to choose a different center. This is helpful to align the polyhedra relative to other objects in the graphical scene. Cf. example 1.
All polyhedra fit into a box extending from -1 to 1 in all coordinate directions. Their size can be changed by the attribute Radius. In case of a hexahedron (a box), this attribute represents the radius of the inscribed sphere. For the other polyhedra, it is the radius of the circumscribed sphere.
The default value of Radius is
for all polyhedra.
Further to the attributes Center and Radius, you can modify the polyhedra by applying transformation objects of type plot::Rotate3d, plot::Scale3d, plot::Translate3d , and plot::Transform3d. Cf. example 3.
User-defined color functions (LineColorFunction, FillColorFunction) are called with the index of the current facet as its first parameter, followed by the
,
, and
coordinate of the current point, followed by the current value of the animation parameter (if animated). Cf. example 4.
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);

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);

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)


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)


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
-,
- and
-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):

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):

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))


delete mycolorlist:
Background:
A polyhedron is called regular if all its facets consist of the same regular polygon and each vertex has the same number of coincidence polygons.
Since Plato we know that only five regular polyhedrons exist:
the tetrahedron with 4 (greek tetra) triangles,
the hexahedron with 6 (greek hexa) squares,
the octahedron with 8 (greek okta) triangles,
the dodecahedron with 12 (greek dodeka) pentagons and
the icosahedron with 20 (greek eikosi) triangles.
The following table lists some important geometrical data of the polyhedra with the edge length
. Where
is the radius of the outer spherem
the radius of the inner sphere,
the surface area and
the volume:
|
|
tetra- |
hexa- |
octa- |
dodeca- |
icosahedron |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

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 |