[SciPy-User] results of scipy.spatial.ConvexHull
Rafael Silva
rmslobato at gmail.com
Wed Jun 7 12:40:21 EDT 2017
Hi!
Using the code
> import scipy.spatial.qhull as qhull
> import scipy.spatial.qhull as qhull
verts = [
> [-0.5, -0.5, -0.5],
> [-0.5, -0.5, 0.5],
> [-0.5, 0.5, -0.5],
> [-0.5, 0.5, 0.5],
> [0.5, -0.5, -0.5],
> [0.5, -0.5, 0.5],
> [0.5, 0.5, -0.5],
> [0.5, 0.5, 0.5],
> ]
> qh = qhull.ConvexHull(verts)
> print(qh.simplices)
I obtained the results:
> [[6 2 0]
> [6 4 0]
> [5 4 0]
> [5 1 0]
> [5 6 4]
> [5 6 7]
> [3 2 0]
> [3 1 0]
> [3 6 2]
> [3 6 7]
> [3 5 1]
> [3 5 7]]
I tried some options using the keyword "qull_options", but I could only get
results consisting of 12 simplices.
Instead, using Qhull library directly
rbox c D3 | qconvex p i
I got the result I wanted with just 6 simplices:
4 6 2 0
> 1 5 4 0
> 5 7 6 4
> 3 1 0 2
> 7 3 2 6
> 3 7 5 1
And using the option "Qt" I got the same result from scipy:
6 2 0
> 4 6 0
> 5 4 0
> 1 5 0
> 5 6 4
> 6 5 7
> 2 3 0
> 3 1 0
> 6 3 2
> 3 6 7
> 3 5 1
> 5 3 7
My question is: I want to get the "merged" version of the convex hull
results for 3-D points. In the example, I want the 6 simplices case instead
of the 12 (N x 3) format.
How could I get that from scipy? Is it possible?
Thank you for help!
Regards,
Rafael.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-user/attachments/20170607/9cce613d/attachment.html>
More information about the SciPy-User
mailing list