Calculus domains modelled using an original bool algebra based on polygons

Analytical and numerical computer based models require analytical definitions of the calculus domains. The paper presents a method to model a calculus domain based on a bool algebra which uses solid and hollow polygons. The general calculus relations of the geometrical characteristics that are widely used in mechanical engineering are tested using several shapes of the calculus domain in order to draw conclusions regarding the most effective methods to discretize the domain. The paper also tests the results of several CAD commercial software applications which are able to compute the geometrical characteristics, being drawn interesting conclusions. The tests were also targeting the accuracy of the results vs. the number of nodes on the curved boundary of the cross section. The study required the development of an original software consisting of more than 1700 computer code lines. In comparison with other calculus methods, the discretization using convex polygons is a simpler approach. Moreover, this method doesn't lead to large numbers as the spline approximation did, in that case being required special software packages in order to offer multiple, arbitrary precision. The knowledge resulted from this study may be used to develop complex computer based models in engineering.


Introduction
Geometric modelling is a long run concern of the authors in the past 25 years. The geometric models were used in various projects: definition of the calculus domains, development of computer aided dimensioning original software, experimental data reduction in photoelasticimetry and others. Calculus of the mechanical stresses is closely related to the geometric model of the cross section and, further on, to the calculus of the geometrical characteristics of the sections. So far, the section was modelled as a set of geometric entities, hollow or solid, which were either added one to the other, or subtracted one from the other. In this way there were modelled both homogeneous and inhomogeneous sections. In the initial studies the simple geometrical entities used to define the bool algebra, to compute the mechanical stresses and to develop the according software were rectangles and ring-type sections. Therefore, regions of the frontier of the section were boundaries of the aforementioned geometrical entities [1]. According to a more general approach, the boundary was discretized using spline functions, being developed general methods to define the geometrical characteristics and to solve the integrals [2]. However, the spline discretization of the boundary has some shortcomings, in some cases being preferred a linear discretization of the boundary. In this case the domain was divided in triangles, a general located triangle being considered as a result of some Boolean operations with rectangles and right angled triangles [3]. After a more thorough documentation, we concluded that the cross section, i.e. the domain, may be discretized in a general way using polygons.

Calculus of the geometrical characteristics of a polygon
Let us consider a polygon defined by N vertices, i.e.
, [4]. The area of the polygon is: (1) The coordinates of the centroid are: (2) The second moments of area may be computed using the relations: (4) The product moment of area is: (5) As it can be noticed, the previous relations are simple, they use only the coordinates of the vertices and their implementation is facile.

Discussion
The previous relations were subjected to several tests in order to verify their correctness, to master the details and to conceive the most effective implementation in terms of simplicity and flexibility.

Tests for simple shapes
The previous relations were tested for three simple shapes: a triangle, a rectangle and a circle. For these simple shapes we have direct calculus relations of the geometrical characteristics. Vertices were generated in clockwise direction, as well as in counter clockwise direction. The software developed at this stage has more than 270 computer code lines.
Conclusions regarding the previous relations:  in the 'for' loops, when  According to the results of the program, the relative error in the calculus of the centroid's coordinates are around 14 10  , that is practically a null value. The relative error of the area is in the left side of the previous figure and the relative error of the second moment of area is in the right side of the same figure. The relative error of the product moment of area is smaller than the error of the second moment of area and it has the same variation.
To conclude, for angles The centroid of the entire cross section is: (7) The geometrical characteristics of the sections may be computed using two methods. According to the first method, the second moments of area j P Y I , j P Z I and the product moment of area j P YZ I in the initial system of axes may be computed using the relations (3), (4) and (5). These geometrical characteristics with respect to their local centroid axes are computed using the parallel axes theorem: Further on, the second moments of area and the product moment of area in the centroid system of axes of the section are calculated using again the parallel axes theorem: . (13) The extreme values of the vertices' coordinates in the centroid system of axes of the section are: The distances from the centroid axes to the most remote vertices of the section are The section moduli may be calculated using the relations According to the second method, the coordinates of the vertices are expressed in the centroid system of axes: and the algorithm is simpler, faster and the number of round off errors are fewer and smaller. In the centroid system of axes, after all the coordinates are translated, the centroid has the coordinates The geometrical characteristics in the centroid system of axes of the section are calculated using relations (3), (4) and (5). The rest of the algorithm is similar to the first one.   The computing methods were tested using the discretizations presented in the above figure. The results are practically identical. There may be remarked the following aspects:  the values generated by the both methods are not very large, therefore there is not necessary to use special libraries which offer multiple arbitrary precision, such as GMP;  the results of the both methods confirm the correctness of the algorithms, being compared with the values resulted from the classic calculus;  the tests were necessary in order to validate the original computer code; further on the code may be used as a solver of complex and general case studies.

Test for a complex shape
Once the original software is validated, it must be tested to verify the results for a complex shape. We selected the cross section of the UIC60 rail as a case study for our test. We were able to find the drawing and some of the geometrical characteristics. However, the drawings were not presenting all the details regarding the geometry of the section.
In order to have a visual validation of the analytically-defined section, there was developed a function which is automatically generating the drawing of the section in AutoCAD, using script files. Because the boundary is approximated by segment lines, there were followed two stages in the modelling of the section. First stage replaced the fillets of the section with segment lines and allowed us to visually validate the so-called 'coarse' approximation model, figure 5. The results of the calculi allowed us to evaluate the ratio 'boundary-refinement' vs. accuracy of the geometrical characteristics. The second model replaced the fillets with segment lines, the arcs of the circle being discretized using an angle,   , which may be set as a variable of the program. We considered that  1   leads to a fair accurate approximation of the boundary, figure 6. For the unrefined model, as well as for the refined model the calculi were performed using both methods.