Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jsmolka/hull
Concave or convex hull around a list of points.
https://github.com/jsmolka/hull
concave convex hull python
Last synced: 7 days ago
JSON representation
Concave or convex hull around a list of points.
- Host: GitHub
- URL: https://github.com/jsmolka/hull
- Owner: jsmolka
- License: mit
- Created: 2017-07-26T18:23:43.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-08-06T06:48:12.000Z (3 months ago)
- Last Synced: 2024-08-07T03:16:29.479Z (3 months ago)
- Topics: concave, convex, hull, python
- Language: Python
- Homepage:
- Size: 1.37 MB
- Stars: 47
- Watchers: 2
- Forks: 19
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# hull
Concave or convex hull around a list of points.## How to use
```python
import hullpoints = [
(207, 184), (393, 60), (197, 158), (197, 114), (128, 261), (442, 40),
(237, 159), (338, 75), (194, 93), (33, 159), (393, 152), (433, 267),
(324, 141), (384, 183), (273, 165), (250, 257), (423, 198), (227, 68),
(120, 184), (214, 49), (256, 75), (379, 93), (312, 49), (471, 187),
(366, 122)
]concave = hull.concave(points)
convex = hull.convex(points)
```
The code above creates the following results:## Requirements
- [pyprocessing](https://github.com/jsmolka/pyprocessing) if you want to run the visual examples## References
- The concave hull algorithm is based on a [paper](https://github.com/jsmolka/hull/blob/master/reference/concave_hull.pdf) by Adriano Moreira and Maribel Yasmina Santos.
- The convex hull algorithm is an implementation of Andrew's monotone chain algorithm.## Disclaimer
- Some parts of the concave hull algorithm were copied from [Mapotempo's](https://github.com/Mapotempo/mapotempo-web/blob/master/lib/concave_hull.rb) Ruby approach.
- The entire convex hull algorithm is copy-pasted from a [wikibook](https://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain) about algorithm implementations.