hexmath.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:UberLens 作者: adamalawrence 项目源码 文件源码
def overlay_generator(hexgrid, depth=params.shells, major=params.major):
    # GPolygon.RegularPoly(coord,major,poly,rot,"#000000",strokeOpacity,linethick,"#00ffff",fillalpha)
    s1 = ''
    numhextiles = float(len(hexgrid))
    for idx, hexel in enumerate(hexgrid):
        speckle = random.gauss(1, 0.5)
        rank = int((speckle * idx / numhextiles) * 15)
        invrank = 15 - rank
        blue = hex(rank)[2:]
        red = hex(invrank)[2:]
        tilecolor = red + red + '00' + blue + blue
        ts = "map.addOverlay(GPolygon.RegularPoly(new GLatLng{coord},\
            {major},6,90,\"\#{strokeColor}\",{strokeOpacity},{strokeWeight},\"\#{fillColor}\",{fillalpha}))\
            \n".format(coord=hexel, major=major, strokeColor=tilecolor, strokeOpacity=params.opacity,
                       strokeWeight=params.strokeWeight, fillColor=tilecolor, fillalpha=params.opacity)
        s1 += ts
    return s1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号