\section{Low-Level Geometry API}

The geometry module exists mainly to support the renderer, but its methods are
also installed onto the \verb|Vector| and \verb|Matrix| metatables for backward
compatibility. This appendix records the main categories for readers who need to
reason about the implementation or write custom Lua-side utilities.

\subsection{Point-level queries}

The vector metatable receives methods for:

\begin{itemize}[leftmargin=2em]
\item point--point coincidence tests;
\item point-in-triangular-prism tests;
\item point--triangle intersection tests;
\item point versus point, segment, and triangle occlusion comparisons;
\item collinearity and opposite-direction tests.
\end{itemize}

Representative names include
\verb|hpoint_point_intersecting|,
\verb|hpoint_in_triangular_prism|,
\verb|hpoint_triangle_intersecting|,
\verb|hpoint_line_segment_occlusion_sort|, and
\verb|hpoint_triangle_occlusion_sort|.

\subsection{Segment- and triangle-level queries}

The matrix metatable receives methods for:

\begin{itemize}[leftmargin=2em]
\item segment--point, segment--segment, and segment--triangle intersection tests;
\item line--line and line--plane intersections in basis form;
\item partitioning a segment or triangle by another geometric object;
\item segment--segment, segment--triangle, and triangle--triangle occlusion comparisons.
\end{itemize}

Representative names include
\verb|hline_segment_point_intersecting|,
\verb|hline_segment_line_segment_intersection|,
\verb|hline_plane_intersection|,
\verb|hpartition_triangle_by_triangle|, and
\verb|htriangle_triangle_occlusion_sort|.

\subsection{Spatial indexing and sorting}

At the module level, the geometry layer also provides the functions that drive the
renderer itself:

\begin{itemize}[leftmargin=2em]
\item \verb|build_grid| and its candidate-query helpers for two-dimensional spatial indexing;
\item \verb|partition_simplices_by_parents| for recursive splitting based on overlapping parents;
\item \verb|scc| for strongly connected component sorting with cycle handling;
\item \verb|occlusion_sort_simplices| as the main type-dispatch entry point.
\end{itemize}

These functions are useful if you are extending the package internals or if you
need to experiment with the renderer outside TeX. They are not required for normal
document use.

\subsection{A practical boundary}

As a rule, if a task can be expressed through \verb|\setobject| plus the public
append commands, stay at that level. Reach for the low-level geometry API only
when you are deliberately building new package behavior or debugging geometric
edge cases.