"""Regression at the exporter's pure triangle-reference seam; no bpy or scene startup.""" import ast, math from pathlib import Path source = Path('tools/city-massing/assemble-cad-bim.py').read_text(encoding='utf8') functions = {'prism_triangles', 'facade_window_count', 'massing_triangles'} module = ast.Module(body=[n for n in ast.parse(source).body if isinstance(n, ast.FunctionDef) and n.name in functions], type_ignores=[]) scope = {'math': math, 'ARCHITECTURE': True} exec(compile(module, 'triangle-reference-seam', 'exec'), scope) # A notch-sized edge must remain in the solid but cannot fit the 0.35m facade panel. ring = [(0,0),(.2,0),(.2,5),(0,5)] # 4*n-4 shell + 12 door + 2 long-wall windows * 2 triangles * 4 floors. assert scope['massing_triangles'](ring,4,'lod1') == 12+12+16 scope['ARCHITECTURE'] = False # Original large rectangular case retains one window on every edge. assert scope['massing_triangles']([(0,0),(12,0),(12,9),(0,9)],3,'lod1') == 12+12+24 print({'passed':True,'scope':'short surveyed edges counted only as shell; facade reference matches panel size guard','blenderStarted':False})