Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
C# port of the famous GLU Tessellator - prebuilt binaries now available in "releases" tab
C#
branch: master

README.md

LibTessDotNet

Goal

Provide a robust and fast tessellator (polygons with N vertices in the output) for .NET, also does triangulation.

Requirements

  • .NET framework 2.0 (pure CLR, should work with Mono, Unity or XNA)
  • C# 3.0 compiler if you want to compile (I am guilty of using 'var')
    • WinForms for the testbed
    • Solution file for Visual Studio 2010

Features

  • Tessellate arbitrary complex polygons
    • self-intersecting (see "star-intersect" sample)
    • with coincident vertices (see "clipper" sample)
    • advanced winding rules : even/odd, non zero, positive, negative, |winding| >= 2 (see "redbook-winding" sample)
  • Custom input
    • Custom vertex attributes (eg. UV coordinates) with merging callback
    • Force orientation of input contour (clockwise/counterclockwise, eg. for GIS systems, see "force-winding" sample)
  • Choice of output
    • polygons with N vertices (with N >= 3)
    • connected polygons (didn't quite tried this yet, but should work)
    • boundary only (to have a basic union of two contours)
  • Handles polygons computed with Clipper - an open source freeware polygon clipping library

Screenshot

Redbook winding example

Comparison

Benchmarks

TODO

  • Profile GC allocations
  • Any suggestions are welcome ;)

License

SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) More information in LICENSE.txt.

Links

  • Reference implementation - the original SGI reference implementation
  • libtess2 - Mikko Mononen cleaned up the original GLU tesselator
  • Poly2Tri - another triangulation library for .NET (other ports also available)
    • Does not support polygons from Clipper, more specifically vertices with same coordinates (coincident)
  • Clipper - an open source freeware polygon clipping library
Something went wrong with that request. Please try again.