a cross field on a triangle mesh, the next step in \[alg:ps-overview\] is to construct a quad layout with T-junctions. This is accomplished in two steps:

1.  Determine singularity locations and ports.

2.  Trace out separatrices of the cross field.

In \[sec:singularities-and-ports\], we detail the first step of this process. In \[sec:separatrices\], we describe our approach to streamline tracing, including our novel method for computing the trajectory of a streamline in the neighborhood of a singularity. In \[sec:tangential-crossings\], we discuss stopping conditions for the streamline tracing algorithm as well as a heuristic method for handling tangential streamline crossings that occur commonly when tracing streamlines via numerical integration.

Singularity and Port Detection {#sec:singularities-and-ports}
------------------------------

Singularity and port detection in a cross field defined per node is well documented in the literature [@kowalski_pde_2013; @fogg_automatic_2015; @viertel_approach_2019; @knoppel_globally_2013; @jakob_instant_2015]. We use methods that have been developed previously, but include a description here for completeness.

### Matchings

Across each edge, we assume that crosses make the smallest rotation possible. This is called the *principle matching* of the crosses. If $u_i = e^{4i\theta_i}$, then the change in cross orientation between two nodes $n_i$ and $n_j$, denoted $\Delta_{ij}$, is the number between $-\frac{\pi}{4}$ and $\frac{\pi}{4}$ given by 