2. Surface Files - format
All contents of the surface file are ignored until a
BEGIN token is encountered. The surface file then described as follows:
surfaceFile ::=
BEGIN CAD DESCRIPTION
surfaceEquation
surfaceName
surfaceColor
surfaceCells
BEGIN CELL DEFINITIONS
numberOfCells instances of {cellDefinition}
END CELL DEFINITIONS
BEGIN CELL DISPLAY INFORMATION
numberOfCells instances of {cellDisplayInfo}
END CELL DISPLAY INFORMATION
END CAD DESCRIPTION
surfaceEquation ::= Surface polynomial (equation of surface)
surfaceName ::= Name nameOfSurface | Name UNNAMED
surfaceColor ::= Color r g b (REALs specifying overall color of surface)
surfaceCells ::= Cells numberOfCells
surfaceTriangulation ::= Triangulations numberOfTriangulations
Each cell is described as follows:
cellDefinitions ::=
CellIndices i j k (NATs identifying cell)
CellDegree degree (= 0, 1, or 2; degree of cell)
DefiningFormula definingFormula
A defining formula may be simple or compound.
definingFormula ::= simpleDefiningFormula | compoundDefiningFormula
simpleDefiningFormula ::= simpleOperation polynomial
simpleOperation ::= IsPositive | IsZero | IsNegative
compoundDefiningFormula ::=
compoundOperation numberOfArguments
definingFormula (the first argument)
definingFormula (the second argument)...
compoundOperation ::= And | Or
numberOfArguments ::= NAT >= 1
Cell display information format.
cellDisplayInfo ::= zeroD | oneD | twoD
zeroD ::=
Indices i j k (NATs)
Degree 0
Position x y z (REALs)
oneD ::=
Indices i j k (NATs)
Degree 1
Vertices numberOfVertices
numberOfVertices instances of: {x y z (REALs)}
twoD ::=
Indices i j k (NATs)
Degree 2
Vertices numberOfVertices
numberOfVertices instances of: {x y z (REALs)}
Triangles numberOfTriangles
numberOfTriangles instances of: {vertex1 vertex2 vertex3 (NATs)}
Each cellDisplayInfo must agree exactly in degree and indices with the corresponding cellDefinition. The degree and indices effectively act as a check that the cell display information matches up with the cell definitions.