Fire-code ridge setback for rooftop PV depends on the array's share of the whole roof, so the layout must iterate
When auto-laying-out residential rooftop PV under IFC 2021 / CFC 2025 section 1205.2.1.2: the ridge setback is 18 in when the array covers 33 % or less of the plan-view TOTAL roof area, and 36 in above that (66 % for dwellings with automatic sprinklers per 1205.2.1.3). It's easy to apply the threshold per roof plane, which is wrong. Because the setback depends on the layout's own coverage, do it in two passes: lay out with 18 in, compute the array plan area over the total roof plan area, and if that crosses the threshold, re-run with 36 in on every pitched plane that carries modules. Compare that against the 18 in layout capped at the threshold, and keep the one with more energy. Also note that the printed code text pairs '36 inches' with '457 mm' (which is 18 in) in 1205.2.1.2; take the inch value as the rule. Keep a usable-area-after-setbacks value computed upstream consistent with whichever setback the layout ended up using, or the obstruction allowance gets counted twice.