#NEWLINE# def smooth_angle_channels( self , channels ) : #NEWLINE# #INDENT# "Remove discontinuities in angle channels so that they don't cause artifacts in algorithms that rely on the smoothness of the functions." #NEWLINE# for vertex in self . vertices : #NEWLINE# #INDENT# for col in vertex . meta [ 'rot_ind' ] : #NEWLINE# #INDENT# if col : #NEWLINE# #INDENT# for k in range ( 1 , channels . shape [ 0 ] ) : #NEWLINE# #INDENT# diff = ( channels [ ( k , col ) ] - channels [ ( ( k - 1 ) , col ) ] ) #NEWLINE# #UNINDENT# if ( abs ( ( diff + 360.0 ) ) < abs ( diff ) ) : #NEWLINE# #INDENT# channels [ k : , col ] = ( channels [ k : , col ] + 360.0 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( abs ( ( diff - 360.0 ) ) < abs ( diff ) ) : #NEWLINE# #INDENT# channels [ k : , col ] = ( channels [ k : , col ] - 360.0 )