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
评论列表
文章目录