How to use convexhull in Meshes.jl?

I found the convexhull function in Meshes.jl:
convexhull doc

The docs description “Convex hull of object.”

I have a vector of 2d points:

julia> points
1000-element Vector{Vector{Float64}}:
 [0.5090075873973284, 0.7935895094356397]
 [0.5896006255338349, 0.8640965436930047]
 [0.31107945002334914, 0.1282829645428072]
 ⋮
 [0.6629464927439436, 0.27566263195149276]
 [0.5735250132020138, 0.6521340975802663]

I tried convexhull(points), but I got ERROR: StackOverflowError:...

Am I doing this wrong? I am not sure what object the function is expecting, but since I didn’t get a method error I’m assuming I’m using it correctly?

I also tried convexhull(Point2f.(points)) and got the same

figured it out:

points = [rand(2) for _ in 1:1000]
points2 = [Meshes.Point(p...) for p in points]
chul = convexhull(points2)
coords=[[vert.coords.x.val,vert.coords.y.val] for vert in chul.rings[1].vertices]
push!(coords,coords[1])
lines(Point2f.(coords))

I assume there is a nicer way to convert back to regulat floats as opposed to:
coords=[[vert.coords.x.val,vert.coords.y.val] for vert in chul.rings[1].vertices]

You need to construct a vector of Point. It is all explained in the docs.

Your example above is accessing internal fields of the point, which is not recommended. Rely on coords(point) to access the coordinates, or on to(point) to get the vector from the origin.

Apologies for giving up and asking on discourse, I had already spent a lot of time (compared to just using convhull in matlab) trying to find a usable convexhull function in Julia…the first two packages I tried gave errors when I added them…

Although shouldn’t the input types of the function be in its docstring? Upon reading ?convexhull I gave up pretty quickly. I appreciate it is somewhere in the docs.

We provide examples in the docs. We will add more examples.