## 3 Algorithms
### Contour Parallel Algorithms
#### 3.2.1 Geodesic First in Spiral Out (Geo-FISO)  
The FISO Algorithm developed in [37] for the planar case offers a possibility for complete continuity with low curvature. The strategy of traversing isocontours by first  
Figure 3: A grid-like structure in the spirit of draped carbon fiber fabric resulting from layering paths generated by the Ortheo and FInA algorithms. This result is unachievable with classical methods such as tape-laying or hand layup. Filament thickness displayed does not correspond to thickness when printed.  
directly moving into the maxima of the distance transform and then spiraling out along the contours allows for low curvature on inward and outward movement. This enables a continuous path to reach multiple local maxima of the distance transform without travel motions, which would not be possible with classical contour parallel algorithms. To demonstrate the algorithm on a complex and curved surface, the Stanford bunny with an open base was chosen as an exemplary surface as can be seen in Figure 4a.  
The inputs for this algorithm are the triangular surface mesh \(\mathcal{T}\), the spacing \(d\) and the travel height \(h_{r}\).  
\(\gamma\) is taken as the boundary of the surface. If the surface has holes, \(\gamma\) will have a multiplicity of subcurves from which \(\phi\) is computed. The isocontours are again given by \(\{c_{i}\}_{i=1,\ldots,n}\) with \(c_{i}=\{x_{p}|\phi(x_{p})=i\cdot d\}\) with n discontinuities leading to continuous subcurves \(s_{i,j}\) with \(j\in\{0,\ldots,n\}\).  
A weighted digraph G = \(\{V,E\}\) is then constructed with nodes \(v_{i,j}\in V\) corresponding to the subcurves \(s_{i,j}\) and edges \(E=\{e_{i,j;i+1,k}\ |\ \forall i,j,k\}\), i.e., connected for all nodes belonging to \(c_{i}\) and \(c_{i+1}\). The weight function is given by \(f:E\rightarrow\mathbb{R}^{+}\) with \(f(e_{i,j;i+1,k})=d_{min}(s_{i,j},s_{i+1,k})\), with \(d_{min}\) denoting the minimum euclidean distance over all points in \(s_{i,j}\) and \(s_{i+1,k}\), respectively. A minimum spanning tree \(T\) is then computed over this graph, yielding the connections that have to be made when linking the subcurves to a continuous path. This minimum spanning tree is traversed recursively starting with the root node \(v_{0,0}\) which is always set as the outermost subcontour of \(\gamma\). In each step of the recursion, the child nodes of the current node \(v_{i,j}\) are continually checked for distance, while traversing the current contour and checking for possibilities to reroute from the current position to one of them and back. Once a possibility for rerouting is detected, meaning a segment where the distance between the curve and the current path stay below a threshold \(t_{dist}\) for a \(n_{thresh}\) path points, the connection is created and a recursive call is made. Important for a correct connection is to detect the winding direction and connect the curves in the orientation that avoids crossing or overlaps. From experience, \(t_{dist}\) is chosen as \(1.2\cdot d\) to allow for some numerical buffer when rerouting the contours. The choice of \(n_{thresh}\) depends on the resampling resolution \(r_{resample}\) with \(n_{thresh}=\lceil\frac{d}{r_{resample}}\rceil\). Further description of the whole process for the planar case can be found in [37].  
Generally, the usage of the geodesic distance from the boundary can lead to voids at the aforementioned local maxima of \(\phi\). Unwanted gaps can be created by contouring this function at the fixed values \(i\cdot d\) if a local maximum at p fulfills \((j+0.5)d<\phi(p)<(j+1)d\) for some \(j\). This is addressed by the next algorithm.  
Figure 4: Contour parallel algorithms and resulting paths on the Stanford bunny. Travel motions not displayed. With \(d=3.5\) mm (**a**) Geo-FISO, (**b**) Geo-Contour, (**c**) Geo-Spiral. Filament thickness displayed does not correspond to thickness when printed.