\subsection{One cap}\label{sec:joined-ends} Use \(X\) along the wall and \(Z\) perpendicular to it. In these coordinates one end is \(0\le X\le w,\ 0\le Z\le L+\mu X\). A \emph{chain} is the part of an end between two prescribed vertical lines. Its abscissa starts at zero, and \(L\) then denotes the actual roof height at that starting line. Inside a chain, a \emph{cap} is a central trapezoid between two successive vertical \emph{cuts}, with its own abscissa \(v\) starting at its left cut and its own left roof height, again denoted \(L\) when a single cap is considered. The two portions of a chain outside all central caps are its \emph{terminals}; they will be filled with vertical stacks of horizontal units. Figure~\ref{fig:cap} shows one cap. \begin{lemma}[One cap and its available intervals]\label{lem:cut-cap} In a cap of width \(B\) and left roof height \(L\) write \(g(v)=L+\mu v\), \(\bar L=g(B)\), and \(M=\lfloor\bar L\rfloor+1\). Let \(0<\alpha<\pi/2\), \(c=\cos\alpha,\ s=\sin\alpha,\ \tau=s/c,\ \lambda=1/c,\ q=1-c\). Assume \(\mu\ge0,\ Mc+s\le L,\ B-M\tau\ge \lambda\). Set \begin{gather} I=\lfloor(B-M\tau)/\lambda\rfloor,\qquad \xi_i=M\tau+i\lambda,\qquad J_i=\left\lfloor\frac{g(i\lambda)-Mc-s}{q}\right\rfloor , \label{eq:chain-columns}\\ R=\lfloor L\rfloor,\qquad J=\max\{J_{I-1},\lfloor g(\xi_I-\bar L\tau)\rfloor\},\qquad p(j)=\#\{i0\). For the whole-width assertion use \(j+1\le J_0\le Mc+s+qJ_0\le L\) and the fact that all tilted columns start at or above \(J_0\). \end{proof} \begin{figure}[!tb] \centering \begin{tikzpicture}[scale=0.42,>={Stealth[length=1.8mm]}] \input{fig-cap-data} \draw[<->] (0,-0.9)--(\capB,-0.9) node[midway,below] {\(B\)}; \draw[<->] (-0.9,0)--(-0.9,\capL) node[midway,left] {\(L\)}; \draw[<->] (\capB+0.9,0)--(\capB+0.9,\capLbar) node[midway,right] {\(\bar L\)}; \node[font=\small,fill=white,inner sep=1.5pt] at (3.6,3.5) {left intervals}; \node[font=\small,fill=white,inner sep=1.5pt] at (21.5,3.5) {right intervals}; \node[font=\small,fill=white,inner sep=1.5pt] at (14.2,15.6) {tilted columns}; \node[font=\small,above] at (15,20.5) {roof \(Z=L+\mu v\)}; \end{tikzpicture} \caption{A cap as in Lemma~\ref{lem:cut-cap}, drawn from the formulas with \(L=20\), \(B=30\), \(\mu=1/50\) and \(\tan(\alpha/2)=1/4\), so that \(M=21\) and there are \(I=16\) columns. Dark squares are the tilted units; light rectangles are the reserved horizontal intervals \eqref{eq:chain-intervals}, one pair per unit level. The tilt is exaggerated: in the construction \(\alpha\) is of order \(1/n\).} \label{fig:cap} \end{figure} The top of a column can be adjusted in steps of \(q=1-\cos\alpha\) by changing its base level \(J_i\), so the columns follow the roof almost exactly. The rounding loss is transferred to the horizontal intervals. The next lemma measures the area before those intervals are rounded down to whole units. \begin{lemma}[Area before the horizontal rows are rounded]\label{lem:ideal-cap} In one cap of width \(B\) and left roof height \(L\), let \(\mathcal U\) be the number of inclined units plus the areas of the two families of reserved horizontal rectangles. Suppose that, for a real number \(n\ge64\), \[ B\le n^2+2,\qquad M\le35n^2,\qquad 0\le\mu n^2\le3,\qquad 0<\tau n\le 11/10 . \] Then \(0\le B L+\mu B^2/2-\mathcal U\le500n\). \end{lemma} \begin{proof} Recall that \(\xi_0=M\tau\). Put \(P=B-\xi_0\) and \(\rho=P-I\lambda\); thus \(0\le\rho<\lambda\) and \(\xi_I=B-\rho\). Summing the right intervals uses \(\sum_{j