3D Surface Generation Algorithm Using Lagrange Basis Functions in CAD/CAM Application

: The objective of this paper is to create an efficient and accurate 3D surface interior data depending on primary initial data based on Lagrangian interpolation concept. The presented algorithm of 3D surface generation is an extended of the conventional Lagrangian interpolation (1D). The interior data of the designed surface have been transformed automatically to a vertical CNC milling machine (Bridge-port) through the serial port (RS232) to machine the designed 3D surfaces, where the toolpath have been generated based on linear interpolation techniques

number of different methods to represent curves and surfaces.He involves a relatively small number of control points to describe a potentially very detailed curve or surface. [1] Xiaogang Guo (1998) represents Bezier and B-spline for creating curve and surface methods.The definition for surface reconstruction maybe related in terms of parametric form. [2] Bert Juttler (2004) present a method for approximate parameterization of a planer algebric curve by a relational Bezier (spline) curve. [3]

2-Approximation Using Polynomial Interpolation:
The methods employed in polynomial approximation fall into two fairly distinct classes [4,5] .In the first the functions to be approximated are known, and can be evaluated, at all points in some range of x. for example, finding the cubic polynomial which is the best approximation to the function x e over the interval . There are several possible criteria of best fit, and a considerable amount of theory exists on problems of this type.Much of it involves orthogonal polynomials such as Legendre and Chebyshev polynomials.In the second class, which apply when the function ) (x y to be approximated https://doi.org/10.30684/etj.26.11.7 University of Technology-Iraq, Baghdad, Iraq/2412-0758 This is an open access article under the CC BY 4.0 license http://creativecommons.org/licenses/by/4.0Eng.&Tech.Vol.26.No.11,2008   3D Surface Generation Algorithm Using Lagrange Basis Functions in CAD/CAM Application is given in a tabulated form, so that y-values are only available for discrete values of (x).The procedure adopted will depend upon whether: [1] 1-The given points ) , ( i i y x are known to contain statistical or other fluctuations, or 2-They are known to be reliable.Typical example might be (1) points resulting from some experimental procedure which is subject to errors of measurement, and (2) points taken from standard tables such as log table .In case (2) it is reasonable to construct an interpolating function which actually passes through all the given points ) , ( i i y x . In case (1) this could lead to disastrous results; an interpolating function might well have the effect of amplifying the statistical fluctuations of the data, when what is really required is that these should be smoothed out.When the data points are unreliable, then, seek an approximating function which passes close to all the points but not necessarily through any of them.Since some curve and surface fitting systems employ a preliminary stage of this kind to smooth out anomalies in the data supplied, illustrating a standard method of approach for case (1) in the following section. [7]

2-1-Lagrange's Technique:
Determining a polynomial which passes through just given points which concern the exact fitting of reliable data in two ways: [8]

2-1-1-(1-D) Interpolation ( y=F(x)):
Interpolating polynomial of nth degree of a sequence of planar points defined by Short notation for this formula is: where ∏ denotes multiplication of the n factors obtained by varying j from (o to n), excluding j i = , it can be observed that the function multiplying i y is equal to unit when i x x = but becomes zero when (x) equals any of the other coordinates. [10]he equation of a line between two points is obtained by setting n=2: The Lagrange polynomial has the disadvantage of having the degree of the polynomial tied to the number of points used.The number of points used is increased.The result is polynomial of higher degree subject.At this work a block diagram Figure (1) and program have been proposed to solve classical Lagrange interpolation problem.After computing the control points data through lagrangian interpolation the curve equation can be derived as follows:- [13] Eng.&Tech.Vol.26.No.11,2008   3D Surface Generation Algorithm Using Lagrange Basis Functions in CAD/CAM Application Assume Curve with 3 rd degree can be presented using Lagrange technique through the assumption that the curve pass through four points as an example: 4, 3) the curve equation can be derived as before [5] :-

2-2-2-(2-D) Interpolation (z=F(x,y)) :
In this work adopted method (2D Lagrange interpolation) of surface data generation has been implemented, tested and evaluated. [10]e adopted method is an extension to the earlier interpolation method (1D) but by computing both (x) and (y) data to drive the (z) data as in general form of ) , ( y x F z = The mathematical solution steps of the proposed method can be formulated as follows: Step-1-Considering a sequence of planar points defined by:- Step-2-The interpolating polynomial of n th , m th degree can be formulated as: Step-3-The determination of Lagrange coefficients in both direction (x,y) can be invested to determine the interior data of the desired surface depending on a few initial data. [10]igure ( 4) illustrates the Lagrangian coefficients ( ) of 3D surface.While The block diagram of the adopted technique illustrate in figure (5). [14,15] more details the flow chart of the proposed technique illustrated in Figure ( 6) explain each step of the program that have been built to generate the interior data of the desired 3D surface while this program was linked with Matlab (V.6.5)software to represent the desired 3D surfaces in graphical mode.

3-Testing the Proposed Technique:
Based on the data of initial control points it's able to generate the interior data of the 3D surface and the surface can be represented, with the aid of (Matlab V.6.5)soft-ware.
The following examples have been solved as a test to the adopted technique.
Because the control point matrix is 3×3 then the generated surface is of the 2 nd degree that mean the surface equation will be (n-1) degree of the control points.
The mathematical representation of the desired surface can be derived: ( The derived mathematical equation of the desired surface is:

4-LagrangianTechnique Limitations:
Although the proposed technique gives good results but there are some limitations which are:-1 The value of (x) in (1D) must be increased or decreased

5-3D Surface Machining:
Eng.&Tech.Vol.26.No.11,2008   3D Surface Generation Algorithm Using Lagrange Basis Functions in CAD/CAM Application The technique has been tested through designing several different surfaces depending on a few data of control points, the design have been implemented to machined two surfaces through a vertical CNC milling machine where the design data have been automatically transferred from the PC to the CNC machine through [RS 232 serial port].
The input data as a wireframe have been manipulated to generate the interior data of the surface.Then, the surfaces have been represented and the toolpath generated then this data are transformed to the CNC machine tool.The tool path and the machined surface are illustrated in Fig. (12, 13,  14, 15).

6-Conclusions
It has been proved that the interior data of 3D surfaces can be successfully derived depending on a few control points using Lagrange techniques then the desired surface can be constructed and represented were the adopted technique coded in graphic software like Matlab that used at this paper.) of a 3D surface [16] Eng.&Tech.Vol.26.No.11,2008   3D Surface Generation Algorithm Using Lagrange Basis Functions in CAD/CAM Application Eng.&Tech.Vol.26.No.11,2008   3D Surface Generation Algorithm Using Lagrange Basis Functions in CAD/CAM Application

)
With the aid of Matlab software, the graphical mode of the desired surface can be presented as shown in Fig. (6).
of Lagrange surface compared with interior data of surfaces generated according to (Hermite, Bezier, B-Spline techniques) are illustrated in Figure (10), while the results of the comparison of these surfaces are presented in Table (1).
of the Lagrange's equation depends on the number of control points.4 When the degree of the Lagrange equations is more than 6 th order the Z-deviation of surface will be increased greatly.As shown in Figure(11).

Figure
Figure (5): Flowchart of the proposed program

Table 1 :
Comparison results with Parabola Functions.