#
# Example of faces, loops and edges components.
#

#
# Positions array.  These are a list of all the verticies of the object;
#   no particular order is required here.
#
object "position list" class array type float rank 1 shape 3 items 12 
data follows
  5.0   0.0   1.0     # point number 0
  5.0   0.0   5.0     #  1
  3.0   5.0   5.0     #  2
  4.5   0.0   1.5     #  3
  4.5   0.0   4.5     #  4
  3.0   4.0   5.0     #  5
  4.0   0.5   5.0     #  6
  1.5   0.0   1.5     #  7
  1.5   0.0   4.5     #  8
  2.0   0.5   5.0     #  9
  1.0   0.0   5.0     # 10
  1.0   0.0   1.0     # 11

#
#  Edges array.  This is a list of connected points, by point number.  All
#  the edges associated with a particular face need to be listed together.
#  If points 10, 3 and 7 make a triangle, the list is "10 3 7" and the 10
#  is not repeated.  If there is a hole in the triangle, the edges which
#  describe the hole must be listed right before or right after.
#
object "edge list" class array type int rank 0 items 23 data follows
  1   0   2      # edge point index 0
 10   1   2      #  3
  9   6   5      #  6
 10   1   0  11  #  9
  8   4   3   7  # 13
 11  10   2      # 17
  0  11   2      # 20
attribute "ref" string "positions"

#
#  Loops array.  This is a list of connected edges, by edge number.  Each
#   number is the edge index of where the next loop starts.
#
object "loop list" class array type int rank 0 items 7 data follows
  0     # loop index 0
  3     #  1
  6     #  2
  9     #  3
 13     #  4
 17     #  5
 20     #  6
attribute "ref" string "edges"

#
#  Faces array.  This is list of which loops make faces.  If there are
#   no holes in the faces, this is list of all loops.  If two or more
#   loops actually describe the outside edges and inside hole edges of
#   a face, then this list contains the starting loop numbers of the
#   list of loops making up a face.
#
object "face list" class array type int rank 0 items 5 data follows
 0
 1
 3
 5
 6
attribute "ref" string "loops"

#
#  Colors array.  To get flat shaded surfaces, there should be one color
#    per face, and one normal per face.  These are Red,Green,Blue values
#    between 0 (no color) and 1 (fully saturated).
#
object "color list" class array type float rank 1 shape 3 items 5 data follows
 0.6  0.3  0.6
 0.8  0.8  0.1
 0.9  0.4  0.9
 0.4  0.8  0.7
 0.8  0.8  0.8
attribute "dep" string "faces"

#
#  Normals array.
#
object "normal list" class array type float rank 1 shape 3 items 5 
data follows
 0.93   0.37   0.0
 0.0    0.0    1.0
 0.0    1.0    0.0
-0.93   0.37   0.0
 0.0   -0.63  -0.78
attribute "dep" string "faces"

#
#
#  Field definition to put the arrays together.
#
object "solid" class field
   component "positions"    "position list"
   component "edges"        "edge list"
   component "loops"        "loop list"
   component "faces"        "face list"
   component "colors"       "color list"
   component "normals"      "normal list"
end


#
# script to look at the object:
#
#  g = Import("solid.dx");
#  a = AutoCamera(g, [0.2 0.1 1.0]);
#  Display(g, a);
#
# to look at just the connections:
#
#  s = ShowConnections(g);
#  Display(s, a);
#
#
