skillfed

shapely-polyskel

Implementation of the straight skeleton algorithm as described by Felkel and Obdržálek in their 1998 conference paper Straight skeleton implementation.

shapely-polyskel v0.1.2 73.6K downloads/30d#14,975 on PyPI3
Copyleft license GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this… (full text in the JSON record) AGING released

What it is and what it does

shapely-polyskel implements the straight skeleton algorithm, a geometric technique that computes a medial axis—a set of line segments representing the 'skeleton' of a polygon. It is a fork of an earlier implementation and is based on the 1998 Felkel and Obdržálek algorithm. The package works with shapely Polygon objects and accepts polygons with holes, returning skeleton edges, source points, ridges, and sinks.

The algorithm is dated and the implementation does not attempt to fix known correctness issues; it works reasonably well for real-world inputs like country contours and floor plans but may fail on certain edge cases. It depends on shapely for geometry representation and euclid3 for vector math. The package is in beta status with low install friction, though maintenance is aging.

Use it for:

  • Generate roof structures from building footprints or floor plans.
  • Compute medial axes for polygon simplification or offset operations.
  • Analyze country or region contours to extract skeleton features.
  • Create layout networks or centerline representations from polygonal shapes.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Computes the straight skeleton of a polygon, a geometric medial axis useful for floor plans, building contours, and roof generation.

Yes, if you need straight skeleton computation for real-world geometric problems like floor plans or building contours and can tolerate the algorithm's known limitations. No, if you require a modern, fully correct implementation—the author recommends Stefan Huber's research for that. The low install friction and lack of security issues make it safe to try, but verify the algorithm's behavior on your specific inputs first.

Install

shapely-polyskel on PyPI

pip

pip install shapely-polyskel

uv

uv add shapely-polyskel

poetry

poetry add shapely-polyskel

Installing shapely-polyskel

Before you install

Low friction; pure Python wheel with only two runtime dependencies (euclid3 and shapely). Maintenance is aging—last release was 586 days ago and the repository has minimal activity (3 stars), though it remains unarchived and the implementation is acknowledged as dated and imperfect for certain inputs.

License in practice

Licensed under LGPLv3 (copyleft). You may use and modify the package freely, but derivative works and combined distributions must also be licensed under compatible terms and include source code availability.

Quickstart

from shapely_polyskel import skeletonize

rectangle = [(40, 40), (40, 310), (520, 310), (520, 40)]
skeleton = skeletonize(polygon=rectangle)

Requires Python 3.10 or later.

Verify before relying

  • Whether the implementation's known limitations (acknowledged as 'a bit crap' and incorrect for certain polygons) affect your specific use case.
  • Performance characteristics and scalability for large or complex polygons.

Package facts

License GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this… (full text in the JSON record) (copyleft)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — euclid3, shapely
Maintenance aging — 586 days since the last release
Last repo commit
First released
Downloads 73,570/month — #14,975 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: shapely_polyskel-0.1.2-py3-none-any.whl

Keywords: shapely, geometry, polygon, straight skeleton

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)Operating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Topic :: Scientific/Engineering :: GIS

Tags

straight skeleton algorithmpolygon medial axisgeometric skeleton computationfloor plan analysispolygon offset and thinning
computational-geometrypolygon-processing

More GIS packages