#!/usr/bin/env python3 """Compile audited access refinements against the original survey plus placed markers.""" import argparse import importlib.util import json from pathlib import Path ROOT=Path(__file__).resolve().parents[1] spec=importlib.util.spec_from_file_location('mark',ROOT/'scripts/mark-shacraft-layout.py') mark=importlib.util.module_from_spec(spec);spec.loader.exec_module(mark) def main(): p=argparse.ArgumentParser();p.add_argument('--before',type=Path,required=True) p.add_argument('--base',type=Path,required=True);p.add_argument('--study',type=Path,required=True) p.add_argument('--access',type=Path,required=True);p.add_argument('--output',type=Path,required=True) a=p.parse_args();before=json.loads(a.before.read_text());base=json.loads(a.base.read_text()) study=json.loads(a.study.read_text());access=json.loads(a.access.read_text());desired={} old={(b['x'],b['y'],b['z']):b['block'] for b in base['blocks']} def ground(x,z): i=(z-before['min_z'])*before['width']+x-before['min_x'] return before['surface_y'][i],before['palette'][before['material_index'][i]] def put(x,z,block,group,y=None): x,z=round(x),round(z);h,material=ground(x,z);y=max(h,51) if y is None else y if y