#NEWLINE# def _typical_distance( data_obj ) : #NEWLINE# #INDENT# ' Returns a typical distance in a cloud of points.\n        This is done by taking the size of the bounding box, and dividing it\n        by the cubic root of the number of points.\n    ' #NEWLINE# ( x_min , x_max , y_min , y_max , z_min , z_max ) = data_obj . bounds #NEWLINE# distance = numpy . sqrt ( ( ( ( ( ( x_max - x_min ) ** 2 ) + ( ( y_max - y_min ) ** 2 ) ) + ( ( z_max - z_min ) ** 2 ) ) / ( 4 * ( data_obj . number_of_points ** 0.33 ) ) ) ) #NEWLINE# if ( distance == 0 ) : #NEWLINE# #INDENT# return 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( 0.4 * distance )