import { useWindStore } from '../../store/windStore'; export const RoofZonesDiagram = () => { const { inputs } = useWindStore(); const { width: B, length: L } = inputs.dimensions; // SVG scaling const padding = 40; const svgWidth = 300; const svgHeight = 250; // Normalize dimensions const maxDim = Math.max(B, L); const scale = (Math.min(svgWidth, svgHeight) - 2 * padding) / maxDim; const sB = B * scale; const sL = L * scale; const startX = (svgWidth - sB) / 2; const startY = (svgHeight - sL) / 2; // a distance (end zone width) // a = Max(Min(0.1*B, 0.4*h), 0.04*B, 3.00) usually. // For now, let's estimate 'a' visually as 10% of B or L. // We should implement specific 'a' calculation in logic, but for diagram we can approximate or use calculation if available. // Let's approximate a = 0.1 * min(B, L) const a_real = Math.max(Math.min(0.1 * B, 0.4 * 15), 0.04 * B, 3); // using h=15 approx const a = a_real * scale; return (
Roof Zones (ASCE 7 Figure 28.3-1)
{/* Main Roof Rect */} {/* Ridge Line (assuming L is ridge direction? No, usually B is width, L is length. Diagram shows ridge parallel to L or B?) Screenshot Loading... Figure 28.3-1 shows L parallel to ridge. So ridge is horizontal in the middle of B? If L is parallel to ridge, then ridge runs along L. So ridge line is from (0, L/2) to (B, L/2) ? No, from (width/2, 0) to (width/2, L). Wait, diagram "L = dimension parallel to ridge". So ridge length = L. So ridge runs along length L. If Plan view has B vertical and L horizontal? Let's assume standard orientation: B is width (vertical in plan), L is length (horizontal). Ridge runs horizontal. */} {/* Let's draw based on sB (width) and sL (length). Assume ridge bisects sB. */} {/* Zone Lines */} {/* Zone 2E is corners, Zone 3 is corners? No. Zone 3 is corners. Zone 2 is edges. Zone 1 is interior. Actually Figure 28.3-1: Corners are 3. Edges parallel to ridge are 2. Edges perpendicular to ridge are 2? Let's roughly draw 'a' strips. */} {/* Corner zones (3) */} {/* Label Corners '3' */} 3 3 3 3 {/* Edge Strips (2) - Excluding corners */} {/* Interior (1) */} 1 1 {/* Dimension a */} a
Approx. End Zone Width a = {a_real.toFixed(1)} ft
); };