Forming of contour-parallel lines family with the detection of their non-working sections

The paper considers family of working contour-parallel lines formation used in the design of the toolpath that processes pocket surfaces. Contour-parallel working lines are the ones from which the lines-noises, i.e. non-working sections, are removed. Non-working sections include self-intersection loops and intersections of oncoming fronts in the case of multiply-connected domains. The spatial geometric model of forming contour-parallel lines is based on the cyclographic mapping. As a tool for detecting non-working sections for the case of oncoming fronts, the method of a testing ray is proposed. In case of self-intersections of contour-parallel lines, non-working sections are cut off by the parameter of these lines at the points of self-intersection. At the output of the proposed shaping algorithm of the working contour-parallel lines family, the parametric equations of these lines are formed. The algorithm successfully works for multiply-connected domains with polygonal and curved contours of the boundaries of the domain and islands in it. A comparative evaluation of the proposed method of forming a contour-parallel lines family with trimming non-working sections and the known methods that use the distance function is performed.


Introduction
In CAD/CAM systems, calculating the cutting toolpath is an important task. Pocket surfaces are usually processed along contour-parallel paths. To calculate the trajectory of the tool that processes these surfaces, it is necessary to build an OC family ("Offset Curve") of the initial contour of the pocket surface. OC families of multiply-connected domains are formed when the pocket area includes islands. Optimization of the OC family of multiply-connected domains involves the analysis of OC and the removal of non-working sections of the OC family lines. Non-working sections of the OC family lines are lines-noises. They are formed as loops of self-intersections of the OC of connected domains (local intersections of the OC) and as sections that are formed when intersecting oncoming fronts of the OC (global intersections of the OC) of multiply-connected domains (figure 1). The analysis of the existing optimization methods for the OC family of multiply-connected domains by the criterion of the absence of lines-noises allows to distinguish the following main directions for solving the optimization problem:

Analysis and trimming non-working sections of the OC family lines by the distance function
The detection of non-working sections of the OC family lines comes down to solving polynomial equations. If the curve of the initial contour of a multiply-connected domain is of an order higher than the second, to find the roots it is necessary to solve equations of high degrees, which leads to a difficult computational problem [1].

Analysis and trimming non-working sections of the OC family lines using MA as a cutting-off tool
This problem is solved on the plane for a simply-connected domain using MA ("Medial Axis") [2][3][4]. On the plane, each MA point is the center of a disk of maximum radius inscribed into the boundary contour. MA in combination with radius function is called "Medial Axis Transformation" (MAT). Analysis and trimming non-working sections of OC is carried out using a complex mathematical apparatus; the computational algorithms are not stable and have a high temporal complexity. The algorithms for finding MA for a domain the boundary of which consists of arcs of circles and line segments work stably. However, if the boundary of the domain has a complex curvilinear shape, the search for MA becomes a difficult task [2][3][4][5][6][7][8][9][10][11]. PH-curves (Pythagorean-Hodograph curves) are used as the boundary lines of the domain [1]. The OC family with step d relative to the boundary curves PH is determined by the equation: in which () rt is initial contour, () n dtis normal distance function. Based on the properties of PH-curves, the lines of the OC family are presented as a set of rational curves. The representation of PH-curves in the Minkowski metric together with the domain decomposition lemma makes it possible to compute the process of trimming the OC family lines for a multiply-connected domain with a curved contour. The procedure for obtaining the cut-off lines of the OC family, i.e., an OC without lines-noises, is carried out in terms of the function of radius of curvature PH-curves and MAT. This allows to obtain the OC family in the form of rational Bezier curves, since the unit normal has a rational dependence on the parameter of the curve t. In some works [12, 13], a pairwise displacement algorithm for closed two-dimensional point sequence curves for a multiply-connected domain with a curved contour consisting of PS-curves (Point-Sequence curves) is presented. In this approach, the loops of self-intersections and intersections of oncoming fronts are removed by the pairwise detection test of non-working sections of the OC family lines. The algorithm can work in linear time. However, point sequences are input data for the proposed algorithm. This algorithm only works with the PS curve class, which limits its capabilities. The algorithm proposed in the research [14] can automatically connect islands to the external contour at the closest distance. But the total time for calculating the minimum distance between two curves depends on the total number of curves, including contour of domain and contours of islands. The OC families of all islands and the OC contours of the domain are combined into a single connected PScurve using Delaunay triangulation [15]. The algorithms work in almost linear time, but the result of the proposed algorithms is point data. A brief review shows the obvious need to develop a model for shaping the OC family with simpler algorithms for trimming non-working sections for multiply-connected domains with curved contours.

Problem definition
To propose a geometric model of shaping the OC family with linear algorithms for trimming their non-working sections.

Analysis and trimming non-working sections of oncoming lines of the OC families of the domain contour and island contours
According to the cyclographic method of forming concept, OC families are obtained by dissecting αsurfaces by a horizontal planes pencil along the z axis with a step z j =const [16]. The section lines form the LOC ("Level Offset Curves") families related to the islands and the contour of the domain belonging to the same level plane in the plane ray.  Therefore, the section (2-1) does not belong to the α-shell. The section (2-1) is non-working and must be cut off. All possible intersections of the lines of the LOC families of the oncoming fronts with the cut-off of non-working sections are analyzed. In the general case, if a testing ray formed from any point on a segment of a line of the LOC family has an odd number of points of intersection with the line of the LOC family of the oncoming front, then the segment belongs to the α-shell. Thus, it is a working section. If the testing ray formed from any point on the line segment of the LOC family has an even number of intersection points, or does not intersect the line of the LOC family of the oncoming front, then the section does not belong to the α-shell; therefore, it is a non-working section. An enlarged algorithm for analyzing global intersections of lines of the OC family is given [17]. The method of analyzing local intersections based on a cyclographic mapping is described in detail in the research work [17]. It should be noted that the input data of the proposed algorithm are arrays of points of the contours of the domain and islands. A discrete set of points is interpolated by a closed curve line. Interpolation can be performed by segments of Bezier curves of the third degree, fractional rational Bezier curves of the second degree, or a contour of segments of second-order curves is constructed from an array of points [18]. The output data of the algorithm are the parametric equations of the working lines of the OC families:

Analysis and trimming self-intersecting loops of the LOC family lines
: ( ) (