geometry1.py 文件源码

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

项目:Tweezer_design 作者: AntoineRiaud 项目源码 文件源码
def Import_SVG_route(IDT_data):
    route_filename = IDT_data['svg_route']
    all_points = SVGT.read_path_from_svg(route_filename)
    route =[]
    for points in all_points:
        route.append(shapely_geom.Polygon(points.T))
    route = shapely_geom.MultiPolygon(route)
    #outbox = route.bounds
    #dx = outbox[2]-outbox[0]
    #dy = outbox[3]-outbox[1]
    #x0 = outbox[0]+dx/2
    #y0 = outbox[1]+dy/2
    x0svg = 4000
    y0svg = 4000
    factor = 1e-5;
    route = shapely_affinity.translate(route, xoff=-x0svg, yoff=-y0svg) 
    route = shapely_affinity.scale(route, xfact = factor, yfact= factor, origin=(0,0,0))
    IDT_data['route'] = route
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号