geometry1.py 文件源码

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

项目:Tweezer_design 作者: AntoineRiaud 项目源码 文件源码
def IDT_union(IDT_data):
    IDT = IDT_data['IDT']
    branch0 = IDT_data['electrodes']['elect0']
    branch1 = IDT_data['electrodes']['elect1']
    removal0 = IDT_data['removal']['removal0']
    removal1 = IDT_data['removal']['removal1']
    #reticule = IDT_data['reticule']
    removal_center = IDT_data['removal']['removal_center']
    for polygon in IDT[0]:
        branch0 = branch0.union(polygon)       
    branch0 = branch0.difference(removal1)
    if 'Hole_elect0' in IDT_data['removal'].keys():
        branch0 = branch0.difference(IDT_data['removal']['Hole_elect0'])
    branch0 = branch0.difference(removal_center)

    for polygon in IDT[1]:
        branch1 = branch1.union(polygon)
    branch1 = branch1.difference(removal0)
    if 'Hole_elect1' in IDT_data['removal'].keys():
        branch1 = branch1.difference(IDT_data['removal']['Hole_elect1'])
    branch1 = branch1.difference(removal_center)

    IDT_data['branch0']=branch0
    IDT_data['branch1']=branch1
    IDT_merged = IDT[0]+IDT[1]
    IDT_bounds = shapely_geom.MultiPolygon(IDT_merged)
    IDT_bounds = IDT_bounds.convex_hull
    IDT_data['convex_hull'] = IDT_bounds
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号