27.14.1 Cubes
The
cube
command creates cubes.
cube
takes three arguments:
A
,
B
,
C
, three points.
cube(
A
,
B
,
C
)
returns and draws the following cube:
One edge is
AB
.
One face is in the plane
ABC
, on the same side of line
AB
as is
C
.
The cube is on the side of plane
ABC
that makes the points
A
,
B
and
C
counterclockwise.
Examples
C1
:=
cube
([0,0,0],[0,4,0],[0,0,1])
c1
,
c2
,
c3
,
c4
,
c5
,
c6
,
c7
,
c8
:=
vertices
(
C1
)
faces
(
C1
)
[
⎡
⎣
⎡
⎣
0,0,0
⎤
⎦
,
⎡
⎣
0,4,0
⎤
⎦
,
⎡
⎣
0,4,4
⎤
⎦
,
⎡
⎣
0,0,4
⎤
⎦
⎤
⎦
,
⎡
⎣
⎡
⎣
4,0,0
⎤
⎦
,
⎡
⎣
4,4,0
⎤
⎦
,
⎡
⎣
4,4,4
⎤
⎦
,
⎡
⎣
4,0,4
⎤
⎦
⎤
⎦
,
⎡
⎣
⎡
⎣
0,0,0
⎤
⎦
,
⎡
⎣
4,0,0
⎤
⎦
,
⎡
⎣
4,0,4
⎤
⎦
,
⎡
⎣
0,0,4
⎤
⎦
⎤
⎦
,
⎡
⎣
⎡
⎣
0,0,0
⎤
⎦
,
⎡
⎣
0,4,0
⎤
⎦
,
⎡
⎣
4,4,0
⎤
⎦
,
⎡
⎣
4,0,0
⎤
⎦
⎤
⎦
,
⎡
⎣
⎡
⎣
0,4,0
⎤
⎦
,
⎡
⎣
0,4,4
⎤
⎦
,
⎡
⎣
4,4,4
⎤
⎦
,
⎡
⎣
4,4,0
⎤
⎦
⎤
⎦
,
⎡
⎣
⎡
⎣
0,0,4
⎤
⎦
,
⎡
⎣
4,0,4
⎤
⎦
,
⎡
⎣
4,4,4
⎤
⎦
,
⎡
⎣
0,4,4
⎤
⎦
⎤
⎦
]
C2
:=
cube
([0,0,0],[0,4,0],[0,0,-1])
a1
,
a2
,
a3
,
a4
,
a5
,
a6
,
a7
,
a8
:=
vertices
(
C2
)