G# main feature overview

G# comprises over 300 methods in over 15000 lines of code. The most important are:

Terrain modelling

  • High performance point set triangulation in O(n·log(n)) time
  • Conforming and constraint Delaunay triangulations
  • Constraint (breakline) insertion
  • Boundary, hole and island triangulation
  • Contour and profile lines
  • Surface slice
  • Projection of lines and point onto the surface
  • Surface reconstruction from wireframe edges in O(n·log(n)) time


  • Fast O(n·log(n)) creation of a fully referenced mesh from unordered triangles.
  • Full adjacency information.
  • Boundary edge identification.
  • Edge collapse.
  • Level of detail (LOD): triangles that least affect the shape of the surface are removed first.

Bounding objects

  • 2d convex hulls in O(n·log(n)) time
  • 3d convex hulls in O(n·log(n)) time
  • Minimum area bounding rectangles in O(n·log(n)) time
  • Minimum perimeter bounding rectangles in O(n·log(n)) time
  • Point set width and diameter in O(n·log(n)) time
  • Minimum enclosing circes in O(n·log(n)) time
  • Principal axes bounding boxes in O(n·log(n)) time

Polylines and polygons

  • Polyline construction from unordered edges in O(n·log(n)) time
  • Exact arithmetic point-in-polygon test
  • Exact arithmetic polygon-in-polygon test

Exact arithmetic and predicates

  • Exact arithmetic 2d orientation (point left/right of line)
  • Exact arithmetic 3d orientation (point above/below of plane)
  • Exact arithmetic XY (2d) point-in-triangle test
  • Exact arithmetic triangle orientation test
  • Exact arithmetic XY (2d) edge-edge intersection test
  • Floating point arithmtic 2d orientation (point left/right of line)
  • Floating point arithmetic 3d orientation (point above/below of plane)
  • Floating point arithmetic point-in-triangle test
  • Floating point arithmetic point-in-circle test


  • Stereolithography (STL) ASCII input / output
  • Stereolithography (STL) binary input / output
  • Object file format (OFF) input