This is a utility for handling GoCAD data. GoCAD has a number of possible file extensions and data types contained within those files. One file may contain multiple data sets. In addition, a file with a specific extension need not only contain data of the type that the extension suggests.

At the moment, this utility can read:

  • VSET (Voxel Set)
  • PLINE (Polyline)
  • TSURF (Triangulated Surfaces)

Expected file extensions for these data types include .vs,.pl, .ts, and.mx (the last one for mixed data).

Another data type, SGrid (Structured Grid, usually saved to .sg files) can be converted via the GoCadSGridReader.

Parsers for additional GOCAD-datasets may be added in the future.


   GocadTSurfaceReader  -i <filename.ts> -o <output dir> [-l] [-s] [-b]
                        [--] [--version] [-h]


   -i <filename.ts>,  --input-file <filename.ts>
     (required)  Gocad triangular surfaces file (*.ts)

   -o <output dir>,  --output-dir <output dir>
     (required)  output directory

   -l,  --lines-only
     if set, only PLine datasets will be parsed from the input file

   -s,  --surfaces-only
     if set, only TSurf datasets will be parsed from the input file

   -b,  --write-binary
     if set, OGS-Meshes will be written in binary format

Unless specified otherwise, the utility will convert all datasets and write them to the specified output directory. Using the flags -l and -s, conversion can be limited to lines or surfaces, respectively. Datasets will usually have a name specified. This name is used for the output file. If no name is given, the file name will be used instead. Should multiple datasets have the same name (which is possible in GoCAD), a mesh-ID will be added to the file name. This ID has no function except to allow the writing of multiple datasets with the same name into the same directory.

Datasets may have additional scalar data assigned to nodes. If so, this data is also added to the output data.

Simple example


GocadTSurfaceReader -i d:\GoCAD_data\Top-Lower_Sandy.ts -o d:\GoCAD_data


GoCAD-Header of file containing triangulated surface.


Converted surface
Converted surface visualised in ParaView with scalar data added to nodes.

This article was written by Karsten Rink. If you are missing something or you find an error please let us know.
Generated with Hugo 0.117.0 in CI job 362666 | Last revision: July 12, 2023
Commit: [PL/SSD] Rename x_dot to x_prev 04a8fec8  | Edit this page on