Cell files are typically encoded as 8-bit ASCII text, with whitespace (spaces, horizontal tabs and/or newline sequences) delimiting each field. Consecutive whitespace characters are treated as a single delimiter. The only exception to this rule is when text string data is present (applicable to Text and Text List cell types only): these must be entered on a separate line and be terminated by a newline sequence.
The file is made up of cell definitions; a cell can be a set, a primitive, a block definition, a block reference, an embedded image or a referenced image. Sets are an important cell type that contain lists of other cells, including other sets. Each cell inherits its translation, rotation, scale and (optionally) color from its parent set. Through the use of sets, a cell hierarchy is achieved.
Each cell has the following general format:
| Cell header |
| Cell bounding box data (optional, present only if cell flag bit 6 is set) |
| Cell attribute data (optional, present only if cell flag bit 0 is set). |
| Cell joint data (optional, present only if cell flag bit 1 is set) |
| Cell geometry data (optional, present only if cell flag bit 2 is set) |
| Cell type-specific parameter data |
Note that much of the data is only present if an associated cell flag bit, contained within the cell header, is set; refer to the corresponding section for additional information.
All distances, timings and velocities specified in the cell file are in arbitrary units; AutoMod will assume these to be its default model units when reading in the cell file. If a model that exports a cell file has Feet for its distance units and Minutes for its time units, and the cell file is then imported by a model whose distance and time units are Millimeters and Seconds respectively, then the image will be the wrong size and, more seriously, any embedded kinematic joint information will be invalid.
By convention, the first cell in a cell file is a special Set termed the Root Set. The name of this Set is based upon the name of the file, with underscores replacing periods. For example, the file Car.cell would have a root set named Car_cell. The root set contains a single cell member called the Main Set, which typically has the name of the cell file without the extension. Extending the previous example, the name of the Main Set would be Car. The Main Set then contains the remainder of the cells making up the 3D image.
Note that cell files use the right-hand-rule for specifying cell geometry. To visualize right-hand-rule geometry, imagine a map aligned so that the X-axis runs from West to East and the Y-axis from South to North with the Z-axis being a measurement of elevation. Other CAD and 3D systems that use the right-hand-rule include AutoCAD and 3D Studio. A common alternative is the left-hand-rule, in which the X-axis runs from West to East, the Z-axis from North to South and the Y-axis handling elevation. The left-hand-rule is the default for OpenGL, OpenInventor, Direct3D, VRML and Java3D amongst others. When converting between these formats, it is important to apply the correct transformation to geometry data.
CellType<spc>CellFlags<nl>where
CellType is the cell type definition, CellFlags are the cell flags, <spc> is a space character and <nl> is the newline sequence.The cell type value is a decimal integer value that indicates the type of cell definition that follows:
| Code | Cell Type |
|---|---|
| 100 | Triad |
| 115 | Vector list1 |
| 125 | Polyhedron1 |
| 130 | Arc/Circle (coarse) |
| 131 | Arc/Circle (fine) |
| 140 | Text (world) |
| 141 | Text (screen fast) |
| 142 | Text (screen normal) |
| 143 | Text (unrotate fast) |
| 144 | Text (unrotate normal) |
| 150 | Text list (world)1,3 |
| 151 | Text list (screen fast)1,3 |
| 152 | Text list (screen normal)1,3 |
| 153 | Text list (unrotate fast)1,3 |
| 154 | Text list (unrotate normal)1,3 |
| 308 | Block definition1 |
| 310 | Trapezoid/Box |
| 311 | Tetrahedron |
| 315 | Rectangle2 |
| 330 | Hemisphere (coarse) |
| 331 | Hemisphere (fine) |
| 340 | Cone (coarse) |
| 341 | Cone (fine) |
| 350 | Cylinder (coarse) |
| 351 | Cylinder (fine) |
| 360 | Frustum (coarse) |
| 361 | Frustum (fine) |
| 388 | File reference1,4 |
| 408 | Instance (of block or file definition)1 |
| 555 | Compiled picture (pre-OpenInventor format)1 |
| 599 | Compiled picture (embedded file)1,4 |
| 700 | Set |
| 7000 | Main Set |
| 10000 | Root Set |
|
1Not editable in ACE 2Editable (despite being described as "uneditable"), but not creatable, in ACE. 3Standard (OpenGL/IrisGL) Graphics versions only. 4VR (OpenInventor) Graphics versions only. |
This is a bit-field containing a number of different flags; each flag is a bit from the binary equivalent of the decimal integer value. Bits are numbered, starting from the least significant (i.e. right-most), consecutively beginning with 0. For example, the decimal value 21 is 1101 in binary, indicating that bits 0, 2, and 3 are set - all other bits are clear.
It is essential that these flags are scanned since they determine the subsequent formatting of the cell data.
| Bit | Value (Hex) | Value (Dec) | Meaning if set |
|---|---|---|---|
| 0 | 0x01 | 1 | Cell attributes are present. |
| 1 | 0x02 | 2 | Cell joint data (parameters and geometry) is present. |
| 2 | 0x04 | 4 | Cell geometry is present. |
| 3 | 0x08 | 8 | Cell geometry is in matrix form. |
| 4 | 0x10 | 16 | Inherit color from parent. Color attributes are ignored. |
| 5 | 0x20 | 32 | Cell has associated data in AutoMod. TODO - expand on this. |
| 6 | 0x40 | 64 | Bounding box data is present. This feature is only supported in VR Graphics versions. |
Here are some sample cell headers to illustrate this section:
115 17
The above cell header defines a vector list (cell type 115). 17 is the decimal representation of the binary value 10001. Looking at the bits making up the value 17, we see that we need to set bits 0 (value 1) and bit 4 (value 16) and clear all the other bits; consequently, we can deduce that the vector list's attributes are present and that it inherits its color from its parent set.
700 5
This cell header defines a set (cell type 700) for which a set of attributes and geometry have been defined (5 decimal = 101 binary, therefore bits 0 and 2 are set).
This is the next cell record to be processed after the cell header record; however, it is only present if cell flag bit 6 is set. It contains six fields that define a bounding box for the contents of the cell. A bounding box is the smallest box that can entirely contain the contents of the cell. By convention, the cell bounding box data is formatted as follows:
MinX<spc>MaxX<spc>MinY<spc>MaxY<spc>MinZ<spc>MaxZ<nl>
where MinX and MaxX are doubles specifying the minimum and maximum X-axis co-ordinates, respectively, MinY and MaxY are doubles containing the minimum and maximum Y-axis co-ordinates, respectively, MinZ and MaxZ are the doubles containing the minimum and maximum Z-axis co-ordinates, respectively, <spc> is a single space character and <nl> is the newline sequence.
Note that these co-ordinates are relative to the cell's origin and are measured along the cell's local X, Y & Z axes (refer to the Geometry Data section for more information).
If this record is not present, AutoMod determines the bounding box dimensions whilst reading the cell.
This feature was added to AutoMod in version 10.0 to support the OpenInventor scene graph library that AutoMod uses as its graphics engine.
Here is a sample bounding box record to help illustrate this section.
-100.0 100.0 -50.0 50.0 0.0 10.0
The bounding box for this cell extends 100 model units in both directions along the local X-axis and for 50.0 model units in each direction on the local Y-axis; it extends 10 model units above the origin on the local Z-axis.
The cell's attributes are contained in a record following the bounding box data (if present), but only if cell flag bit 0 is set. The record contains six fields: face color, edge color, line style, line width, display style and name. By convention, the attribute data is formatted as follows:
FaceCol<spc>EdgeCol<spc>LineStyle<spc>LineWidth<spc>DisplayStyle<spc>Name<nl>
where FaceCol is a decimal integer identifying the face color, EdgeCol a decimal integer identifying the edge color, LineStyle is a decimal integer identifying the line style, LineWidth is a decimal integer identifying the line width, DisplayStyle is a decimal integer identifying the display style, Name is a non-whitespace string identifying the name of the element, <spc> is a single space character and <nl> is the newline sequence.
If no attribute record is present, the following values are assumed:
1 1 0 1 1 none
Face colors are used for all 3D surfaces (solid graphics mode only) whereas edge colors are used for lines and wireframe graphics (both solid and wireframe graphics mode).
These fields are ignored if cell flag bit 4 is set; in this case, face and edge colors are inherited from the parent set. If the root set inherits from its parent, then the color is assigned elsewhere in AutoMod. For example, a vehicle may be assigned a color in a movement system; it's cell file's root set then inherits this color.
The color is encoded as a decimal integer value, whose meaning should be interpreted as follows:
| Code | Color |
|---|---|
| 0 | Black |
| 1 | Red |
| 2 | Green |
| 3 | Yellow |
| 4 | Blue |
| 5 | Magenta |
| 6 | Cyan |
| 7 | White |
| 8 | Light Gray |
| 9 | Dark Gray |
| 10 | Brown |
| 11 | Light Blue |
| 12 | Purple |
| 13 | Orange |
| 14 | Light Green |
| 15 | Light Yellow |
Note that, as of V8.5, AutoMod allows the RGB (red-green-blue) settings for each color to be specified in the .asilibrc settings file. It is possible, for example, to change color 1 so that it appears blue, yellow, or some custom color. To accurately reproduce the content of a cell file's appearance, the .asilibrc file - if present - should also be processed; the format of this file is currently beyond the scope of this document. Also note that the .asilibrc file permits more than 16 colors to be defined; however, AutoMod does not appear to support colors with numbers outside the range of 0-15.
As of V10.0, AutoMod only uses the face color; edge colors are not supported by the OpenInventor scene graph and are ignored.
The default face and edge color is red (1).
This is a decimal integer value that encodes line style, as defined in the table below. This attribute only affects lines and wireframe graphics (both solid and wireframe graphics mode) and does not affect the appearance of surfaces (solid graphics mode).
| Code | Line Style |
|---|---|
| 0 | Solid |
| 1 | Dashed |
| 2 | Dotted |
| 3 | Halftone |
Note: ACE, as supplied with AutoMod V10.0, does not appear to honor line style information when reading cell files; all line styles are reset to solid as the cell file is read in. Furthermore, ACE only offers solid and dashed line styles when editing a cell.
This attribute has no effect on sets and is not inheritable.
The default line style is solid (0).
This is a decimal integer value that encodes how each cell is to be drawn:
| Code | Display Style |
|---|---|
| 0 | Wireframe. The object is always displayed in wireframe mode even if solid graphics mode is enabled. |
| 1 | Solid. The object is displayed as a solid in solid graphics mode, a wireframe in wireframe graphics mode. |
| 2 | Almost solid (transparent 1) |
| 3 | Transparent 2 |
| 4 | Transparent 3 |
| 5 | Transparent 4 |
| 6 | Transparent 5 |
| 7 | Transparent 6 |
| 8 | Transparent 7 |
| 9 | Transparent 8 |
| 10 | Transparent 9 |
| 11 | Transparent 10 |
| 12 | Transparent 11 |
| 13 | Transparent 12 |
| 14 | Transparent 13 |
| 15 | Transparent 14 |
| 16 | Almost invisible (transparent 15) |
Note: ACE includes a display style option called "invisible". However, the cell file format does not support invisible cells and therefore "invisible" cells become visible the next time the image is loaded. Strange, but true.
This attribute has no effect on sets and is not inheritable.
The default display style is solid (1).
2 2 2 1 0 DashedLineThis defines a cell that uses Green for both face (2) and edge (2) colors, is drawn with a dashed line type (2), single pixel width (1), always in wireframe mode (0) and named "DashedLine".
A cell's joint data records follow its attribute data (if present) in the cell's definition, but only if cell flag bit 1 is set. Although it appears possible to add joint data to any type of cell, only ordinary sets (type 700) should be assigned joint data.
Joint data is used to encode both dynamic joints (also known as kinematic joints) and terminal control frames (TCFs). A set may have either, neither or both of these characteristics.
Dynamic joints come in two types: rotational and translational. The former is used to represent a pivoting joint, about the joint's local Z-axis, whilst the latter represents linear travel, again along the joint's local Z-axis. In both cases, the set and its contents are affected by the joint position.
TCFs identify locations on AutoMod vehicles and queues where loads may be attached.
The first record making up this section is the joint type. By convention, this record is formatted as follows (although ACE is inconsistent in its formatting of this record with regards to leading whitespace):
JointType<nl>
where JointType is a decimal integer identifying the joint type and <nl> is the newline sequence.
The second record making up this section is the joint data record, which consists of five fields: joint speed, joint minimum value, joint maximum value, joint current value and the TCF data present flag. By convention, this record is formatted as follows (although ACE is inconsistent in its formatting of this record with regards to whitespace):
JointSpeed<spc>JointMin<spc>JointMax<spc>JointCur<spc>TCFPresent<nl>
where JointSpeed is a double containing the joint speed, JointMin is a double containing the smallest possible joint value, JointMax is a double containing the largest possible joint value, JointCur is the current joint value and TCFPresent is an boolean flag indicating whether TCF data is present.
This record is followed by the joint geometry data, which is used to transform the Z-axis of the joint, relative to its local position; the contents of the dynamic set are unaffected by this transformation. Motion of the joint is relative to this Z-axis. The only transformations that make sense here are rotations about the X- and Y-axes to reposition the joint's Z-axis without affecting any contents of the joint; translations and scaling changes have no benefits. Refer to the Geometry Data section for information on the format of this record. This information is ignored if the joint type is 0.
The joint geometry data is always terminated by a record containing a zero followed by a new-line sequence:
0<nl>
If the TCF data present flag is set, then the terminal geometry data follows; if the flag is clear, this data is not present. This transformation data is used to determine how loads that are attached to the TCF are oriented and stacked; the transformation applies only to attached loads and not to the contents of the TCF set. Refer to the Geometry Data section for information on the format of this record.
This field is a decimal integer value that encodes the joint type:
| Code | Joint Type |
|---|---|
| 0 | Not a joint - TCF data only. |
| 1 | Rotation joint. |
| 2 | Translation joint. |
If the Joint Type is 0, then the TCF data present flag must be 1.
Here are some example records to illustrate this section:
1 10.0 0.0 90.0 45.0 0 0.0 0.0 0.0 0 0.0 0.0 0.0 1.0 1.0 1.0 0
The above data defines a rotational, dynamic joint. The speed of the joint is 10 degrees per time unit, and motion is permitted between 0 and 90 degrees. The initial position of the joint is at 45 degrees. This is not a terminal set and so no TCF data is present. A default transformation (no translation, no rotation, and unit scaling) is applied to the joint, meaning that the joint's axes are oriented with the owning cell set's axes; rotation takes place around the cell's/joint's local Z-axis.
0 0.0 0.0 0.0 0.0 1 0.0 0.0 0.0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0.0 0.0 0.0 0 0.0 0.0 0.0 1.0 1.0 1.0
This example defines a terminal set with no dynamic joint data. Dummy joint data is present (which is ignored since the joint type is none) and the supplied TCF geometry data applies a default transformation (no translation, no rotation, and unit scaling) to the TCF transformations.
2 500.0 -2000.0 10000.0 0.0 1 0.0 0.0 0.0 0 -90.0 0.0 0.0 1.0 1.0 1.0 0 0.0 0.0 0.0 0 0.0 0.0 0.0 1.0 1.0 1.0
The above joint data defines a translational, dynamic joint which is also a terminal set. The speed of the joint is 500 distance units per time unit, with motion permitted in the range -2000.0 to 10,000.0 distance units. The initial position of the joint is at 0. The joint applies a transformation to rotate the joint -90.0 degrees about the X-axis. This aligns the joint's Z-axis with the owning cell's Y-axis, so that as the current joint value increases, the cell and its contents travel along the cell's Y-axis; the orientation of the cell and (in particular) its contents are unaffected by this transformation otherwise. Since this cell is also a terminal set, TCF data is appended. In this case, a default transformation is applied to the TCF.
This record consists of three fields: the translations along the local X, Y and Z axes, respectively. There is no standard convention for the appearance of this record, ACE seems to employ a slightly different format for each circumstance, but the most common is:
<spc><spc>XTran<spc>YTran<spc>ZTran<nl>
where XTran is a double containing the local X-axis translation, YTran is a double containing the local Y-axis translation, ZTran is a double containing the local Z-axis translation, <spc> is the space character and <nl> is the newline sequence.
Note the term "local" when referring to the translation along each axis; the translation is dependent upon the current orientation of the cell. Refer to the section on rotation for additional information. However, translations are applied before the rotation and scaling transformations from the same geometry record.
If geometry data is not present, then the translation values all default to 0.
This record consists of four fields, of which the most common format is as follows:
XYZOrder<spc>Rot1<spc>Rot2<spc>Rot3<nl>
where XYZOrder is an integer indicating the XYZ rotation order (see below), and Rot1, Rot2 and Rot3 are all doubles identifying a rotation, in degrees, about a local axis; which axis is governed by XYZOrder. <spc> is the space character and <nl> is the newline sequence. Note that positive rotation values indicate counter-clockwise rotation, and negative values indicate clockwise rotation.
Note the term "local" when referring to the rotation about an axis; the rotation is dependent upon the current orientation of the cell. For example, if a cell's parent is rotated 90 degrees about the Z-axis, then the local X-axis of all child cells is aligned with the global Y-axis, and the local Y-axis of all child cells is aligned with the global negative X-axis. Note also that rotations are applied after any required translation, but before the scaling transformation, from the same geometry record.
XYZOrder has one of the following values, with the corresponding interpretation:
| Value | X, Y, Z Order |
|---|---|
| 0 | X, then Y, then Z |
| 1 | X, then Z, then Y |
| 2 | Y, then X, then Z |
| 3 | Y, then Z, then X |
| 4 | Z, then X, then Y |
| 5 | Z, then Y, then X |
For example, if the XYZ order is 3, then a rotation of Rot1 is applied to the Y-axis, Rot2 to the Z-axis and Rot3 to the X-axis. These rotations are applied in the order indicated, with the cell's local orientation changing with each.
If geometry data is not present, then the XYZ order defaults to 0 (X, then Y, then Z) and the rotations all default to 0.0 degrees.
This record consists of three fields, of which the most common format is as follows:
<spc><spc>XScale<spc>YScale<spc>ZScale<nl>
where XScale is a double containing the local X-axis scaling, YScale is a double containing the local Y-axis scaling, ZScale is a double containing the local Z-axis scaling, <spc> is the space character and <nl> is the newline sequence.
The specified scaling is applied, as a multiplier, to all dimensions along the corresponding local axis.
If geometry data is not present, then the scaling values all default to 1. Scaling transformations are applied after all translation and rotation transformations from the same geometry record.
In the following example, a cell is translated such that it's local origin occupies the global co-ordinates (3.5, -2.0, -10.0), rotated such that the local X-axis is aligned with the global Y-axis and scaled so that the length of the object is changed by a factor of 4.2 - assuming that no parent object applies any geometry translations.
3.6 -2.0 -10.0 0 0.0 0.0 90.0 4.2 1.0 1.0
Arcs require the following parameters, typically formatted as follows:
Radius<spc>StartAngle<spc>EndAngle<nl>
where Radius is a double defining the radius of the arc, StartAngle is a double containing the angle, in degrees, between the local X-axis and the start of the arc, EndAngle is a double containing the angle, in degrees, between the local X-axis and the end of the arc, <spc> is the space character and <nl> is the newline sequence.
Arcs are drawn, counter-clockwise from the start angle to the end angle, on the local X-Y plane. In wireframe mode, an arc is drawn as a fragment of a circular circumference; in solid mode, an arc is drawn as a wedge (acute angles) or like a cheese round with a wedge cut out (obtuse angles). In both cases, the arc's local origin is at centre of the circle of which it is a fragment.
Arcs exist as either coarse arcs or fine arcs; the former are drawn with fewer triangles (or arc-sections, if drawn as a wireframe) than the latter. With the introduction of VR Graphics (using the OpenInventor scene graph rendering engine), ACE creates all new arcs as fine arcs and converts coarse arcs to fine arcs during the read process.
There is one special case: an arc that has a start angle of 0 and an end angle of 360 is a Circle.
With the introduction of the OpenInventor scene graph rendering engine into AutoMod/ACE, the default compiled picture format was changed to be an embedded Inventor file. This format is also used to embed other "foreign" format graphics files, such as VRML, into a cell file.
The format for the type-specific parameters is as follows:
[FileLine<nl> [...]] #Inventor END<nl>
where FileLine is a line of source from a supported, embedded, 3D image file and <nl> is the newline sequence. Multiple lines may be read until the #Inventor END tag is read. Note that this tag is used even if the file is not an Inventor format file.
Care must be taken to ensure that the #Inventor END tag is not contained within the body of the embedded file.
Cones require the following parameters, typically formatted as follows:
Radius<spc>Height<spc>XOffset<spc>YOffset<nl>
where Radius is a double defining the radius of the base of the cone, Height is a double defining the distance, measured along the local Z-axis, between the base and the tip of the cone, XOffset is a double containing an offset from the X-axis local origin for the tip of the cone, YOffset is a double containing an offset from the Y-axis local origin for the tip of the cone, <spc> is the space character and <nl> is the newline sequence.
Cones are drawn with their base on the local X-Y plane, with the cell origin used as the center of the base, and the cone extending up along the local Z-axis.
Cylinders require the following parameters, typically formatted as follows:
Radius<spc>Height<spc>XOffset<spc>YOffset<nl>
where Radius is a double defining the radius of the cylinder, Height is a double defining the distance, measured along the local Z-axis, between the base and the top of the cylinder, XOffset is a double containing an offset from the X-axis local origin for the top of the cylinder, YOffset is a double containing an offset from the Y-axis local origin for the top of the cylinder, <spc> is the space character and <nl> is the newline sequence.
Cylinders are drawn with their base on the local X-Y plane, with the cell origin used as the center of the base, and the cylinder extending up along the local Z-axis.
A file reference identifies the location of a supported, 3D graphics file on a local or networked storage device; the file is read in and processed when the cell file is loaded. The following type-specific parameters are required, typically formatted as follows:
FilePath<nl>
where FilePath is the name, including an absolute or relative path, to the file referenced and <nl> is the newline sequence. If a relative path is used, then the search starts from the current directory.
The POSIX path separator character "/" can be used in place of the Windows path separator "\"; since it is more portable, the POSIX separator is preferred.
Note that the file path cannot contain any whitespace characters; such characters will cause the filename to be parsed as more than one token; the first token only will be used as the file path with the second token being taken as the cell type of the next cell entity.
The file's contents will be positioned such that the file's X, Y and Z axes align with the file reference's local axes and the file's origin will be placed at the file reference's origin.
Note that if the referenced file is in a format that follows the left-hand-rule for geometry, then an appropriate geometry adjustment must be made for the image to be loaded correctly; the simplest is for the file reference to define a 90 degree rotation about the X-axis.
A referenced file is only included in the image when it is referenced by an instance element. The file reference cell element itself is included within the first instance cell element that references it; file references cannot be included within a set and are not included in the member count of the set that contains the first instance.
It is recommended that file references be assigned a unique name, to avoid unexpected behavior during dereferencing.
Instances are used to include the contents of a definition (either a block definition or a file reference). The following type-specific parameters are required, typically formatted as follows:
DefinitionName<nl> [DefinitionCellDefinition]
where DefinitionName is the name of the definition to be included, DefinitionCellDefinition is the definition cell being referenced (if not previously defined, see later) and <nl> is the newline sequence.
The contents of the referenced definition are included using the instance's geometry, with the definition's origin being placed at the instance's origin, etc. Any inherited colors within the definition are satisfied from the instance also.
If the definition has yet to be read from the cell file, that is, if there is no definition currently defined which is named DefinitionName, then the definition must follow immediately after the first instance's type-specific parameters. Note that the definition is not included in the member count of the parent set.
Conic frustums require the following parameters, typically formatted as follows:
BaseRadius<spc>TopRadius<spc>Height<spc>XOffset<spc>YOffset<nl>
where BaseRadius is a double defining the radius of the base of the frustum, TopRadius is a double defining the radius of the top of the frustum, Height is a double defining the distance, measured along the local Z-axis, between the base and the top of the frustum, XOffset is a double containing an offset from the X-axis local origin for the top of the frustum, YOffset is a double containing an offset from the Y-axis local origin for the top of the frustum, <spc> is the space character and <nl> is the newline sequence.
Frustums are drawn with their base on the local X-Y plane, with the cell origin used as the center of the base, and the frustum extending up along the local Z-axis.
Hemispheres require the following parameters, typically formatted as follows:
Radius<nl>
where Radius is a double defining the radius of the hemisphere and <nl> is the newline sequence.
Hemispheres are drawn with their base on the local X-Y plane, with the cell origin used as the center of the base, and the hemisphere extending up along the local Z-axis.
Polyhedra require the following parameters, typically formatted as follows:
NumVertices<nl> [VertexX<spc>VertexY<spc>VertexZ<nl> [...]] NumFaces<nl> [VerticesInFace[<spc>VertexIndex[<spc>...]]<nl> [...]]
where NumVertices is an integer defining the number of vertices making up the polyhedron, VertexX is a double defining a local X co-ordinate for a vertex, VertexY is a double defining a local Y co-ordinate for a vertex, VertexZ is a double defining a local Z co-ordinate for a vertex, NumFaces is an integer defining the number of faces making up the polyhedron, VertexIndex is an integer identifying the index of a previously defined point, <spc> is the space character and <nl> is the newline sequence.
Each polyhedron is constructed from a number of faces. Each face is visible from a single side only, depending upon the face's normal vector, and is made up of three or more vertices. The constituent vertices must all lie in the same plane, although ACE does not object if they are not. Furthermore, the vertices must be listed in anti-clockwise order when viewing the intended visible side of the face.
Each vertex is defined as a point made up of an X, Y and Z co-ordinate. These are defined first and are numbered from 0 through to NumVertices - 1. The number of vertex definitions must match the NumVertices parameter. When defining each face, the number of vertices in that face is defined followed by that many vertex indices.
For example, the following defines the parameters for a square polyhedron that is visible from above and below (it requires two faces to do this):
4 0.0 0.0 0.0 1.0 0.0 0.0 1.0 1.0 0.0 0.0 1.0 0.0 2 4 0 1 2 3 4 0 3 2 1
All vertex co-ordinates are relative to the polyhedron's local axes.
Rectangles require the following parameters, typically formatted as follows:
Width<spc>Length<spc>XOffset<spc>YOffset<nl>
where Width is a double defining the width (local Y-axis dimension) of the rectangle, Length is a double defining the length (local X-axis dimension) of the rectangle, XOffset is a double that is required but ignored, YOffset is a double that is required but ignored, <spc> is the space character and <nl> is the newline sequence.
Note that ACE, for reasons unknown, generally mixes up the terms width and length, so that a cell's width is called its length and vice versa, confusing many users. In this document, at the risk of further confusion to ACE users, the terms width and height are used with their more natural definitions.
Rectangles are drawn on the local X-Y plane, with the cell origin used as the center of the rectangle. The rectangle has an upper and lower face and is visible from both sides.
Sets, and block definitions, require the following parameters, typically formatted as follows:
NumChildren<nl> [ChildCellDefinition [...]]
where NumChildren is an integer containing the number of child cells belonging to the set, ChildCellDefinition is a complete cell definition for a child cell and <nl> is the newline sequence.
The number of child cell definitions must match the NumChildren parameter.
Note that NumChildren excludes block definitions, file references and any children belonging to child sets.
Since sets contain the definitions of their child sets, and since child sets can themselves have child sets, it can be seen that the inclusion of sets gives cell files a hierarchical structure.
For a discussion of Root Sets and Main Sets, refer to the notes with the section on general file structure.
Tetrahedra require the following parameters, typically formatted as follows:
BaseLength<spc>TopLength<spc>Height<spc>XOffset<spc>YOffset<nl>
where BaseLength is a double defining the side length of the base equilateral triangle, TopLength is a double defining the side length of the top equilateral triangle, Height is a double defining the distance, measured along the local Z-axis, between the base and the top of the tetrahedron, XOffset is a double containing an offset from the X-axis local origin for the top of the tetrahedron, YOffset is a double containing an offset from the Y-axis local origin for the top of the tetrahedron, <spc> is the space character and <nl> is the newline sequence.
Tetrahedra are drawn with their base on the local X-Y plane, with the cell origin used as the center of the base, and each tetrahedron extending up along the local Z-axis.
Text cells require the following parameters, which have to be formatted as follows:
Text<nl>
where Text is a text string containing the text to be displayed and <nl> is the newline sequence.
Text, which is delimited by the previous line's newline sequence and the newline sequence at the end of this text line (i.e. each text field must be on a line by itself), can contain spaces, but no other whitespace or control characters. Furthermore only 7-bit ASCII characters are processed; 8-bit characters have their 8th bit stripped during a read operation.
Note that the VR Graphics versions of ACE do not appear to support empty text fields.
There are a number of different types of text, as follows:
| Type | Meaning |
|---|---|
| World | Text is drawn on the local X-Y plane using a 3D font; the cell's origin defines the bottom-left-hand-corner of the first character cell with the text itself displayed to the right of this point, along the local X-axis. By default, each line of text is 1 model distance unit in height. Character width varies according to the specific character and the selected font, making it difficult to exert control over the exact appearance of such text. Text height and width can be adjusted by the scaling parameters. |
| Screen Fast | Text is drawn relative to the dimensions of the window in which the image is displayed, using a screen font. The screen is mapped to absolute co-ordinates of -100 to 100 in both the X and Y dimensions, such that the absolute co-ordinate (-50, 50) identifies a point in the middle of the top-left-hand quadrant of the screen. The absolute X-Y co-ordinates of the cell therefore map to a point on the screen marking the bottom-left-hand-corner of the first character cell with the text itself displayed to the right of this point, along the screen's X-axis. The height and width of the the text is fixed and is not expressed as a percentage of the screen's physical height and width; text height and width is also unaffected by the scaling parameters. Because of the better control over formatting, Screen Normal text should be used in preference to Screen Fast. |
| Screen Normal | This is essentially the same as Screen Fast text, except that the text is displayed using a 3D font, providing better control over text appearance. Unit text height is approximately 1.25% of the screen height, with unit text width scaled according to the specific character, the selected font and the screen width. Text height and width can be adjusted by the scaling parameters. |
| Unrotate Fast | Text is drawn on the screen's X-Y plane using a screen font. The absolute X-Y co-ordinates of the cell defines the bottom-left-hand-corner of the first character cell with the text itself to the right of this point, along the screen's X-axis; consequently, the text appears not to rotate when the image is rotated and always faces the user. The height and width of the the text is fixed and is not expressed as a percentage of the screen's physical height and width; text height and width is also unaffected by the scaling parameters. Because of better overall appearance, Unrotate Fast text should be used in preference to Unrotate Normal. |
| Unrotate Normal | This is essentially the same as Unrotate Fast text, except that the text is displayed using a 3D font. By default, each line of text is 1 model distance unit in height. Character width varies according to the specific character and the selected font, making it difficult to exert control over the exact appearance of such text. Text height and width can be adjusted by the scaling parameters. |
Note that Text Lists are not supported in VR Graphics versions of ACE; attempting to read a cell file containing a Text List primitive into such a version will result in errors. However, Text Lists are still supported by the Standard Graphics versions.
Since this feature now seems to be deprecated, and since it causes problems for newer versions, it is recommended that you avoid the use of Text Lists; use the Text primitive instead.
Text List cells require the following parameters, which have to be formatted as follows:
NumItems<nl> [XTranslate<spc>YTranslate<spc>ZTranslate<nl> Text<nl> [...]]
where NumItems is an integer containing the number of items in the text list, XTranslate, YTranslate and ZTranslate are the X, Y and Z translations, for each item, applied after the cell's standard geometry, Text is a text string containing the text belonging to each item, <spc> and <nl> is the newline sequence.
Text, which is delimited by the newline sequence following each item's translation parameters and the newline sequence at the end of the text line (i.e. each text field must be on a line by itself), can contain spaces, but no other whitespace or control characters. Furthermore only 7-bit ASCII characters are processed; 8-bit characters have their 8th bit stripped during a read operation. It is not possible to have an empty text string!
There are a number of different types of text (see Text for more information), but all items in a text list are displayed in the same way.
Trapezoids require the following parameters, typically formatted as follows:
BaseWidth<spc>BaseLength<spc>TopWidth<spc>TopLength<spc>Height<spc>XOffset<spc>YOffset<nl>
where BaseWidth is a double defining the width (local Y-axis dimension) of the base of the trapezoid, BaseLength is a double defining the length (local X-axis dimension) of the base of the trapezoid, TopWidth is a double defining the width of the top of the trapezoid, TopLength is a double defining the length of the of top of the trapezoid, Height is a double defining the distance, measured along the local Z-axis, between the base and the top of the trapezoid, XOffset is a double containing an offset from the X-axis local origin for the top of the trapezoid, YOffset is a double containing an offset from the Y-axis local origin for the top of the trapezoid, <spc> is the space character and <nl> is the newline sequence.
Note that ACE, for reasons unknown, generally mixes up the terms width and length, so that a cell's width is called its length and vice versa, confusing many users. In this document, at the risk of further confusion to ACE users, the terms width and height are used with their more natural definitions.
Trapezoids are drawn with their base on the local X-Y plane, with the cell origin used as the center of the base, and each trapezoid extending up along the local Z-axis.
There is one special case: a trapezoid whose base and top lengths are equal, and whose base and top widths are equal, is a Box.
A triad, which merely displays the orientation of the local axes and the position of the local origin, has a single integer parameter whose purpose is unknown. This typically has the value 1 and is formatted as follows:
Unknown<nl>
where Unknown is an integer and <nl> is the newline sequence.
Current speculation on the purpose of Unknown is that it is a visibility flag: if the value is 0, then the triad is not displayed; any other value and it is displayed, with no noticeable change in appearance. Furthermore, any non-zero value is converted to 1 when ACE next writes the file.
Vector lists require the following parameters, typically formatted as follows:
NumVertices<nl> [VertexX<spc>VertexY<spc>VertexZ<spc>MoveDrawFlag<nl> [...]]
where NumVertices is an integer defining the number of vertices making up the vector list, VertexX is a double defining a local X co-ordinate for a vertex, VertexY is a double defining a local Y co-ordinate for a vertex, VertexZ is a double defining a local Z co-ordinate for a vertex, MoveDrawFlag is an integer indicating whether a straight line should be drawn from the previous vertex to the current vertex (1) or not (0), <spc> is the space character and <nl> is the newline sequence.
Each vector list, analogous to a Polyline in AutoCAD, is made up of a number of vertices linked by straight lines.
Each vertex is defined as a point made up of an X, Y and Z co-ordinate and a move-draw flag. The MoveDrawFlag of the first vertex must be 0 (move). The number of vertices defined must match the value of the NumVerticesparameter.
For example, the following defines the parameters for a vector list that appears as a square:
5 0.0 0.0 0.0 0 1.0 0.0 0.0 1 1.0 1.0 0.0 1 0.0 1.0 0.0 1 0.0 0.0 0.0 1
All vertex co-ordinates are relative to the vector list's local axes.