import pickle, math, collections, json, sys segs,texts=pickle.load(open('cache_교각배근도(울산P1)_2016.10.28.dxf.pkl','rb')) def dots(x0,x1,y0,y1,maxlen=40,lay=None): S=[s for s in segs if x0<=s[0][0]<=x1 and y0<=s[0][1]<=y1 and x0<=s[1][0]<=x1 and y0<=s[1][1]<=y1 and math.hypot(s[0][0]-s[1][0],s[0][1]-s[1][1])