3D Model Reconstruction from Two Orthographic Views using Fuzzy Surface Analysis

3D Model Reconstruction from Two Orthographic Views using ABSTRACT The need for revision, the difficulty of visualization, and the impossibility of using 2D drawings as the input of manufacturing machines make us attempt to acquire a 3D model from 2D engineering drawings. However, the main problem in this process is that we encounter many potential uncertainties. In this paper, to overcome this problem, we used the fuzzy logic as a mathematical tool based on knowledge of an expert. One of the most outstanding advantages of using the fuzzy logic is that uncertainty in related equivalent elements in different orthographic views is reduced. Another important feature of this method is that only two orthographic views are used to reconstruct the 3D model, while in previous methods, three orthographic views were used. Reducing the limitations of reconstruction of 3D models will result lower cost because of simulation of production processes on a 3D model and direct connection to CAD/CAM Systems, conservation of natural resources and more security for documents by maintaining drawings in computer memory, improved education quality and increased health level as a result of better visualization using 3D Object which will ultimately lead to sustainable development.


INTRODUCTION
Since the 18 th century, when the projection theory and the descriptive geometry were introduced and used to solve engineering problems, 2D drawings were established in engineering design processes (Jeon et al., 2016;Lee and Han, 2005). Multi-view 2D drawings are not just a powerful presentation of the 3D object but a standard environment between design and manufacturing (Wen et al., 2015) as well and are sometimes used as the principal element showing the production and assembling process (Lee and Han, 2005;Wen et al., 2017aWen et al., , 2017b. In today's societies, due to the limited resources of energy and so the need to quick production processes, the use of automatic systems is necessary (Banapurmath et al., 2018). It also leads to sustainable development that is essential for the modern economy (Elnashaie et al., 2018). In general, an accurate estimation of the geometric condition of the system can lead to a better understanding of the system's behavior and to prevent its possible and potentially harmful effects Jianu and Rosen, 2017;Shahriari et al., 2018). Most contemporary products are described using 2D drawings (Wang and Grinstein, 1993), however, since revising older product designs is a necessity, there are some unavoidable limitations to this type of drawing, some of which are as follows: While both of the above methods have good efficiency, they have serious problems as well. Compared with CSG, the B-Rep method encompasses a wider range of shapes but cannot analyze complicated ones and encounters some uncertainties (Geng et al., 2002). Since it uses Boolean operations, CSG is more efficient in presenting unique solutions (López-Sastre et al., 2013). However, since it uses basic primary shapes to reconstruct 3D objects, it has serious limitations when dealing with complicated shapes.
In both methods, the most serious problem occurs when we want to correlate elements in two different orthographic views (Jiang and Fu, 2011;Su et al., 2013). In fact, this problem appears when there is uncertainty and we need expert opinion and knowledge Wang et al., 2013). One of the most important applications of the fuzzy logic theory as a mathematical method is to correlate vague data sets by making use of expert knowledge (Ross, 2009). This theory was first introduced in 1965 by Professor L. A. Zadeh (1965) and has since become a link between humans and computers, which helps to minimize conflicts in this relation (Dubois and Prade, 1993). Based on this theory, factors and ranges can be categorized without having any precise boundary. The fuzzy logic theory is very useful for solving real-world problems. Vague variables and their impact on the system are called 'psycho-linguistic variables'. This theory can thus be used in various fields such as calculus, topology, the humanities, experimental sciences, engineering, and, in general, wherever expert knowledge is needed (Dubois and Prade, 1993;Gorgani et al., 2017).
In this paper, first, two orthographic views are collated. Using the surface analysis method, two different orthographic views of the two-dimensional object are interconnected. This method is, in fact, a mathematical method based on expert knowledge and is thus precise and flexible. Furthermore, in case 2D engineering drawings are scratched, this method can offer an approximate model for the 3D object. Another advantage is that only two orthographic views are used to reconstruct the 3D model while in methods presented so far, 3 orthographic views have been used. So, we can claim that "the degree of ideality" of our system has improved (Gorgani, 2016b).
One of the limitations of this method, however, is that it can be applied only to models with planar faces and does not include curved faces.

EXPERT KNOWLEDGE: INTRODUCTION TO SURFACE ANALYSIS
The first and most difficult stage in the reconstruction of a three-dimensional object from two-dimensional orthographic views is to find the equivalent components in different views. To do this, we use the surface analysis method (Mottaghipour et al., 2018;Mottaghipour et al., 2017), described with an example as follows: Consider polygon B in the 3D object as shown in Figure 1. Now, look at Figure 2, which includes front and top views of this object. In the top view, polygon B is seen as a polygon, while it appears as a line in the front view. Now, let us examine the features that this line has. As we can see from Figure 2, if we consider every corner of the polygon B in the top view, we can find an intersection with other components on the equivalent line in the front view and along with it. Of course, as shown in Figure 2, this correspondence is not one-to-one and 2 or more corners of the polygon may be related with a single intersection point on the line. The same is true for polygons C and E and their equivalent lines in Figure 2.
Now, consider polygon A in the 3D object shown in Figure 1. As Figure 3 shows, polygon A is seen as a polygon in the front view. It also appears as a polygon in the top view. Examining the properties of these polygons shows that there is a one-to-one correspondence between aligned corners of these two polygons. The same relationship can be seen between the front and top views of polygon D. The result can thus be expressed as follows: If we consider a polygon in an orthographic view of a three-dimensional object, it can be equivalent to a single line or a polygon in another orthographic view. What is meant by "being equivalent" is that both of them are   Figure 3. A polygon that is equivalent to a polygon different orthographic views of a single polygon. If the equivalent image is a polygon, it is necessary to have a oneto-one correspondence between the corners of this polygon and the first polygon corners. If, on the other hand, the equivalent image is a line, there must be an intersection point on the line in the direction of each of the first polygon corners. (This correspondence is not necessarily one-to-one, of course). Now, using this principle, we will create the necessary formulas and fuzzy rules in the proposed method.

DEFINITION OF VARIABLES AND ALGEBRAIC PHRASES
To explain this issue, we can start with an example. We are looking for an equivalent element for polygon "A" in Figure 4. All divisions are 10 mm × 10 mm squares. As mentioned earlier, first, we look for an equivalent polygon, polygon "B" for instance. The coordinates of all corners of polygon "A" stand in matrix and the coordinates of all corners of polygon "B" stand in matrix . To do this, the coordinate that is related to the common axis, stand in the first column and the other stand in the second column: � If matrix is × and matrix is × , we can define matrix as follows (See Eq.1): So, for matrices and in our example, we have: Here, the first column of shows the difference of common axis coordinate between the first point of and each point of . Our purpose is to find out which point of has the minimum difference with the first point of . Therefore, we generate matrix which contains minimums of each column of . However, if, for example, in column 1, the minimum occurs in row 1, in other columns we are not allowed to get row 1 as the minimum; and if the number of columns is greater than the number of rows for columns that do not have any row to obtain as the minimum, we can get 2×(maximum of matrix ) as the minimum. The reason is that it shows the first polygon has more corners from the second polygon, which is a negative score for their conformity. We call this "the penalty method". Therefore, in our example, we have: 25 25 25 50 150 ] Now, if is 1 × , is defined as follows: (2) which for our example will be: = 25 + 25 + 25 + 50 + 150 = 275. We then repeat the above process for case (polygon as the first polygon and polygon as the equivalent element). So we will have: Now, if is 1 × and is 1 × , we define as follows: So, in the mentioned example, we have: shows how much difference exists between two polygons after collating the nearest points together, because of the penalty method, the existence of an additional point in each polygon is considered a drawback in . It is clear that is a number between 0 and 1 and if it is near 0, the possibility of conformity between the two polygons is greater. This variable is, therefore, a scale to check the first and second properties mentioned in the surface analysis.
After that, it is necessary to check the third property, i.e. the parallelism of two lines in equivalent polygons. If we show the number of the parallel line pairs of polygon "A" by and the parallel line pairs of polygon "B" by , can be defined as follows: It is clear that, is a number between 0 and 1 and in case it is closer to 0, it signifies better conformity between the two polygons. In our example, for polygons "A" and "B" we have: After analyzing the conformity of the two polygons, we then present a method to find out the conformity of one polygon with a line. This method is greatly similar to the other method with the difference that in matrix , we substitute corners of polygon "B" with the intersection points on the noted line. For example, if we note line 1 as the equivalent element for polygon "A", we will have: � Now, we generate the same way as the other method but here, recurrence of the rows is permitted. The penalty method, however, is not used here since one intersection point can be equivalent to more than one corner. So, we have: = [0 0 0], = 0 + 0 + 0 = 0 Another difference with the other method is that here we do not perform the reverse process for the line as the first element and the polygon as the equivalent and is, therefore, not calculated. Hence, if is 1 × , for we have: So, for polygon and line 1, we have: = 0. As we know from expert knowledge, against each corner of the polygon, there should be an intersection point over the equivalent line. If such a point exists for corner number i, there is a zero in column i of matrix . So, the number of columns of matrix which does not have any zero value is the number of corners of the polygon without any equivalent intersection point over the line. We can define variable as follows: So in our example for polygon and line 1 we have: It is clear that is a number between 0 and 1 and in case it is closer to 0, the conformity of the polygon and the line is better.

FUZZY VARIABLES AND MEMBERSHIP FUNCTIONS
As we saw above, there are two types of conformity: conformity of the polygon with polygon and conformity of the polygon with line. For the first type of conformity, input variables of the fuzzy structure are defined as Figure 5 and Figure 6.
Also, for the output variable called conformity, we have membership functions as Figure 7.
Like before, for the second type of conformity, input variables of the fuzzy structure are defined as Figure 8 and Figure 9 and for the output variable called conformity, we have membership functions as Figure 10.
For all input variables, the membership function for type "bad" is SMF, for type "good" is ZMF, and for type "mod" is Gaussian. On the other hand, for all output variables, the membership function for type "bad" is ZMF, for type "good" is SMF, and for type "mod" is Gaussian. It should be noted that these membership functions are not necessarily unique and a special good membership function with a different form can be defined with the user, based on his/her knowledge and experience.

FUZZY CONTROL RULES
In general, the correlation between fuzzy variables is established by the use of "if-then" expressions based on expert knowledge, called "fuzzy rules". The modality of fuzzy inference in these rules can be either the "Mamdani" type or the "Sugeno" type. In Mamdani type, Output membership function is present, crisp result is obtained through de-fuzzification of rules' consequent, has non-continuous output surface, contains MISO (Multiple Input Single Output) and MIMO (Multiple Input Multiple Output) systems, has expressive power and interpretable rule consequents and has less flexibility in system design. In the other side, in Sugeno type, No output membership function is present, No de-fuzzification: crisp result is obtained using weighted average of the rules' consequent, there is continuous output surface, only MISO systems covered, we encounter loss of interpretability but more flexibility in system design. So, Mamdani FIS is well suited to human input while Sugeno FIS is well suited to mathematically analysis. Here, based on system properties, the "Mamdani" type is selected. Fuzzy rules for polygon-polygon conformity are as follows: 1. If FinallDiff is bad AND Pardiff is bad, THEN Conformity is bad.

CORRELATION OF ELEMENTS IN DIFFERENT ORTHOGRAPHIC VIEWS
In Figure 4, front and top views of an object are given. In the front view, we have polygons A, C and in the top view, we have polygons B, D, E, F. Therefore, we have 2×4=8 forms of conformity between these polygons for which FinalDiff and Pardiff are calculated and shown in Table 1. Then, based on the mentioned fuzzy system, conformity is evaluated for each state.
After that, we analyze polygon-line conformity. In Figure 4 in the front view, there are lines L3, L4, L5, and L6 and in the top view, there are lines L1, L2. Thus, for the front view polygons we have 2×2=4 conformity forms and for the top view polygons, we have 4×4=16 forms. As before, for all these states, variables FinalDiff, SingCor are calculated and then, using the fuzzy model, the conformity is evaluated and displayed in Table 2.
As for Table 1, and evaluated conformity numbers for each state, we can see that all of the conformities have low values except C-D and C-E adaptations. However, C-E adaptation value is greater and, consequently, we can conclude that C and E are equivalent. Table 2 shows that line L1 is an equivalent of polygon A. Both L1 and L2 can be equivalents of polygon C, however, since we identified an equivalent element for polygon C (polygon E) before, we can ignore these states. Also, line L5 is an equivalent of polygon B and L6 is an equivalent of F. For polygon D, both lines L3 and L4 can be the equivalent element and we will spot both in the reconstruction of the 3D object.

RECONSTRUCTION OF THE 3D OBJECT
Based on the results of Tables 1 and 2 and as the x-axis is the common axis between the two views, it is sufficient to collate points in equivalent elements and obtain 3D coordinates of each point. Results are shown in Table 3. Now, we locate the points of Table 3 in the 3D state. Figure 13 is obtained. The lower left corner of the 3D object is empty and based on the two given orthographic views, the noted region is a straight line in views, so, as  a simple solution, it can be a polygon such as "G". Also, in the hidden regions of this object, we can simply state a polygon and the completed 3D object will be similar to Figure 14.

IMPACT OF 3D RECONSTRUCTION ON SUSTAINABLE DEVELOPMENT INDICATORS
The term "sustainable development" has several definitions. For example, one of the most common definitions is the definition given by Brundtland Commission in 1987 as following (Rosen, 2017): "Development that meets the needs of the present without compromising the ability of future generations to meet their own needs." A review of papers suggests that sustainable development indicators are divided into three main categories: social, environmental and economic (Hatakeyama, 2018;Seyajah et al., 2014;Shaaban and Scheffran, 2017) and each category contains several sub-indicators as an example is shown in Figure 15.
On the other hand, the review of 3D modeling applications suggests that many of these applications can be effective on sustainable development indicators. Obviously, the scope of this effect can range from very low to very high values. To study this, an influence matrix is formed as Table 4. In this matrix, 3D modeling applications are arranged as E1 to E9 and some of sustainable development indicators (which can be affected by E1 to E9) arranged as C1 to C8. The intersection of row i and column j, briefly EiCj, represents the effect of the application Ei on indicator Cj. The intensity of this effect is divided into six categories which are characterized by linguistic fuzzy variables: No effect (N), Very Low effect (VL), Low effect (L), Moderate effect (M), High effect (H) and Very High effect (VH). In the following, some of these effects are explained: Better Visualization using 3D Object (E1) improves spatial visualization and spatial intelligence, it can be very influential on education in disciplines such as engineering and design, improve the quality of education and save time and money. It can also improve the health level through the improvement of the 3D model of the components, lesions and internal damages of the body .Performing Finite Element Analyzes on 3D Model (E2) such as Static, Dynamic, Thermal, Ergonomic & etc. can reduce the design time and provide the possibility of optimization, which results in lowering the cost and reducing the risk of investment and increasing the incentive for investment.
Otherwise, as well as the risk reduces, the use of new energy and recyclable materials increases that can protect energy resources and forests. On the other hand, it can make it easier to educate engineering courses. As another  Figure 13. Resulted 3D object from Table 3 Figure 14. Resulted final 3D objects example, Simulation of Production Processes on a 3D Model (E4), can optimize the production line, reduce the risk of investing in production, and preventing energy waste. Also, keeping the drawings in the computer's memory, on one side, can reduce the need for printing and thus reduce the consumption of paper, which is very effective at cost and protecting the trees.

CONCLUSION
This paper presents a method to reconstruct 3D objects from two orthographic views and solves the weakness of some former methods including the uncertainty in correlating elements in orthographic views by the use of the fuzzy logic theory. Some of the advantages of this method are as follows: • All previous methods use 3 orthographic views to reconstruct 3D objects but this method uses only 2 views. • By making use of the fuzzy logic, this method has a high level of flexibility and can resolve vagueness and uncertainty.  • This method is based on expert knowledge, so there is very low possibility of the absolutism of computer systems. • Since this method presents different possibilities for each adaptation state, it can be used to reconstruct final 3D objects of scratched engineering drawings. Meanwhile, a limitation of this method is that it can only be applied to planar faces and does not include curved surfaces. In future research, it is suggested that its scope should be broadened to involve curved surfaces.
On the other hand, increasing the possibility of reconstruction of 3D Objects from 2D orthographic views will result lower cost, lower investment risk, reduced energy consumption, increased use of renewable materials, conservation of natural resources, improved education quality and increased health level, all of which means creating sustainable development in three areas: economic, social, and environmental.