Skip to content

Simple polygon triangulation algorithms in pure python

License

Notifications You must be signed in to change notification settings

linuxlewis/tripy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tripy

https://travis-ci.org/linuxlewis/tripy.svg?branch=master

Tripy is a simple module with one purpose: triangulating polygons.

Getting Started

pip install tripy
import tripy
# Polygon can be clockwise or counter-clockwise
polygon = [(0,1), (-1, 0), (0, -1), (1, 0)]
triangles = tripy.earclip(polygon)
print triangles
[((1, 0), (0, 1), (-1, 0)), ((1, 0), (-1, 0), (0, -1))]

Examples

To see examples of tripy in action check out the jupyter notebook examples.ipynb

Roadmap

0.1

  • Support polygons with holes

0.2