All Projects → lstagner → ConcaveHull.jl

lstagner / ConcaveHull.jl

Licence: other
Julia package for calculating 2D concave/convex hulls

Programming Languages

julia
2034 projects

Projects that are alternatives of or similar to ConcaveHull.jl

geo
Geospatial primitives and algorithms for Crystal
Stars: ✭ 17 (-10.53%)
Mutual labels:  convex-hull
tektosyne
The Tektosyne Library for Java provides algorithms for computational geometry and graph-based pathfinding, along with supporting mathematical utilities and specialized collections.
Stars: ✭ 52 (+173.68%)
Mutual labels:  convex-hull
convhull 3d
A header-only C implementation of the Quickhull algorithm for building N-dimensional Convex Hulls and Delaunay meshes
Stars: ✭ 108 (+468.42%)
Mutual labels:  convex-hull
hxDelaunay
Delaunay triangulations, Voronoi, convex hull and more. Ported to Haxe 3 from https://github.com/sledorze/hxDelaunay (itself a port of the excellent https://github.com/nodename/as3delaunay)
Stars: ✭ 30 (+57.89%)
Mutual labels:  convex-hull
Materialshadows
Material Shadows for android : A library for supporting convex material shadows
Stars: ✭ 2,145 (+11189.47%)
Mutual labels:  convex-hull
quickhull
Header-only single-class implementation of Quickhull algorithm for convex hulls finding in arbitrary dimension (>1) space.
Stars: ✭ 47 (+147.37%)
Mutual labels:  convex-hull
Convex-hull
Convex hull of given 3D points
Stars: ✭ 51 (+168.42%)
Mutual labels:  convex-hull

ConcaveHull

Build Status

This package computes the concave/convex hull of a set of points using a nearest neighbours algorithm[1].

[1] Moreira, Adriano, and Maribel Yasmina Santos. "Concave hull: A k-nearest neighbours approach for the computation of the region occupied by a set of points." (2007).

Usage

Pkg.add("ConcaveHull") # Add package
using ConcaveHull
using Plots

points = [[th, -sin(th)] .+ (0.4*rand(2) .- 0.2) for th in range(0, stop=2pi, length=5000)];
x = [p[1] for p in points];
y = [p[2] for p in points];

hull = concave_hull(points)
hull_area = area(hull)

scatter(x,y,ms=1,label="",axis=false,grid=false,markerstrokewidth=0.0)
plot!(hull)
annotate!(pi/2,0.5,"K = $(hull.k)")
annotate!(pi/2,0.25,"Area $(round(hull_area, digits=3))")

Smoothness

The smoothness of the concave hull can be adjusted by increasing the number of neighbours used

hull = concave_hull(points,100) # Use 100 neighbours
hull_area = area(hull)

scatter(x,y,ms=1,label="",axis=false,grid=false,markerstrokewidth=0.0)
plot!(hull)
annotate!(pi/2,0.5,"K = $(hull.k)")
annotate!(pi/2,0.25,"Area $(round(hull_area, digits=3))")

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].