#NEWLINE# def apply_to_surface( self , verts , u_set , v_set , set_len = None , inc_pos = None ) : #NEWLINE# #INDENT# '\n        Apply this color scheme to a\n        set of vertices over two\n        independent variables u and v.\n        ' #NEWLINE# bounds = create_bounds ( ) #NEWLINE# cverts = list ( ) #NEWLINE# if callable ( set_len ) : #NEWLINE# #INDENT# set_len ( ( ( len ( _v ) * len ( v_set ) ) * 2 ) ) #NEWLINE# #UNINDENT# for _u in range ( len ( u_set ) ) : #NEWLINE# #INDENT# column = list ( ) #NEWLINE# for _v in range ( len ( v_set ) ) : #NEWLINE# #INDENT# if ( verts [ _u ] [ _v ] is None ) : #NEWLINE# #INDENT# column . append ( None ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( x , y , z ) = verts [ _u ] [ _v ] #NEWLINE# ( u , v ) = ( u_set [ _u ] , v_set [ _v ] ) #NEWLINE# c = self ( x , y , z , u , v ) #NEWLINE# if ( c is not None ) : #NEWLINE# #INDENT# c = list ( c ) #NEWLINE# update_bounds ( bounds , c ) #NEWLINE# #UNINDENT# column . append ( c ) #NEWLINE# #UNINDENT# if callable ( inc_pos ) : #NEWLINE# #INDENT# inc_pos ( ) #NEWLINE# #UNINDENT# #UNINDENT# cverts . append ( column ) #NEWLINE# #UNINDENT# for _u in range ( len ( u_set ) ) : #NEWLINE# #INDENT# for _v in range ( len ( v_set ) ) : #NEWLINE# #INDENT# if ( cverts [ _u ] [ _v ] is not None ) : #NEWLINE# #INDENT# for _c in range ( 3 ) : #NEWLINE# #INDENT# cverts [ _u ] [ _v ] [ _c ] = rinterpolate ( bounds [ _c ] [ 0 ] , bounds [ _c ] [ 1 ] , cverts [ _u ] [ _v ] [ _c ] ) #NEWLINE# #UNINDENT# cverts [ _u ] [ _v ] = self . gradient ( * cverts [ _u ] [ _v ] ) #NEWLINE# #UNINDENT# if callable ( inc_pos ) : #NEWLINE# #INDENT# inc_pos ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return cverts