-
Notifications
You must be signed in to change notification settings - Fork 11
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
Switch to QHull directly? #19
Comments
Okay the scipy bindings to qhull are definitely more involved than I thought, so this is easier said than done 😅 |
I agree, it would be nice to access qhull directly without scipy. It currently use scipy as it was easier to start with, see this discussion. |
This package calls Qhull directly: https://github.com/gridap/MiniQhull.jl Maybe it should be merged with or replace Qhull.jl at some point? |
Now that Qhull 8.0.999 has been released on Yggdrasil (JuliaPackaging/Yggdrasil#3657) with the new accessors API (qhull/qhull#89), it should be much easier to call libqhull_r directly (as also discussed in gridap/MiniQhull.jl#5) without requiring a C compiler or building a wrapper (as in https://github.com/JuhaHeiskala/DirectQhull.jl). My only question is where that development should take place. Here? MiniQhull (cc @fverdugo)? DirectQhull (cc @JuhaHeiskala)? |
Hi, well I guess my question would be what development? Its been some years since I originally implemented DirectQhull, only imported it to Github recently, so my recollection of the details below is a bit hazy. The DirectQhullHelper wrapper uses slightly different approach to the accessor API, by returning the field offsets of qhT, facetT and vertexT structures. Then that information is used in the Julia side to access the qhull internals as required. I suppose it should or could be possible to build types corresponding to facetT and vertexT purely from Julia and maybe enough of qhT to implement the (limited) functionality now supported by DirectQHull with the current accessor functions, but I haven't really thought trough this. |
I think that the goal would be to expose at least as much functionality as the Python API. The Is there any field of |
Thanks for adding this accessor API to qhull. I just tried [email protected] and I get: julia> using Qhull_jll
julia> ccall((:qh_alloc_qh, Qhull_jll.libqhull_r), Ptr{Cvoid}, (Ptr{Cvoid},), Base.stderr)
ERROR: could not load symbol "qh_alloc_qh":
/home/blegat/.julia/artifacts/79616aed563a579660c5bd4fb576b2ac6d64c475/lib/libqhull_r.so: undefined symbol: qh_alloc_qh
Stacktrace:
[1] top-level scope
@ ./REPL[11]:1 I also can't find the other symbols from |
@blegat, the qhull |
@stevengj I have used "facet_tail", "vertex_tail", "num_good", "del_vertices", "input_dim" that did not have accessors. Looks like "facet_tail" and "vertex_tail" can be detected by qhull's "getid_" function, so accessor should not be needed. "num_good" I have used for returning Voronoi regions in a Julia array and "del_vertices" to calculate number of Voronoi regions. "input_dim" is of course known by caller, but should then be saved somehow in the Julia side. I haven't yet looked at the Python API, but will take a look. |
For It might be good to ensure that we export enough |
I don't recall/know the details of qhull now, so I assume your instructions are valid for the those fields. Just to check, you think what I did in: DirectQhullHelper.c The scipy python API defines the below "redacted" copy of qhT in qhull.pyx
|
Providing access to all of the fields seems excessive, since many of them are internal qhull state, but the scipy API seems like a good guide. |
Ok, I thought just to take the qhull.pyx from Scipy and translate it to Julia more or less directly. |
I have an initial version of updated DirectQhull in 8e43cd0d. In case someone wants to take a look/provide feedback on the design. So far building convex hull is supported with DirectQhull.ConvexHull(points) |
I wanted to try out your commit but I'm not able to load the package (tried on Linux and Windows): pkg> add https://github.com/JuhaHeiskala/DirectQhull.jl#master
julia> using DirectQhull
ERROR: KeyError: key DirectQhull [c3f9d41a-afcb-471e-bc58-0b8d83bd86f4] not found
Stacktrace:
[1] getindex
@ ./dict.jl:482 [inlined]
[2] root_module
@ ./loading.jl:979 [inlined]
[3] require(uuidkey::Base.PkgId)
@ Base ./loading.jl:945
[4] require(into::Module, mod::Symbol)
@ Base ./loading.jl:923 I wonder if there's something off in the Project.toml? |
Hi, Maybe then better to move further issues to under DirectQhull from here. :) |
Hey there,
I use this in one of my packages and this dependency makes a little bit trouble during the installation / first use. On two of my colleagues systems (both Linux) I had to update the scipy version to get this working since Julia choose their global Python toolchain.
To avoid these kinds of problems, maybe we should instead wrap qhull directly? Or do you have other ideas to get the installation process more stable?
The text was updated successfully, but these errors were encountered: