\section{Rendering Pipeline, Limitations, and Troubleshooting}
\label{sec:pipeline-limitations}

\subsection{How visibility is determined}

The renderer combines several ideas.

\begin{enumerate}[leftmargin=2em]
\item It uses two-dimensional bounding boxes to avoid obviously irrelevant pairwise tests.
\item It partitions simplices where geometric intersection makes a single global order impossible.
\item It constructs an occlusion graph for the remaining candidate pairs.
\item It sorts strongly connected components and tries to break cycles by further partitioning along edge planes.
\item It emits the sorted simplices as ordinary TikZ paths.
\end{enumerate}

This is considerably more robust than assigning a single depth statistic to each
object. In particular, triangle--triangle interactions are handled in a way that
survives many intersecting or partially overlapping configurations.

\input{figures/10-partitioning-and-occlusion.tex}

\subsection{What the package does not promise}

The renderer is strong, but it is not a full hidden-surface engine for arbitrary
analytic geometry. The practical limitations are these.

\begin{itemize}[leftmargin=2em]
\item Curves, surfaces, and solids are sampled first. If the sample count is too low, the output approximates the wrong object accurately.
\item Solids are boundary tessellations, not volumetric fills.
\item Labels are rendered after geometry and do not participate in occlusion.
\item The public point command is not currently exported by the style file.
\item Some cyclic occlusion configurations may remain unresolved after recursive partitioning, in which case the package warns that the order may be unstable.
\end{itemize}

The last point is rare but conceptually important. Occlusion among sampled pieces
can form cycles. The package tries to resolve those cycles by partitioning, but it
eventually stops recursing rather than partitioning forever.

\subsection{Reading the package behavior correctly}

When a rendered scene looks wrong, the failure is often one of the following.

\paragraph{Too few samples.}
If a surface boundary or a curve appears faceted or visibly misplaced, increase
the sample counts first.

\paragraph{Transformation order reversed.}
If geometry appears in the wrong place or orientation, re-check the row-vector
composition order from Section~\ref{sec:transforms}.

\paragraph{Lighting style omitted.}
If triangles ignore lights, verify that \verb|fill options| mentions
\verb|ltdtbrightness|.

\paragraph{Filter too aggressive.}
If geometry vanishes unexpectedly, temporarily remove the \verb|filter| key and
confirm that the geometry exists before debugging the predicate.

\paragraph{The wrong abstraction level.}
If the desired figure depends on exact analytic visibility of a continuous object,
refine the discretization until the sampled geometry is an adequate model.

\subsection{Suggestions for a troubleshooting chapter figure}

If you plan to add one final didactic illustration to the manual, a good choice is
an intentionally coarse surface rendered beside the same surface with a refined
sample grid. That figure communicates, in one glance, the single most important
practical limitation of the package: everything interesting happens after the
continuous model has already been discretized.