Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convex hull #19

Open
plut opened this issue Apr 11, 2021 · 2 comments
Open

Convex hull #19

plut opened this issue Apr 11, 2021 · 2 comments

Comments

@plut
Copy link

plut commented Apr 11, 2021

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?

@blegat
Copy link

blegat commented Apr 13, 2021

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

@ericneiva
Copy link
Member

ericneiva commented Nov 10, 2022

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 👇

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 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants