Optimal Intersection Curves for Surfaces

In this article, an algorithm has been established to approximate parametric-parametric, explicit-implicit, and explicit-explicit surface intersection. Foremost, it extracts the characteristic points (boundary and turning points) from the sequence of intersection points and fits an optimal cubic spline curve to these points. Moreover, this paper utilizes genetic algorithm (GA) for optimization of shape parameters in the portrayal of cubic spline so that the error is minimal. The proposed algorithm is demonstrated with different types of surfaces to analyze its robustness and proficiency. In the end, all illustrations show the effectiveness of the algorithm which makes it more influential to resolve all complexities arises during intersection with a minimal error.


Introduction
Surface/surface intersection (SSI) has enormous applications in diverse fields while dealing with two surfaces/curves' intersection problems. It is a fundamental ingredient in computer graphics to develop different shapes of ultrasonic machines (3D images from ultrasonic machines can be joined with CAD images for good results), airplanes, architecture designs, etc., via a variety of surfaces. With the advancement in 3D technologies, such as in laser scanning, one can scan more precisely even at a significant distance. Similarly, in engineering, curve of intersection (COI) is achieved by the intersection of different solids such as prismprism, prism-cone, and cone-cone. It deals with complex mathematical geometry which arises in designing of automotive at large scale. A huge collection of work, extending back quite a few years, addresses the issues related to SSI.
is is still an important issue in industrial engineering and mathematical fields. Usually, nonempty intersection intends to find an error bound for approximation of intersection curves, see, for example, [1][2][3][4][5] and references therein. e algorithm proposed in [6] focused on evaluating intersection curves of rational polynomial parametric surface patches, which is based on a validated ordinary differential equation system solver. Later on, they emphasized on the marching method [7] for solving problems which offer remarkable advantages, but still their approach is facing some problems because of complicated initial and boundary values. In the same way, an approach in [8] worked on solving differential geometry problems of hypersurfaces; also, they are doing this research [9] by increasing dimensions of surfaces which take more time for showing results. Extracting boundary and turning points of parametric surface intersection curves by the GK method are discussed in [10,11]. eir topology is still confronting problems of error that come up through surface intersection. Also, the methodology in [12] is used for finding characteristics points, but excess of points are calculated for appropriate results.
Explicit and implicit surfaces are not extensively used in a variety of fields, but researchers did remarkable work whatever the circumstances occurred during research. In the medical field, scientists used an explicit surface-based method for the cortical thickness of the brain [13]; still, they are doing their work on that purpose. In CAD, hybrid models can be merged with explicit models [14] for removing ambiguities and getting better graphic results. e problems occurring in ocean-free surface models can be solved explicitly or implicitly. In explicit surfaces, scaling behavior on parallel systems is better than implicit schemes [15] because baro-clinic time steps are used in implicit surfaces and are larger than the time-stepping scheme in explicit surfaces.
Collectively, methods involving implicit surfaces are quite diffusive because global communication in each iteration makes the method's scale poorer; while explicit surface methods have flexibility to resolve all possible difficulties during the iteration process. e combination of these surfaces is good for intersection because if one surface is creating some problem during intersection the other may overcome the situation.
Soft computing behavior such as computational intelligence, is a blend of different techniques such as fuzzy logic [16], simulated annealing, genetic algorithm, numerical technics [17], etc., whose objective is to solve computational problems which is based on natural evolution theory [18], which is not easily demonstrated numerically. In this research work, a genetic algorithm is utilized, which is useful in getting optimal outcomes.
While a lot of work has been done on SSI issues, still there is hardly any established algorithm which can deal intersection of all types of surfaces. Each approach that was discussed in the previous section has its own disadvantages and limits. is motivated us to develop an optimal technique using genetic algorithm and cubic spline function, which can be used to approximate intersections of wider range of surfaces. e technique proposed in this paper works equally well to approximate intersection curves for following three cases of intersection of surfaces: 1 Intersection of two explicit surfaces 2 Intersection of one implicit and one explicit surface 3 Intersection of two parametric surfaces is paper is organized as follows. Section 2 includes the materials and methods of proposed approach. Genetic algorithm is discussed in Section 3. Results and discussion is given in Section 4. is paper is concluded in Section 5.

Materials and Methods
e proposed approach takes two surfaces as input. ese surfaces may consist of two explicit surfaces s 1 and s 2 in R 3 , which are defined as where a, b, c, d ∈ R.
One implicit and one explicit surface h 1 and h 2 are represented by where a, b, c, d, e, f ∈ R.
Two parametric surfaces z 1 and z 2 in R 3 are denoted as where a, b, c, d ∈ R.
In order to find sequence of intersection points of all above surfaces, the solution of the following equations is required, respectively: Additionally, its nonempty intersection contains isolated sequence points and curves of intersected pieces.

Characteristic Points.
Characteristic points are the subset of the sequence of intersection points which helps to identify the shape of intersection curves, including all the turning and boundary points.

Boundary Points.
e boundary points can be determined by imposing the following conditions:

Turning Point.
A point where curve changes its direction or where intersected curve makes a sharp turn is called turning point. e turning points can be estimated by finding (i) e inflection point of equation (4) (ii) e points where curve (4) has slope 0, 1, or −1 (iii) Where the function changes its curvature (iv) When derivative changes its sign 2.2. Cubic Spline Interpolant. Cubic spline function [19] is used to fit the curve at the points obtained in the previous section. Let F i and F i+1 , i � 1, 2, . . . , n − 1, be distinct characteristic points. Moreover, the slope of tangent associated to these points is denoted by D i , D i+1 , and v i and w i are shape control parameters. en, the cubic function is considered as satisfying the following properties: Journal of Mathematics where P (1) denotes first derivative with respect to t, which yields interpolating conditions as So, P i (t) takes the form: e above equation can be rewritten as e functions R j,i , j � 0, 1, 2, 3, are like Bernstein Bezier basis functions such that 3 j�0 R j,i (t) � 1.
Two cases of optimal intersection curve are discussed below.
In order to achieve optimal curve fitted to characteristic points, the sum of squares of distances between data (intersection) points P i,j ′ � (x i,j , y i,j ) and approximated points using cubic spline P(t j ) should be minimized, i.e., where chord length parameterization which is used for parameter t needs to be minimized. In this procedure, such values of the shape control parameters v i and w i must be chosen with the help of genetic algorithm so that S i (equation (11)) is minimal and the following two cases may arise to do so.
Shape parameters are taken as equal in this case, so the objective function (11) depends on one variable only.
Shape parameters are not taken as equal in this case. e process of finding the best curve is the same as above by taking objective function (11) as a function of two variables. Moreover, in this paper, results are obtained using case 2 as case 1 is special case of case 2.

Genetic Algorithm
As cubic spline has two parameters v i and w i , in case of achieving optimal values of v and w, a soft computing technique, i.e., genetic algorithm (GA) [18] is used. Genetic algorithm is one of the powerful evolutionary-based optimization technique to tackle complicated optimization problems. It forms adaptive patterns of searching, based on natural genetics and designs of natural selection. Natural evolution process works under some genetic operators (selection, crossover, and mutation). is procedure moves from one parent population (chromosomes) to another by using genetic operators where every chromosome consists of more than one bit strings. Selection operator helps selecting chromosome which allowed to reproduce and would die out. Crossover operator generates new chromosomes by exchanging some area of two bit strings (chromosomes) mutually. Mutation operator disseminates some new characteristics among the bit strings for more variety of chromosomes. Figure 1 shows an example of crossover and mutation operator for some particular choice of chromosomes.
GA does not need any lengthy mathematical formulation for better results and rise as a significant technique which solves complex problems in short time with appropriate results. GA choses random values of the parameters v i , w i from certain population and application of iterated process of GA along with genetic operators, selection, mutation, and crossover which specifically fit the optimal curve to intersection points by finding optimal values of shape control parameters v i , w i .
For best curve fitted to given data, those values of shape parameters are required, for which the sums S i should be minimized. GA is used to optimize the values of parameters which help in minimizing the error.
In literature, different methods are used for finding the error. e error occurs when approximated points do not lie on the exact location. e error calculated by the proposed technique in this paper is shown in Tables 1-3. e minimized error gives best approximated curve which shows the efficiency of the proposed approach. Table 4 displays values of parameters which are used for GA.

Proposed Algorithm Steps.
e overall proposed scheme can be described in the form of an algorithm.
Step 1: input surface data Step 2: find intersection of surfaces by the method mentioned in Section 2 Step 3: extract the characteristics points through criteria given in Section 2 Step 4: fit the spline curve to the points attained in Step 3 Step 5: compute the best optimal value of parameters v and w by using GA     Step 6: if the optimal curve has been accomplished in

Journal of Mathematics
Step 5, then go to Step 7, otherwise go to Step 4 and repeat these steps until the desired optimal curve is achieved Step 7: Stop

Results and Discussion
e execution of proposed approach on intersection of explicit-explicit, implicit-explicit, and parametric-parametric surfaces has been shown in the following examples.
Example 1. Two explicit surfaces are given by Both explicit surfaces are shown in Figures 2 and 3. Figure 4 depicts intersection of surfaces, while Figure 5 epitomizes the xy-view of intersection along with boundary and turning points which extracted through criteria given in Section 2. Approximation of sequence of points is displayed in Figure 6. Figures 7 and 8 show how cubic spline is used to fit the curve through 1 st and 2 nd iterations of GA. e best optimal curve is given in Figure 9 and achieved in 20 th iteration of GA.
Example 2. Implicit and explicit surfaces are given by Explicit and implicit surfaces are displayed in Figures 10  and 11. Figure 12 portrays intersection of surfaces, while Figure 13 denotes the xy-view of intersection along with boundary and turning points which are extracted through criteria given in Section 2. Approximation of sequence of points is publicized in Figure 14. Figures 15 and 16 represent how cubic spline is used to fit the curve through 1 st and 2 nd iterations of GA. e best optimal curve is shown in Figure 17 and obtained after 24 th iteration of GA.
Example 3. Two parametric surfaces with parameters x, y are given by Both parametric surfaces are shown in Figures 18 and 19. Figure 20 illustrates intersection of surfaces, while Figure 21 demonstrates the xy-view of intersection along with boundary and turning points which extracted through criteria given in Section 2. Approximation of sequence of points is shown in Figure 22. Figures 23 and 24 exemplify how cubic spline is used to fit the curve through 1 st and 2 nd iterations of GA. e best optimal curve is depicted in Figure 25 and produced in 31 st iteration.    Some randomly selected values of shape parameters by GA and characteristics points of Example 1-3 are shown in Tables 1-3. In these tables, CS denotes characteristics points, TNIP denotes the total number of intersection points, E denotes the error, TE denotes time elapsed, and SPV denotes shape parameter values.          Journal of Mathematics

Conclusion
A new scheme together with a genetic algorithm has been introduced to approximate surface to surface (parametricparametric, explicit-implicit, and implicit-implicit) intersection curves. Characteristics points are evaluated from sequence points of surface intersection and fit optimal curve using cubic spine. Finest shape parameter values in cubic spline are selected by genetic algorithm. Moreover, it does not include any extra points for approximation. Finally, the optimal outcomes from the proposed technique suggested that it is more reliable scheme with GA in order to overcome surface intersection problems.

Data Availability
All data required for this research is included within this paper.

Conflicts of Interest
Authors declare that they have no conflicts of interest.