Пример #1
0
downGradient.createBalancedGradient(downGradientColors)
docu.append(downGradient.createDefinition())

# starBackground
##backing = PathData().makeHull(innerStarPoints)
##docu.append( buildPath( backing, {u'fill':u'black'}))


# outer star rays
starRaysGroup = docu.makeGroup()
# outerRayAttributes = {u'style':u'fill: white; stroke:none'}
for i in range(5):
    ##starPointData = PathData().moveTo(outerStarPoints[i]).lineTo(midStarPoints[i]).lineTo(midStarPoints[(i-1)%5]).closePath()
    ##outerStarRaysGroup.append(buildPath( starPointData,  outerRayAttributes))
    points = [outerStarPoints[i], midStarPoints[i], midStarPoints[(i - 1) % 5]]
    starRaysGroup.append(gradshape.polygonGradient(docu, points, upGradient, "outspire" + str(i)))

# inner star rays

innerRayAttributes = {u"style": u"fill: white; stroke:none"}
for i in range(5):
    ##starPointData = PathData().moveTo(midStarPoints[i]).lineTo(innerStarPoints[i]).lineTo(innerStarPoints[(i+1)%5]).closePath()
    ##outerStarRaysGroup.append(buildPath( starPointData,  innerRayAttributes))
    points = [midStarPoints[i], innerStarPoints[i], innerStarPoints[(i + 1) % 5]]
    starRaysGroup.append(gradshape.polygonGradient(docu, points, upGradient, "inspire" + str(i)))

docu.append(starRaysGroup)

# surrounding triangles
betweenTrianglesGroup = docu.makeGroup()
innerRayAttributes = {u"style": u"fill: black; stroke:none"}
Пример #2
0
upGradient = Gradient('grade000')
upGradient.createBalancedGradient(upGradientColors)
upGradientColors.reverse()
#upGradients order becomes reversed
downGradientColors = upGradientColors
downGradient = Gradient('grade000')
downGradient.createBalancedGradient(downGradientColors)
    
upTriangles = docu.makeGroup('upsies')
for i in range(levels-1):
    for j in range(i+1):
        upGradient.id = 'upgrade' + str(i*11+j)
        docu.appendDefinition(upGradient.createDefinition())
        points = []
        points = [tetractysArray[i][j],  tetractysArray[i+1][j+1],  tetractysArray[i+1][j] ]
        upTriangles.append(gradshape.polygonGradient(docu, points, upGradient, id ='up'+str(i*11+j)))
faceGroup.append(upTriangles)

downTriangles = docu.makeGroup('downsies')
for i in range(1, levels-1):
    for j in range(i):
        downGradient.id = 'downgrade' + str(i*11+j)
        docu.appendDefinition(downGradient.createDefinition())
        points = []
        points = [tetractysArray[i][j],  tetractysArray[i+1][j+1], tetractysArray[i][j+1]]
        downTriangles.append(gradshape.polygonGradient(docu, points, downGradient, id ='down'+str(i*11+j) ))
faceGroup.append(downTriangles)
 
docu.append(faceGroup)

###create shaded overlay