#NEWLINE# def getTangents( contours ) : #NEWLINE# #INDENT# tmap = [ ] #NEWLINE# for c in contours : #NEWLINE# #INDENT# clen = len ( c ) #NEWLINE# for i in range ( clen ) : #NEWLINE# #INDENT# s = c [ i ] #NEWLINE# p = s . points [ ( - 1 ) ] #NEWLINE# ns = c [ ( ( i + 1 ) % clen ) ] #NEWLINE# ps = c [ ( ( ( clen + i ) - 1 ) % clen ) ] #NEWLINE# np = ( ns . points [ 1 ] if ( ns . type == 'curve' ) else ns . points [ ( - 1 ) ] ) #NEWLINE# pp = ( s . points [ 2 ] if ( s . type == 'curve' ) else ps . points [ ( - 1 ) ] ) #NEWLINE# tmap . append ( ( ( pp - p ) , ( np - p ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return tmap