Hi there!
I’m using QHull.jl for a project where I need to calculate the volume of convex hulls in 8-d. I’m starting out with about 10 points and then iteratively adding more and more points to be included in the convex hull. I noticed that the native SciPy implementation supports the adding of new points via a function add_points().
I tried adding this functionality to the package myself but I’m struggling with it. This is my implementation below:
mutable struct Chull{T<:Real}
**hull::Any**
points::Matrix{T}
vertices::Vector{Int}
simplices::Vector{Vector{Int}}
facets::Matrix{T}
area::Float64
volume::Float64
end
function chull(x::Matrix{T}) where T<:Real
py = spatial.ConvexHull(x, incremental=true)
points = convert(Matrix{T}, py."points")
vertices = convert(Vector{Int}, py."vertices")
incone(vertices)
simplices = convert(Vector{Vector{Int}}, py."simplices")
for simplex in simplices
incone(simplex)
end
facets = convert(Matrix{T}, py."equations")
area = convert(Float64, py."area")
volume = convert(Float64, py."volume")
Chull(**py,** points, vertices, simplices, facets, area, volume)
end
**
function addPoints(H::Chull, points::Matrix{T}) where T<:Real
H.hull.add_points(points)
end
**
Enclosed in ** are the parts that I modified.
When testing the implementation I do not get an Error when calling addPoints(hull, newpoints) but just nothing happens instead. Meaning that the new points are not added to the space. Any ideas or help?
Thanks!