github.com/Botffy/polyskel

Straight skeleton implementation in Python

Open this visualization on its own page →

Contributors

3

Lines of Code

90

From

2015-06-08

To

2020-10-12

About Botffy/polyskel

Polyskel is a Python implementation of the straight skeleton algorithm, a computational geometry technique that computes a skeleton structure from polygon input. The algorithm was originally described in a 1998 paper by Felkel and Obdržálek and creates a tree structure representing the medial axis of the input polygon, which has applications in areas like architecture and geography.

The implementation acknowledges its own limitations, as the original algorithm is known to have issues with certain edge cases, though it performs reasonably well on real-world inputs like country contours and floor plans. The library uses the euclid3 library for geometric computations and includes a demo tool that visualizes the skeleton output as an image alongside the input polygon. Users can specify polygons and holes in a text file format, with options for verbose logging and step-by-step visualization during computation.

The project has inspired several ports to other platforms and languages, including a Swift version and a Blender plugin that generates roof structures, indicating its utility in practical applications despite the acknowledged algorithmic limitations.

Share this video