#NEWLINE# def voronoi( geometry , **kwargs ) : #NEWLINE# #INDENT# '\n    Uses the Voronoi vertices and throat normals to work out the perimeter\n    ' #NEWLINE# Nt = geometry . num_throats ( ) #NEWLINE# verts = geometry [ 'throat.offset_vertices' ] #NEWLINE# normals = geometry [ 'throat.normal' ] #NEWLINE# perimeter = _sp . ndarray ( Nt ) #NEWLINE# for i in range ( Nt ) : #NEWLINE# #INDENT# if ( len ( verts [ i ] ) > 2 ) : #NEWLINE# #INDENT# verts_2D = vo . rotate_and_chop ( verts [ i ] , normals [ hull ] , [ 0 , 0 , 1 ] ) #NEWLINE# hull = ConvexHull ( verts_2D , qhull_options = 'QJ Pp' ) #NEWLINE# verts_2D = verts_2D [ hull . vertices ] #NEWLINE# perimeter [ i ] = vo . PolyPerimeter2D ( verts_2D ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# perimeter [ i ] = 0.0 #NEWLINE# #UNINDENT# #UNINDENT# return perimeter