The GTS Library
GTS logo


Getting GTS
        Debian packages
        Sample files
        Python bindings
        Darcs repository
        Daily snapshots

Mailing Lists
Sourceforge page

    GTS in action

    GTS Reference
    GLib Reference
    Installation instructions

Help needed
    Bug tracking
    Contribution instructions

    Projects using GTS

GTS is hosted by

GTS stands for the GNU Triangulated Surface Library. It is an Open Source Free Software Library intended to provide a set of useful functions to deal with 3D surfaces meshed with interconnected triangles. The source code is available free of charge under the Free Software LGPL license.

The code is written entirely in C with an object-oriented approach based mostly on the design of GTK+. Careful attention is paid to performance related issues as the initial goal of GTS is to provide a simple and efficient library to scientists dealing with 3D computational surface meshes.

A brief summary of its main features:

  • Simple object-oriented structure giving easy access to topological properties.
  • 2D dynamic Delaunay and constrained Delaunay triangulations.
  • Robust geometric predicates (orientation, in circle) using fast adaptive floating point arithmetic (adapted from the fine work of Jonathan R. Shewchuk).
  • Robust set operations on surfaces (union, intersection, difference).
  • Surface refinement and coarsening (multiresolution models).
  • Dynamic view-independent continuous level-of-detail.
  • Preliminary support for view-dependent level-of-detail.
  • Bounding-boxes trees and Kd-trees for efficient point location and collision/intersection detection.
  • Graph operations: traversal, graph partitioning.
  • Metric operations (area, volume, curvature ...).
  • Triangle strips generation for fast rendering.

The screenshots will give you an idea of what GTS can do. You can read the reference manual for more information.

Help would be very appreciated and you are very welcome to contribute.


Release 0.7.6
steph - March 29th 2006

Important changes:

  • Debian snapshot package creation.
  • LC_ALL is set to POSIX in all executables to avoid problems with locale-dependent floating-point conventions.

Release 0.7.4
steph - October 17th 2005

Important changes:

  • Switched to darcs for version control (the CVS tree is obsolete).
Bug Fixes:
  • For constrained Delaunay, closest face for glib >= 2.4 did not use planar distance.
  • Several fixes for gts_delaunay_add_constraint.
  • Fix for degenerate case in isotetra_bcl().
  • Fix for comments not being fully ignored by GtsFile.
Minor changes and features:
  • delaunay and happrox are installed.
  • Fast triangle-box intersection test by Tomas Akenine-Moller.
  • New function gts_triangle_interpolate_height().
  • binary STL files work on win32.

Release 0.7.3
steph - October 18th 2004

New features/important changes include:

  • Autodetection and support for glib >= 2.4 (but glib >= 1.2.8 is still supported): glib >= 2.0 and < 2.4 is not supported (send me patches!).
  • pkgconfig preliminary support.
  • Mingwin support.
  • Changes to the interface of gts_graph_read().
Bug fixes:
  • Constrained Delaunay Triangulation guess selection.
  • Boolean operations: Now uses SOS for segment/triangle intersections.

Release 0.7.2
steph - May 15th 2004

New features includes:

  • gts2dxf and gts2stl filters.
  • New GtsColorVertex class.
  • "Dual" isosurface calculation by Tim F.
  • New "happrox" algorithm to approximate terrain models.
  • New GtsMatrix implementation (quaternions) by Wayne Gramlich and Michael Loehr.
  • Attributes inheritance when computing intersections.
Bug fixes:
  • Major changes to inner loops triangulation for boolean operations.
  • Compilation on SGI Altix
  • Fixed gts.def generation for Windows support.
  • Cygwin support.

Release 0.7.1
steph - January 8th 2003

New features includes:

  • Sphere tessellation by Jerome Benoit.

As well as a number of bug and compilation fixes.

The interface to the gts_surface_refine() function has been made more generic.

Release 0.7.0
steph - November 8th 2002

I consider this new release to be a major step forward with a new very robust implementation of boolean operations as well as several very interesting contributions from other people: marching tetrahedra for isosurface extraction (Gert Wollny) and differential geometry operators (Ray Jones) in particular. Thanks to all people who contributed, reported bugs etc... A summary of the most significant changes follows:

Boolean operations have been almost entirely rewritten and now use a Simulation of Simplicity (SoS) technique to deal with degenerate cases. This should fix most of the problems encountered when dealing with "simple" geometric objects (i.e. cube/cube intersections with coplanar faces etc...) Almost all the test cases in the test suite (including significant tests submitted by users) now pass. Difficult test cases like an object intersecting with a simplified version of itself (created using coarsen for example) work fine despite the huge number of degenerate cases (coincident and nearly coincident edges, faces, vertices).

There is still a caveat however for intersections which creates multiple closed loops contained within one another (note that this was not a problem in the previous version). This needs to be fixed at some point.

Another problem is that the surfaces resulting from a boolean operation while guaranteed to be topologically consistent may contain degenerate edges/faces which will prevent them from being used in a subsequent boolean operation. The degenerate entities need first to be eliminated (through edge/face collapse).

The gts_point_is_inside_surface() function has been rewritten using SoS.

A new stl2gts tool provides conversion between STL (stereolithography) format and GTS format.

Ray Jones has added new functions to compute gaussian curvature, principal curvature directions etc...

The gts_file_close() function call has been replaced by a gts_file_destroy() function which does not close the file. This is better left to the caller. Your application might need a slight modification there.

The whole automake/autoconf stuff has been upgraded to use version 1.6.3 of automake.

Gert Wollny has added a marching tetrahedra isosurface construction technique which should avoid topological defects in isosurfaces (created by inconsistencies inherent to the marching cube technique).

A number of bugs have been fixed (thanks to bug reporters).

Release 0.6.0
steph - June 18th 2002

In this version, all the input functions are using a new structure (GtsFile) which fixes the problem of reporting syntax errors when reading input files. A detailed message describing the location (line, column) and the type of error can now be easily set. All the read() methods of the library classes now use this mechanism which gives far clearer error reporting.

This comes at a cost however and a number of input functions (gts_surface_read() etc...) have changed interface. Using the examples/ it should be easy to port your code though.

Other significant changes include:

  • New gts_surface_refine() syntax: allows for more generic cost functions.
  • New gtscheck executable: checks for topologically incorrect surfaces using in particular the new function gts_surface_is_self_intersecting(). You should use this program before trying to do any boolean operations with your surfaces.
  • src/: gts.h, partition.c: Bisection algorithms now takes an extra "imbalance" argument which allows some control over the weight balancing of the partition.
  • src/cdt.c: Checks for degenerate triangles when looking for root of the search (thanks to Mashuda Glencross for reporting this problem).
  • tools/gtstemplate: for generation of a template used to create new object classes.
Plus a large number of small (and not so small) bug fixes (thanks to all the peole who reported bugs, their names are listed in the THANKS file).

A simple Open GL/Gtk viewer for GTS surfaces and progressive surfaces
steph - February 4th 2002

The initial version of gtsview, a simple viewer for GTS surfaces and progressive surfaces is available. It demonstrates the use of progressive surfaces for level of detail visualization of triangulated surfaces.

Latest release is 0.5.1
steph - November 12th 2001

Configuration and compilation have been cleaned and updated. Now builds both shared and static libraries.

A new "gts-config" script allows simpler use of the library (a la glib), together with a gts.m4 macro definition for your own autoconf usage.

A number of new features have been added:

  • Configurable out-of-core simplification framework for surfaces larger than the main memory.
  • Conforming constrained Delaunay triangulation and Delaunay refinement by addition of Steiner points.
  • Simple implementation of FIFOs (First-In First-out queues).
  • New graph objects and operations on graphs. In particular efficient graph partitioning routines.
  • "Stabbing" functions have been added to bounding box trees, which now allows for efficient testing whether a point lies inside or outside a surface.

A number of bug fixes and improvements have also been added:

  • More generic object methods for surfaces.
  • Easily definable inheritance of face attributes (in particular for boolean operations).
  • Bug fixes for boolean operations.
  • The srf2oogl converter has been renamed to gts2oogl and an "isolines" functionality was added.
Please check the reference manual for more information.

Release 0.4.0 is out!
steph - January 31th 2001

I finally found the time to clean up all the stuff I wanted. Much has happened since 0.3.0. A new object structure inspired by GTK allows to use classical inheritance mechanisms and virtual functions. As a consequence the object hierarchy has been restructured and now uses points, vertices, segments, edges, triangles, faces and surfaces.

The Delaunay triangulation has been entirely re-written and is now fully-dynamic (insertion or deletion of vertices). The constrained Delaunay triangulation is semi-dynamic (insertion of vertices and constraints).

Boolean operations between surfaces have also been re-written and are more robust (and also benefit from a much more robust implementation of the Delaunay triangulation).

Surface coarsening routines have been improved both in term of a more generic interface and in order to avoid artefacts such as folds in the simplified surface.

An interesting new extension is the implementation of progressive surfaces which allow dynamic real-time continuous level-of-detail representation of a surface. Progressive transmission of surfaces is also possible. The first building blocks for a hierarchical surface extension have been written. This will allow for dynamic view-dependent simplification of surfaces.

The floating-point control interface necessary for robust geometric predicates has been cleaned and GTS should now build on any (touch wood) UNIX-based machine.

Preliminary support has been added for win32 compilation using Microsoft C.

Please note that the html reference manual is now distributed with the sources.

New release available for download
steph - July 24th 2000

I am glad to announce that version 0.3.0 of GTS is available for download. New features include isosurface computation from 3D functions and the "memoryless simplification" algorithm of Lindstrom and Turk for mesh decimation (in the bibliography). The new screenshots and manual should give you an idea of what this is about. More to come soon.

The main API change you will have to deal with is that GTS now uses GSList instead of GList everywhere. It allows to save something like 30% of memory usage for a typical surface.

A few examples of how to use GTS are now included with the distribution.

New models are also available from the samples page.

Web site updated and new examples sources
steph - February 29th 2000

This section "News" is up and running! A new section "Bibliography" is also available. This is a collection of articles with links relevant to the design of GTS.

Due to popular demand, a new examples directory has been created in the source tree. Only a few basic examples are available for the moment including: set operations on a pair of input files, volume computation, cleaning procedure for "dirty" input files and triangle decimation. These will be included in the next tarball release.

Please send any comments about this site to popinet at users dot sourceforge dot net.