DIM Code% &10000

REM shape of the data:
REM .Vertices is a table of the vertices:
REM DCD x :DCD y :DCD z         (x left-right; y up-down; z in-out)
REM
REM .Faces is a table of faces:
REM = control := v0 := v1 := v2 :....
REM where v0,v1,v2,.... are the vertices to this face and
REM control is specifier:
REM top bit means always plot the next face after this one in the same colour
REM Next to top bits means 'be a bit darker'
REM bottom 6 bits mean number of edges to this face.
REM If control is 0, then that's the end of the table


FOR Shape = 6 TO 6

FOR Pass = 8 TO 10 STEP 2

P%=Code%
L%=Code%+&10000

 [ OPT Pass
 DCD Vertices-Code%
 DCD EndVertices-Vertices
 DCD Faces-Code%
 ]

CASE Shape OF
WHEN 6
  [ OPT Pass                            ; Two cubes.

  .Vertices
    DCD + 40 :DCD - 40 :DCD - 40   ; 0
    DCD +120 :DCD - 40 :DCD - 40   ; 1
    DCD +120 :DCD - 40 :DCD + 40   ; 2
    DCD + 40 :DCD - 40 :DCD + 40   ; 3
    DCD + 40 :DCD + 40 :DCD - 40   ; 4
    DCD +120 :DCD + 40 :DCD - 40   ; 5
    DCD +120 :DCD + 40 :DCD + 40   ; 6
    DCD + 40 :DCD + 40 :DCD + 40   ; 7

    DCD -120 :DCD - 40 :DCD - 40   ; 8
    DCD - 40 :DCD - 40 :DCD - 40   ; 9
    DCD - 40 :DCD - 40 :DCD + 40   ; 10
    DCD -120 :DCD - 40 :DCD + 40   ; 11
    DCD -120 :DCD + 40 :DCD - 40   ; 12
    DCD - 40 :DCD + 40 :DCD - 40   ; 13
    DCD - 40 :DCD + 40 :DCD + 40   ; 14
    DCD -120 :DCD + 40 :DCD + 40   ; 15
  .EndVertices

  .Faces
    = &04  :=   3 :=  7 :=  4 :=  0
    = &04  :=   9 := 13 := 14 := 10

    = &04  :=   0 :=  1 :=  2 :=  3
    = &04  :=   8 :=  9 := 10 := 11
    = &04  :=   7 :=  6 :=  5 :=  4
    = &04  :=  15 := 14 := 13 := 12
    = &04  :=   0 :=  4 :=  5 :=  1
    = &04  :=   8 := 12 := 13 :=  9
    = &04  :=   2 :=  6 :=  7 :=  3
    = &04  :=  10 := 14 := 15 := 11

    = &04  :=   1 :=  5 :=  6 :=  2
    = &04  :=  11 := 15 := 12 :=  8
    = 0
    ALIGN
  ]

ENDCASE

NEXT Pass

OSCLI("*Save ^.Shapes."+STR$(Shape)+" "+STR$~Code%+"+"+STR$~(P%-Code%))
OSCLI("*SetType ^.Shapes."+STR$(Shape)+" Data")
NEXT Shape
END
