## 2 Materials and Methods  
### Scope  
The proposed technique is designed to compute the non-uniform offset of a polyline curve. There are two main inputs of the method:  
* The initial contour: a closed polyline curve, composed by several sequential points in 2D space;
* The offset array, including the offset values for each point; since the offset is non-uniform, the offset value could be different for each point (if the offset array is composed by all the same value a uniform offset is achieved). The output is a new polyline curve generated by offsetting the initial contour points, internally or externally, by the values specified in the offset array. Such offsets should be directed normally to the initial contour (when this operation is possible), and the sign depends on the selection of internal/external direction. In the 2.5 axis milling application, this offset procedure applied to contour, internal (pocket) or external, results in adding a non-uniform machining allowance to the geometry. An example of the desired new polyline is provided in Figure 1, where two different offsets of the initial contour are presented, i.e., small and high magnitude (Figure 1a) applied to external (Figure 1b) and internal (Figure 1c) directions. As is clear from Figure 1, the result of a non-uniform offset on a contour is a new polyline that can be seen as the initial contour with the addition of a machining allowance. The start point is highlighted as a red dot in the figure and the same is provided in the offset evolution plot (Figure 1a), where offset values in the offset array are shown. As a convention, the points move clockwise in the case of an internal offset and counterclockwise in the case of an external offset. The offset result is similar to the one of a classical (i.e., uniform) offset approach, except from the fact that the machining allowance is non-uniform. Such desired polylines cannot be achieved by just projecting the initial contour points along the normal to the contour by the required allowance, especially in the internal scenarios. Indeed, in the external scenario, the resulting points are part of the new contour and a strategy to connect them as in traditional offset can be pursued. In concave scenarios such an approach fails since intersections appear, as shown in Figure 1e. A uniform offset example is provided in Figure 2, where the same initial contour is offset by a constant value (two different values are presented, Figure 2a). In the uniform allowance scenario, the intersections are regular (Figure 2) and approaches to remove them can be pursued, as it is described the uniform offset methods based on trimming [5]. Differently in non-uniform offset, such intersections could be very complex since the offset points could be found in several different configurations depending on the arbitrary different values of allowance (i.e., distance along the normal). Such degrees of freedom could generate complex offset polylines, even with a simple initial contour. An example is provided in Figure 3. In this example, the same initial contour should be offset internally with a variable sinusoidal machining allowance (Figure 3a), the idea is to generate thin walls in two zones, while thick walls are required in the other regions. The desired offset polyline is provided in Figure 3b, while the points projection is in Figure 3c. In this case, the non-uniform offset generates ambiguities. First, the intersections at the center lead to a polyline with three zones, but the center one should be removed, and two polylines must be considered. The second aspect is even more complex, indeed, the fillets between lines generate projected points that affect the actual offset of other points. It is hence clear the need of a general method for an arbitrary non-uniform offset of a contour. The scope of the presented study is detailed in the next section.