David C Sterratt

Results 22 comments of David C Sterratt

The geometry package can't do what you ask at the moment, but I am now pretty confident that I can adapt the `inhulln()` function to do this fairly quickly.

Hmm... I have been using ``` facet = qh_findbestfacet(qh, point, !qh_ALL, &bestdist, &isoutside); ``` and then taking `bestdist` as the distance - this seems to work in a simple example,...

Thanks @cbbarber. `qh_ALL` in `qh_findbestfacet` seems to work and I've pushed my work so far containing this code. However, I've run into a conceptual problem. When a point is above...

The crucial changes are in this file: https://github.com/davidcsterratt/geometry/commit/5454978f943a7a33feb7e6f91b6b9b8773c6aa11#diff-18d95f23a29dae23e9245ff171c2905184d938e4f109e63072a960f8b10801e0

I think this is a precision issue in QHull. It has cropped up elsewhere: https://github.com/scipy/scipy/issues/4974, https://github.com/scipy/scipy/issues/6484 I have discovered a workaround for this case, which is to normalise the points...

The [QbB option](http://www.qhull.org/html/qh-optq.htm#QbB) also seems to fix the problem. ``` dn2 = geometry::delaunayn(X, options="QbB") plot(X, asp = 1, main="options=\"QbB\"") geometry::trimesh(dn2, X, add = T) ``` I think it might be...

QbB and the mean subtraction don't give identical results, but they are very similar and probably "good enough". ``` X = read.table("points.txt") X = as.matrix(X) par(mfcol=c(2,2)) ## Gives error QH6227...

A translation should definitely not make a difference. I think that QbB might stretch by different amounts in different directions, which could account for the difference. However, I've checked this...

Nice (or nasty) catch! The immediate problem seems to be the `Qz` option, which was added in this commit: https://github.com/davidcsterratt/geometry/commit/8a1d495a0b70d355ed83d2e7cf2ba816b46a2854 Try `t = delaunayn(cbind(x,y), options="Qt Qc")` and you should get...

I've gone upstream with this - I'd rather understand why this behaviour occurs before making a decision about whether to drop the Qz option.