geometry icon indicating copy to clipboard operation
geometry copied to clipboard

Precision in convex hull of planar polytopes

Open rmurphy2718 opened this issue 5 years ago • 1 comments

Thanks for your work! I am trying to calculate the intersection of polyhedra living in a plane. I have read that qhull has numerical precision issues in the planar case, and so unsurprisingly the geometry package does as well.

I see that there is a joggle option which overcomes the issues for me but I'm wondering if there are other alternatives. Is there a way to increase the precision of the input representation -- beyond a matrix full of points -- to help?

Also, I read in the qhull documentation that joggling can lead to fusing/merging, which I don't quite understand. Any explanation would be greatly appreciated!

Last, I notice that 'Tv' allows for verification that a convex hull was indeed found. But I don't see anything in the returned value which can help me to see this for myself!

I can provide sample code but I feel these are general.

Thanks for your help.

rmurphy2718 avatar Jul 15 '19 07:07 rmurphy2718

Have you tried the latest version of geometry (0.4.2, released on Friday 12 July)? I fixed one issue to do with intersectn() in it.

The other advice would be to try to transform your coordinates so that (a) they are zero mean and (b) the x and y extents of the polyhedra are as equal as possible. (Here x and y should ideally be orthogonal to the principal components of the space.)

Even with this advice, the precision of determining convex hulls from half spaces is an issue. I've not tried it, but exact arithmetic should provide the solution. See the R rcdd package, and its associated vignette: https://cran.r-project.org/web/packages/rcdd/vignettes/vinny.pdf

davidcsterratt avatar Jul 15 '19 08:07 davidcsterratt