A small, self-contained, liberally-licensed, high-quality polygon triangulator in C and Javascript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore final changes before first release Feb 2, 2013
LICENSE final changes before first release Feb 2, 2013
Makefile
README.md update tessellate to latest emscripten version, which works without p… Mar 1, 2014
_begin.js tweak _begin and _end to pass this into inner function, so target of … Mar 1, 2014
_end.js tweak _begin and _end to pass this into inner function, so target of … Mar 1, 2014
_middle.js Module was still being leaked :( fixed now Mar 1, 2014
_tessellate.js
dict-list.h
dict.c first Feb 2, 2013
dict.h
geom.c
geom.h
glu.h
gluos.h first Feb 2, 2013
index.html I hate typos perpetuated by autocomplete Mar 1, 2014
main.c fix triangle strip handling Feb 2, 2013
memalloc.c
memalloc.h first Feb 2, 2013
mesh.c
mesh.h first Feb 2, 2013
no_globals.html I hate typos perpetuated by autocomplete Mar 1, 2014
normal.c first Feb 2, 2013
normal.h
priorityq-heap.c first Feb 2, 2013
priorityq-heap.h
priorityq-sort.h first Feb 2, 2013
priorityq.c
priorityq.h first Feb 2, 2013
render.c first Feb 2, 2013
render.h
sweep.c first Feb 2, 2013
sweep.h
tess.c first Feb 2, 2013
tess.h
tessellate.c
tessellate.h first Feb 2, 2013
tessellate.js
tessellate_api.js I hate typos perpetuated by autocomplete Mar 1, 2014
tessmono.c
tessmono.h first Feb 2, 2013

README.md

A minimal, self-contained port of SGI's GLU libtess

Polygon tessellation is a major pain in the neck. Have you ever tried writing fast and robust code for it? libtess is, to my knowledge, the only GPL-compatible, liberally-licensed, high-quality polygon triangulator out there.

This repository includes a self-contained function (tessellate, in tessellate.c) that you can call to triangulate a polygon that is potentially self-intersecting, with holes, or with duplicate vertices. Simple examples of calling the tessellate function directly are located in main.c.

tessellate.js

More interestingly, this repository also includes an Emscripten-compiled module, _tessellate.js, and a Javascript-friendly wrapper, in tessellate.js. Simple examples are available under index.html. tessellate.js is AMD-friendly, and won't pollute your global namespace if it thinks it sees RequireJS.