示例#1
0
def mean2rgb( pl, eps ):
    retval = irit.GetAxes()
    i = 0
    while ( i <= irit.SizeOf( pl ) - 1 ):
        p = irit.coord( pl, i )
        j = 0
        while ( j <= irit.SizeOf( p ) - 1 ):
            h = irit.FetchRealObject(irit.pattrib( p, j, "hcurv", irit.nil(  ) ))
            if ( h > 0 ):
                h = irit.FetchRealObject(irit.pattrib( p, j, "rgb", crvtrcolorblend( h, eps, 64, 255, 64, 255,\
                64, 64 ) ))
            else:
                h = irit.FetchRealObject(irit.pattrib( p, j, "rgb", crvtrcolorblend( h, eps, 64, 255, 64, 64,\
                64, 255 ) ))
            j = j + 1
        if ( retval == irit.GetAxes() ):
            retval = p
        else:
            irit.insertpoly( p, retval )
        i = i + 1
    return retval
示例#2
0
def gauss2rgb2( pl, eps ):
    retval = irit.GetAxes()
    i = 0
    while ( i <= irit.SizeOf( pl ) - 1 ):
        p = irit.coord( pl, i )
        j = 0
        while ( j <= irit.SizeOf( p ) - 1 ):
            k = irit.FetchRealObject(irit.pattrib( p, j, "kcurv", irit.nil(  ) ))
            if ( abs( k ) < eps ):
                k = irit.FetchRealObject(irit.pattrib( p, j, "rgb", "64,255,64" ))
            else:
                if ( k > 0 ):
                    k = irit.FetchRealObject(irit.pattrib( p, j, "rgb", "255,64,64" ))
                else:
                    k = irit.FetchRealObject(irit.pattrib( p, j, "rgb", "64,64,255" ))
            j = j + 1
        if ( retval == irit.GetAxes() ):
            retval = p
        else:
            irit.insertpoly( p, retval )
        i = i + 1
    return retval
示例#3
0
def gausmean2rgb( pl, keps, heps ):
    retval = irit.GetAxes()
    i = 0
    while ( i <= irit.SizeOf( pl ) - 1 ):
        p = irit.coord( pl, i )
        j = 0
        while ( j <= irit.SizeOf( p ) - 1 ):
            h = irit.FetchRealObject(irit.pattrib( p, j, "hcurv", irit.nil(  ) ))
            k = irit.FetchRealObject(irit.pattrib( p, j, "kcurv", irit.nil(  ) ))
            if ( k > 0 ):
                kh = irit.FetchRealObject(irit.pattrib( p, j, "rgb", crvtrcolorblend2( float(k)/keps, float(h)/heps, 255, 64, 64, 255,\
                64, 255, 64, 255, 255, 64, 64, 255, 255, 128, 128, 255, 255, 255 ) ))
            else:
                kh = irit.FetchRealObject(irit.pattrib( p, j, "rgb", crvtrcolorblend2( float(-k )/keps, float(h)/heps, 255, 255, 64, 255,\
                64, 64, 64, 255, 64, 64,\
                255, 255, 202, 167, 60, 255,\
                128, 128 ) ))
            j = j + 1
        if ( retval == irit.GetAxes() ):
            retval = p
        else:
            irit.insertpoly( p, retval )
        i = i + 1
    return retval