Latest 1.1.0
License MIT
Platforms ios 8.0

ConcaveHull – A Swift Library that builds concave hull by set of points

CI Status


let points = [[162, 332], [182, 299], [141, 292], [158, 264], ... ];
let h = Hull(concavity: 50)
let hull = h.hull(points, nil)


public func hull( pointSet: [Any], concavity: Double?, _ format: [String]?) -> [Any] {

  • 1st param – array of coordinates in format: [Any], [Any] can be [[Int]], [[Double]], [[String: Int]], [[String: Double]];
  • 2nd param – concavity. 1 – thin shape. Infinity – convex hull. By default 20;
  • 3rd param – the format of the array of coordinates For example: ["lng", "lat"] if you have ["lng": x, "lat": y] points. If your are using [[Int]] or [[Double]], the value can be nil

How it works

This step by step guide was taken as the original code from
Let’s see step by step what happens when you call hull() function:

  1. Hull.js takes your source points of the shape:
  2. Builds convex hull:
  3. After that, the edges flex inward (according to the `concavity` param). For example:

    `concavity = 80`

    `concavity = 40`

    `concavity = 20`


ConcaveHull is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "ConcaveHull"

Latest podspec

    "name": "ConcaveHull",
    "version": "1.1.0",
    "summary": "A Swift Library that builds concave or convexe hull by set of points",
    "description": "Concave hull is a simple library that generate the hull of a set of points, the points cannbe of any format, the concavity of the hull is defined by a parameter if the function. nTo create the Hull, just call Hull().hull(pointSet, Concavity, format or nil)",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "SanyM": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.1.0"
    "platforms": {
        "ios": "8.0"
    "source_files": "ConcaveHull/Classes/**/*",
    "pushed_with_swift_version": "4.0"

Pin It on Pinterest

Share This