[SciPy-User] scipy.spatial.Delaunay.convex_hull problelm
Dan Richards
D.Richards at mmu.ac.uk
Sat Feb 4 05:48:22 EST 2012
Hi All,
I have been using scipy to find the Delaunay tetrahedron of a set of points in three-dimensions. However, now I wish to only generate the external faces of the tetrahedron. I assume this can be done using scipy.spatial.Delaunay.convex_hull?
For my three-dimensional tetrahedron I am using this:
import scipy
from scipy import spatial
Points = ([x1,y1,z1], [x2,y2,z2]...[xn,yn,zn])
Del = scipy.spatial.Delaunay(Points)
faces = []
v = x.vertices
for i in xrange(x.nsimplex):
faces.extend([
(v[i,0],v[i,1],v[i,2]),
(v[i,1],v[i,3],v[i,2]),
(v[i,0],v[i,3],v[i,1]),
(v[i,0],v[i,2],v[i,3]),])
for i in faces:
MakeLines(i[0],i[1],i[2])
This allows me to create a three-dimensional tetragedron. I had thought to find the 3D convex hull could simply change either: "v = x.verticies" into "v=x.convex_hull" ; or "Del = scipy.spatial.Delaunay (Points)" into "Del = scipy.spatial.Delaunay.convex_hull(Points)".However, neither of these have worked as planned?
If anyone is able to give me some advice or simply point me in the right direction that would be much appreciated.
Thanks,
Dan
"Before acting on this email or opening any attachments you should read the Manchester Metropolitan University email disclaimer available on its website http://www.mmu.ac.uk/emaildisclaimer "
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20120204/0d1e8671/attachment.html>
More information about the SciPy-User
mailing list