File Formats

Text File Format for TUMBLE meshes

The TUMBLE text-file format is a file format inspired by the file format used with Jonathan Shewchuk's Triangle. A TUMBLE text-file consists of a quartet of files with respective extentions of: ".bdry", ".node", ",edge", and ".ele". This is the original file format used by the RUBY TUMBLE code, and the only way to load up a mesh file with the older code.

As this is a text file format, there are rounding errors inherent when saving/loading one of these files, and thus, numerical stability will be sacrificed starting an experiment using one of these files. For this reason this file format is depreciated an should only be used for backwards combatability with the RUBY TUMBLE.

Specification

Each TUMBLE text-format file consists of 4 files. Each file is read in a line oriented manner, with each line representing a element of the file. Lines contain data separated by spaces. I will use [int] after an entry to indicate it is an integer value and [float] to indicate a floating point value. A "..." will mean that there is an array of values that is terminated by the end of the line

Node File ".node"

Each node corresponds to a unique point of geometric and functional data pair. Thus each BezierVertex is on a node, and there is also a node internal to each BezierEdge. This is where the geometric and functional data is stored. Each node is numbered with a unique ID.
nodeid[int] x_coord[float] y_coord[float] data0[float] data1[float] ...

Boundary File ".bdry"

The boundary file is the most complicated of the four. It has three sections, where the BoundaryVertexs BoundaryEdges and BoundaryFaces are recorded. The BoundaryVertexes are enumerated with an ID, as are the BoundaryEdges and BoundaryFaces, separately.

The BoundaryVertex section records each BoundaryVertex's ID and the node ID it cooresponds to:

bdry_vertID[int] nodeID[int]

Then there is a separator line with the total number of BoundaryVertexes:

--- num_bdry_verts

Following this is the record of BoundaryEdges. Each BoundaryEdge consists of a triple of lines. The first line contins the ID of the edge and ID of its vertexes, and other data. The restlength parameter at the end of the first line is optional. The second line consists of the x and y coordinates of its deboor points, and the third line consists of its knot values.

bdry_edgeID[int] vert0ID[int] vert1ID[int] closed[int] fixed[int] color[int] <restlength[float]>
deboor0x[float] deboor0y[float] deboor1x[float] deboor1y[float] ...
knot0[float] knot1[float] knot2[float] ...

Then there is a separator line with the total number of BoundaryEdges:

=== num_bdry_edges

Following this are the records of BoundaryFaces. Each BoundaryFace consists of a single line with the unique BoundaryFace ID, the minimum angle for this face, its color, and the IDs of the BoundaryEdges surrounding it.

bdry_faceID[int] min_angle[float] color[int] bdry_edge0ID[int] bdry_edge1ID[int] ...

Edge File ".edge"

Each BezierEdge is numbered with a unique ID. The IDs of its three nodes, as well as the ID of any boundary edge it is on and its u-values along that edge are recorded. The node values of the BezierVertexs are inferred from the edge information in this file.
edgeid[int] node0ID[int] node1ID[int] node2ID[int] bdryedgeID[int] u0[float] u1[float]

Element(BezierTriangle) File ".ele"

This file contains data for each element or BezierTriangle in the mesh. Each triangle is enumerated with a unique ID and records the IDs of its edges, wether it is inverted, and the ID of the BoundaryFace it is in.
triID[int] edge0ID[int] edge1ID[int] edge2ID[int] inverted[int] bdry_faceID[int]

Binary File Format for TUMBLE meshes

The TUMBLE binary file format is the new file format for storing meshes and is the preferred way of saving data. The file format consists of a single binary file with a ".geo" extension. This file format was designed for the following specifications:

Thus, the binary file format was not optimized for space, but instead for the speed in loading/saving as this is the normal bottleneck for I/O in TUMBLE experiments.

Additionally, since all data is stored in binary format, the geometric and functional data at the nodes can be stored exactly, as well as the u-values of BezierVertexs and BezierEdges along the boundary. Furthermore, the implementation will take care to never require a comparison of floating point values when rebuilding a mesh from a binary file. Unfortunately, the text file format required the use of floating point comparisons in the rebuilding process.

When describing the format of the binary file, there are no linebreaks, but the description here will use new-lines in order to visually separate the information. All values are stored as binary in the file. Any string in quotes is a string of ascii charactors that is NOT null terminated. Any other value will be represented as an unsigned(32-bit) or a double(64-bit), as indicated.

Header

To prevent having to break backwards compatibility as TUMBLE evolves, the binary file format has a header which includes a version number. The header format is as follows:
"Tumble Binary Geometry File"
[unsigned format_version_num]

Version 1

At this point version 1 is the only format version in use. What follows is the description of that foramt. In this format their are sections for each of Nodes, BoundaryVertexs, BoundaryEdges, BoundaryFaces, BezierVertexs, BezierEdges, and BezierTriangles. Each section follows directly after the previous and begins with a count of the number of entries in that section.

Node Section

The first section is the listing of nodes which are Point2D, LinearData pairs which contain the geometric and functional data of the mesh at a given point. There is one Node for each BezierVertex and one for the internal point of each BezierEdge. The nodes are enumerated with a unique ID. The first entry of the Node section is the number of nodes:
[unsigned num_nodes]

Each entry of the Nodes section is as follows:

[unsigned nodeID][Point2D pos][unsigned data_size][double[] data]

BoundaryVertex Section

Each BoundaryVertex is enumerated with a unique ID. The first entry of the BoundaryVertex section is the number of BoundaryVertexs:
[unsigned num_bdry_verts]

Each entry of the BoundaryVertex section is as follows:

[unsigned bdry_vertID][unsigned node_num][unsigned fixed]

BoundaryEdge Section

Each BoundaryEdge is enumerated with a unique ID. The first entry of the BoundaryEdge section is the number of BoundaryEdges:
[unsigned num_bdry_edges]

Each entry of the BoundaryEdge section contains the information about that edge and its spline. It is worth noting that the deboor points are stored as nodeID's and that the deboor points cooresponding to the BoundaryVertexs of the edge are not stored, so only the internal deboors are listed.

[unsigned bdry_edgeID][unsigned vertex0ID][unsigned vertex1ID]
[unsigned fixed][unsigned color][double restlength]
[unsigned num_internal_deboor][unsigned[] infernal_deboor_nodeIDs]
[unsigned num_knots][double[] knots]

BoundaryFace Section

Each BoundaryFace is enumerated with a unique ID. The first entry of the BoundaryFace section is the number of BoundaryFaces:
[unsigned num_bdry_faces]

Each entry of the BoundaryFace section is as follows:

[unsigned bdry_faceID][double min_angle][unsigned color][unsigned num_edges][unsigned[] bdry_edgeIDs]

BezierVertex Section

Each BezierVertex is enumerated with a unique ID. The first entry of the BezierVertex section is the number of BezierVertexs:
[unsigned num_bez_verts]

Each entry of the BezierVertex section is as follows, where bdry_type:=(0=none, 1=vert, 2=edge), and bdry_edge_knot_idx is the index of the knot cooresponding to this vertex if this vertex is on a boundary edge.

[unsigned bez_vertID][unsigned node_num][unsigned fixed]
[unsigned bdry_type][unsigned bdryID][unsigned bdry_edge_knot_idx]

BezierEdge Section

Each BezierEdge is enumerated with a unique ID. The first entry of the BezierEdge section is the number of BezierEdges:
[unsigned num_bez_edges]

Each entry of the BezierEdge section is as follows, where v0_knot_idx and v1_knot_idx, are the index numbers of the knots in the BoundaryEdge corresponding the vertexes of the BezierEdge, if this BezierEdge is on the boundary:

[unsigned bez_edgeID][unsigned vertex0ID][unsigned vertex1ID][unsigned center_nodeID]
[unsigned bdry_edgeID][unsigned v0_knot_idx][unsigned v1_knot_idx]

BezierTriangle Section

The first entry of the BezierTriangle section is the number of BezierTriangle:
[unsigned num_bez_tris]

Each entry of the BezierTriangle section is as follows:

[unsigned edge0ID][unsigned edge1ID][unsigned edge2ID][unsigned bdry_faceID]

Experiment File Format for specifying TUMBLE experiments


Generated on Mon May 24 09:53:32 2010 for TUMBLE by  doxygen 1.5.2