Cut 13b: clean FloorSlab wing scope and trim LOD2/RCGA under 85 MiB

This commit is contained in:
Meta Vens 2026-12-06 03:12:10 +01:00
commit 44fb67a58a

View file

@ -1346,7 +1346,7 @@ def build_cga_building(
wall_thick = 0.85 if is_mauer else (0.68 if micro_zone == MICRO_FORTRESS else 0.45)
slab_inset = min(wall_thick * 0.45, 0.20)
slab_polys_uv: list[Polygon] = []
for pfp in plinth_fps:
for pfp in (plinth_fp,):
sfp = pfp.simplify(2.0, preserve_topology=True)
if not isinstance(sfp, Polygon) or sfp.is_empty or sfp.area < 0.8:
sfp = pfp
@ -1388,9 +1388,9 @@ def build_cga_building(
if len(zones) >= MAX_ZONES_PER_BUILDING - n_roofs - 1:
break
want_win = (not is_mauer) and (
(hero_zone and blen >= 4.5 and t_idx == 0 and (b_i == 0 or (micro_zone in (MICRO_FORTRESS, MICRO_CIVIC) and b_i == 2 and blen >= 6.0)))
or (micro_zone in (MICRO_VISSIGEN, MICRO_CLAVAU, MICRO_SUBURBAN) and blen >= 7.2 and b_i == 0 and t_idx == 0)
or (micro_zone == MICRO_RONQUOZ and blen >= 9.5 and b_i == 0 and t_idx == 0)
(hero_zone and blen >= 5.2 and t_idx == 0 and (b_i == 0 or (micro_zone in (MICRO_FORTRESS, MICRO_CIVIC) and b_i == 2 and blen >= 6.5)))
or (micro_zone in (MICRO_VISSIGEN, MICRO_CLAVAU, MICRO_SUBURBAN) and blen >= 8.2 and b_i == 0 and t_idx == 0)
or (micro_zone == MICRO_RONQUOZ and blen >= 11.0 and b_i == 0 and t_idx == 0)
)
r_parts, c_parts, has_win = _build_wall_bay_geometry(
sa, sb, blen, y0, bay_y_top, wall_thick, pal, micro_zone,
@ -1450,8 +1450,12 @@ def build_cga_building(
else:
r_sup = plinth_bit
add_zone(ZONE_ROOF_SEGMENT, pal["roof_class"], ZONE_FLAG_EXTERIOR, r_sup, r_render, r_render)
if r_i < lod2_roof_cap:
lod2_solids.append((r_col[2], pal["roof"]))
# In LOD2, skip redundant flat top slab when building has flat roof unless hero_zone (pitched/spires always kept)
if r_i < lod2_roof_cap and (hero_zone or len(r_rtd) > 0):
r_l2 = r_col[2]
if not hero_zone and (float(np.max(r_l2[:, :, 1])) - float(np.min(r_l2[:, :, 1])) < 0.55):
continue
lod2_solids.append((r_l2, pal["roof"]))
all_pts_bounds = np.vstack([z.render_tris.reshape(-1, 3) for z in zones] + [z.col_tris.reshape(-1, 3) for z in zones])
bmin = all_pts_bounds.min(axis=0)