MiniQhull.jl icon indicating copy to clipboard operation
MiniQhull.jl copied to clipboard

Convex hull

Open plut opened this issue 4 years ago • 2 comments

So this library is titled MiniQHull, yet it does not have an obvious method for convex hull computation. Converting a convex hull method to an unconstrained Delaunay triangulation algorithm is quite simple; is there a way to, in the other direction, use this library's Delaunay triangulation method to compute convex hull, or does this need to export a convex hull function from the C library?

plut avatar Apr 11 '21 10:04 plut

This package uses the qhull C library. Use this package that wraps qhull as well but provides the convexhull featute https://github.com/JuliaPolyhedra/Qhull.jl, not de Delaunay triangulation

blegat avatar Apr 13 '21 06:04 blegat

Hi, @plut, I have recently needed to compute a convex hull and managed to do it with MiniQhull.jl (in a slightly dirty way and possibly unstable, I need to test it more). I will tell you how for you or anyone who might be interested.

It looks to me the delaunay function of MiniQhull.jl eventually calls the qhull programme of qhull by looking at the flags passed by default.

The qhull programme is an umbrella function for the qconvex, qdelaunay, qhalf, qvoronoi... so by setting the appropriate flags, you can get the convex hull, instead of the delaunay triangulation :point_down:

flags = "qhull Qt Qc" # some custom flags for convex hull
connectivity = delaunay(points, flags)

But the connectivity array is assumed to be of size (dim+1,num_cells), see here, so the actual connectivity entries of the convex hull are only in the first dim rows.

I wonder if a little refactoring/cleaning could allow us to rename delaunay to qhull in MiniQhull and let us safely (and cleanly) use the full functionality of the qhull programme. It would be good if it turns out to be a low-hanging fruit :smile:

ericneiva avatar Nov 10 '22 13:11 ericneiva