python - scipy voronoi 3d - not all ridge points are shown -


i have been having trouble using scipy's voronoi function. have followed 2d example, when performed similar example in 3d not ridge_points computed. data box of 27 points in [0,2]x[0,2]x[0,2]:

points = np.array([     # bottom plane     [0,2,0], [1,2,0], [2,2,0],     [0,1,0], [1,1,0], [2,1,0],     [0,0,0], [1,0,0], [2,0,0],     # middle plane     [0,2,1], [1,2,1], [2,2,1],     [0,1,1], [1,1,1], [2,1,1],     [0,0,1], [1,0,1], [2,0,1],     # top plane     [0,2,2], [1,2,2], [2,2,2],     [0,1,2], [1,1,2], [2,1,2],     [0,0,2], [1,0,2], [2,0,2]     ])  vor = voronoi(points)  print vor.ridge_points # outputed array([[ 4,  7],        [ 4,  5],        [ 4,  3],        [ 4,  1],        [ 4, 13],        [ 3, 12],        [ 7, 16],        [15, 12],        [15, 16],        [ 9, 12],        [ 9, 10],        [ 1, 10],        [12, 21],        [12, 13],        [23, 14],        [23, 22],         [14, 17],        [14, 11],        [14,  5],        [14, 13],        [22, 19],        [22, 21],        [22, 13],        [22, 25],        [17, 16],        [11, 10],        [25, 16],        [16, 13],        [13, 10],        [19, 10], dtype=int32) 

i noticed points on corners:

points[0] = array([0, 2, 0]) points[2] = array([2, 2, 0]) points[6] = array([0, 0, 0]) points[8] = array([2, 0, 0]) points[18] = array([0, 2, 2]) points[20] = array([2, 2, 2]) points[24] = array([0, 0, 2]) points[26] = array([2, 0, 2]) 

do not have ridge points. assume (like 2d case) corners have ridge points. example assume points[6]=[0,0,0] have ridge points [1,0,0], [0,1,0], , [0,0,1]. not possible compute scipy or have been thinking wrong?

scipy uses qhull delaunay/voronoi/convexhull computations. data contained in ridge_points reported qvoronoi fv although ridges not listed in same order. (as check: https://gist.github.com/pv/2f756ec83cdf242ce691)

the qhull documentation fv (http://www.qhull.org/html/qh-optf.htm#fv2) mentions caveat seems relevant here:

option 'fv' not list ridges require more 1 midpoint. example, voronoi diagram of cospherical points lists 0 ridges (e.g., 'rbox 10 s | qvoronoi fv qz'). other examples voronoi diagrams of rectangular mesh (e.g., 'rbox 27 m1,0 | qvoronoi fv') or point set rectangular corner (e.g., 'rbox p4,4,4 p4,2,4 p2,4,4 p4,4,2 10 | qvoronoi fv'). both cases miss unbounded rays @ corners. determine these ridges, surround points large cube (e.g., 'rbox 10 s c g2.0 | qvoronoi fv qz'). cube needs large enough bound voronoi regions of original point set. please report other cases missed. if can formally describe these cases or write code handle them, please send email qhull@qhull.org.

the rbox 27 m1,0 mentioned in text same set of points in example (in different order).

typically, qhull has problems in dealing geometrical degeneracies, occur example in rectangular meshes. generic workaround set qhull_options="qj" tells add random perturbations data points until degeneracies resolved. typically generates tesselations/voronoi diagrams several additional simplices/ridges, may resolve issues of type.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -