Exporting

An export involves writing data from your working packet tree into some foreign file format. For most formats you can only export small pieces of your packet tree at a time (such as individual triangulations). All exports are done through the FileExport menu.

When you select an action from the FileExport menu, Regina will ask you which packet to export. For most export formats Regina will only export the selected packet, but for some formats (such as Regina's own data format) it will export an entire packet subtree.

After selecting a packet, you will be asked to choose a filename for your export. Regina will then save the exported data to that file.

Regina can export data to the following file formats:

Regina Data Files

This is Regina's native file format, in which data is saved as compressed XML. Regina can export an entire packet subtree to this format: just choose the root of of the subtree as the packet to export. Regina will export not just the packet you select, but all of the packets beneath it in the tree.

This is a convenient way of extracting a small portion from a larger data file.

The packet that you select for export will become the top-level packet in the new tree (i.e., Regina will not add a new container to the top of the export data file).

There are two menu items for exporting to a Regina data file. If you choose FileExportRegina Data File, the data will be exported as compressed XML (the standard file format). If you choose FileExportRegina Data File (Uncompressed), the data will be saved as plain XML (which means you can view the XML in your favourite text editor). Regina is capable of reading data files in either compressed or uncompressed format.

If you simply want to view the raw XML content of an existing data file, you do not need to go to the trouble of exporting it in uncompressed format. Instead you can just pipe the data file through gunzip:

    example$ cat file.rga | gunzip

SnapPea Triangulations

You can export a triangulation to SnapPea's native file format. This is a plain text format, described in more detail in the section on SnapPea imports.

Not every data file can be exported to SnapPea format. For instance, the triangulation cannot be invalid, and it may not have any boundary faces. Regina will tell you if your triangulation cannot be exported.

Any international characters in the exported SnapPea file will be encoded using UTF-8.

C++ Source Code

You can export a triangulation as C++ source code. This C++ code will use classes and routines from Regina's calculation engine. When run, this code will reconstruct your triangulation.

Exporting to C++ can be useful if you wish to hard-code a triangulation in your own C++ project. See the separate chapter on building Regina into your own code.

If the triangulation includes any international characters (for instance, in the packet label or the tetrahedron names), these might appear as comments in the exported C++ code. You can choose the text encoding that will be used for these characters (such as UTF-8 or LATIN1). When you select the filename to export to, a drop-down list of encodings should appear in the dialog, as illustrated below.

Spreadsheet-Readable (CSV) Surface Lists

You can export a normal surface list to a plain-text CSV file (comma-separated values), which you can easily import into a spreadsheet or database.

The CSV file will begin with a header row, followed by one line for each normal surface in the list. Surfaces will be exported in standard coordinates (that is, tri-quad coordinates for normal surfaces, or tri-quad-oct coordinates for almost normal surfaces). The fields in the CSV file will mirror the columns that you see in the normal surface coordinate viewer, and will include properties such as Euler characteristic and orientability as well as the surface coordinates themselves.

If any of the surfaces have names that include international characters, these names will be exported in UTF-8.

PDF Documents

You can export a PDF packet to an ordinary PDF document.

If you simply wish to view PDF packets in a different viewer, you do not need to go to the trouble of exporting the packet—instead you can configure Regina's PDF options to use your favourite viewer by default.

Python Scripts

You can export a script packet as a regular Python file. Regina will add a special comment block to the top of the file, describing the packet label and the script variables. This special comment block allows you to import the script seamlessly back into Regina; see Python imports for details.

If the script contains any international characters, you can choose a text encoding to use (such as UTF-8 or LATIN1). A drop-down list of encodings should appear when you choose the filename to export to, as illustrated in C++ exports above.