import json, subprocess, sys, re B = r"D:\★Pier 자료\심수석님 검토 파일\Ramp-A교P1" F3 = B + r"\Ramp-A교 P1 교각(3).dxf" F4 = B + r"\Ramp-A교 P1 교각(4).dxf" S = json.load(open('ra_shapes.json', encoding='utf-8')) T3 = json.load(open('ra_texts3.json', encoding='utf-8')) T4 = json.load(open('ra_texts4.json', encoding='utf-8')) cell = {} for e in S: cell.setdefault(e['mark'], (e['x'], e['y'])) jobs = [] for mk, (x, y) in cell.items(): jobs.append((F3, 'cell_%s' % mk, x - 3800, x + 3600, y - 450, y + 2700, 1500)) for x, y, l, t, h in T3: if l.startswith('CS-TABL') and abs(x - 64862) < 5 and re.match(r'^[A-Z]\d+$', t.strip()) and -708000 < y < -699500: jobs.append((F3, 'row_%s' % t.strip(), 64300, 73800, y - 170, y + 190, 1700)) jobs.append((F3, 'row_head', 64300, 73800, -699600, -699150, 1700)) for x, y, l, t, h in T4: if l.startswith('CS-TABL') and -707200 < y < -705500 and re.match(r'^(P\d(-\d)?)$', t.strip()) and round(x) in (89586, 99898): x0, x1 = (89000, 98200) if round(x) == 89586 else (99300, 108500) jobs.append((F4, 'row_%s' % t.strip(), x0, x1, y - 170, y + 190, 1700)) jobs.append((F4, 'row_head4', 89000, 98200, -705260, -704900, 1700)) jobs.append((F4, 'row_head4r', 99300, 108500, -705650, -705300, 1700)) for F, name, x0, x1, y0, y1, w in jobs: subprocess.run([sys.executable, '-I', 'fastrender.py', F, str(x0), str(x1), str(y0), str(y1), 'ra_crops/%s.png' % name, str(w), 'dark'], check=True, stdout=subprocess.DEVNULL) print(len(jobs))