Skip to content
/ hull Public
forked from jsmolka/hull

Concave or convex hull around a list of points.

Notifications You must be signed in to change notification settings

chopperm/hull

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hull

Concave or convex hull around a list of points.

How to use

import hull

points = [
    (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 = hull.concave(points, 3)
convex_hull = hull.convex(points)

The code above creates the following results:

Requirements

References

  • The concave hull algorithm is based on a paper 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 Matotempo's Ruby approach.
  • The entire convex hull algorithm is copy-pasted from a wikibook about algorithm implementations.

About

Concave or convex hull around a list of points.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%