diff --git a/Project.toml b/Project.toml index 3d3423b..b1b2262 100644 --- a/Project.toml +++ b/Project.toml @@ -5,12 +5,12 @@ version = "0.2.1" [deps] Polyhedra = "67491407-f73d-577b-9b50-8179a7c68029" -PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0" +Qhull_jll = "784f63db-0788-585a-bace-daefebcd302b" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" [compat] Polyhedra = "0.6.8" -PyCall = "1.91" +Qhull_jll = "8.0.1000" StaticArrays = "0.12, 1.0" julia = "1" diff --git a/src/QHull.jl b/src/QHull.jl index 28a884c..94655b7 100644 --- a/src/QHull.jl +++ b/src/QHull.jl @@ -30,7 +30,11 @@ incone(x) = for i in 1:length(x) x[i] += 1 end +import QHull_jll + function chull(x::Matrix{T}) where T<:Real + q = ccall((:qh_alloc_qh, Qhull_jll.libqhull_r), Ptr{Cvoid}, (Ptr{Cvoid},), Base.stderr) + ccall((:qh_init_B, Qhull_jll.libqhull_r), Cvoid, (Ptr{Cvoid}, Ptr{Cdouble}, Cint, Cint, Cuint), q, Matrix(x'), size(x, 1), size(x, 2), 0) py = spatial.ConvexHull(x) points = convert(Matrix{T}, py."points") vertices = convert(Vector{Int}, py."vertices")