fix: close remaining CAD delivery review gaps
This commit is contained in:
@@ -832,7 +832,9 @@ def compute_caps(floors: dict[str, Any], config: dict[str, Any]) -> None:
|
||||
"""
|
||||
if not config.get("generate_caps", True):
|
||||
return
|
||||
buf = float(config.get("cap_buffer", 1.3))
|
||||
# Ordinary facade-aligned floors need only a small tolerance. Colonnade or
|
||||
# broad-overhang projects such as A208 must opt into a larger value.
|
||||
buf = float(config.get("cap_buffer", 0.1))
|
||||
for fk, fl in floors.items():
|
||||
own_polys = fl.get("footprint", {}).get("polygons", [])
|
||||
if not own_polys:
|
||||
@@ -856,7 +858,14 @@ def compute_caps(floors: dict[str, Any], config: dict[str, Any]) -> None:
|
||||
polys = [] # roof_specs handles above-ground tops
|
||||
else:
|
||||
up_u = _shapely_union(upper)
|
||||
polys = _shapely_to_polys(own_u.buffer(buf).difference(up_u.buffer(0.05))) if up_u is not None else []
|
||||
# A 0.1 m facade tolerance creates a thin evidence ring whose area
|
||||
# can be below the generic 3 m² polygon-noise threshold on small
|
||||
# buildings. Caps are already footprint-derived, so retain them.
|
||||
polys = (
|
||||
_shapely_to_polys(own_u.buffer(buf).difference(up_u.buffer(0.05)), min_area=0.25)
|
||||
if up_u is not None
|
||||
else []
|
||||
)
|
||||
if polys:
|
||||
fl.setdefault("caps", []).append({"z": round(ftop, 6), "polygons": polys})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user