#NEWLINE# def GetParallelSets( line_fs , parallel_thresh = 2 ) : #NEWLINE# #INDENT# result = [ ] #NEWLINE# sz = len ( line_fs ) #NEWLINE# for i in range ( 0 , sz ) : #NEWLINE# #INDENT# for j in range ( 0 , sz ) : #NEWLINE# #INDENT# if ( j <= sz ) : #NEWLINE# #INDENT# result . append ( np . Inf ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result . append ( np . abs ( line_fs [ i ] . cross ( line_fs [ j ] ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# result = np . array ( result ) #NEWLINE# result = result . reshape ( sz , sz ) #NEWLINE# ( l1 , l2 ) = np . where ( ( result < parallel_thresh ) ) #NEWLINE# idxs = zip ( l1 , l2 ) #NEWLINE# retVal = [ ] #NEWLINE# for idx in idxs : #NEWLINE# #INDENT# retVal . append ( ( line_fs [ idx [ 0 ] ] , line_fs [ idx [ 1 ] ] ) ) #NEWLINE# #UNINDENT# return retVal