GithubHelp home page GithubHelp logo

davidkvc / libtessdotnet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from speps/libtessdotnet

0.0 1.0 0.0 1.57 MB

C# port of the famous GLU Tessellator - prebuilt binaries now available in "releases" tab

License: Other

Batchfile 0.42% C# 99.58%

libtessdotnet's Introduction

LibTessDotNet Build Status

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
  • Single/Double precision support

Screenshot

Redbook winding example

Comparison

Benchmarks

Notes

  • When using ElementType.BoundaryContours, Tess.Elements will contain a list of ranges [startVertexIndex, vertexCount]. Those ranges are to used with Tess.Vertices.

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

libtessdotnet's People

Contributors

speps avatar chrisdenham avatar ncruces avatar

Watchers

David avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.