Symbolic Parametric Representation of the Area and the Second Moments of Area of Periodic B-Spline Cross-Sections

: The calculation of moments of area is one of the most fundamental aspects of engineering mechanics for calculating the properties of beams or for the determination of invariants in different kind of geometries. While a variety of shapes, such as circles, rectangles, ellipses, or their combinations, can be described symbolically, such symbolic expressions are missing for freeform cross-sections. In particular, periodic B-spline cross-sections are suitable for an alternative beam cross-section, e.g., for the representation of topology optimization results. In this work, therefore, a symbolic description of the moments of area of various parametric representations of such B-splines is computed. The expressions found are then compared with alternative computational methods and checked for validity. The resulting equations show a simple method that can be used for the fast conceptual computation of such moments of area of periodic B-splines.


Introduction
In engineering mechanics, there are idealized 1D models, such as rods or beams, as well as 2D models, such as shells and plates. In particular, the beam represents a high abstraction of a 3D body consisting of a curve and a cross-section. These crosssections usually consist of the composition of different 2D geometric objects such as circles, ellipses, rectangles, or triangles [1], leading, for example, to cross-sections such as U, T, H, I, or tube sections. Structural optimization for such wireframe structures can be applied to the element stiffness matrix of a beam by changing the moments of area [2][3][4] or accounting parameters for specific types of cross-sections [5,6]. While such cross-sections are typically found in frame structures such as cars, buses, or bridges, the results of topology optimization tend to result in root-shaped geometric freeform bodies [2]. Visually, the results provided by topology optimization considering plate or volumetric elements often lead to organic shapes [7], which can be interpreted as beams with circular or elliptical cross-sections [8,9]. Alternatively, freeform surfaces can be selected manually [10,11] or estimated automatically [12,13] for such optimization results.
Freeform curves in particular offer the advantage of high shape variation and are especially well suited for the reconstruction of organic models. Such a freeform crosssection consists of a so-called control polygon [14], with which the spline can be adjusted and controlled. A significant advantage is that such cross-sections can be used to derive a frame structure consisting of several beams to a closed freeform surface model. These control polygons of the individual beams can be linked to form a comprehensive control mesh [15]. In contrast to the unification of cylinders or spheres by means of constructive solid geometry, this results in a continuous surface. Furthermore, such a control polygon can be parametrized and further applied for shape reconstruction and wireframe optimization [15]. Thus, it is highly desirable to investigate the geometric properties of such a basis spline (B-splines) defined by a parametric representation.

Motivation
The advantage of constructive solid geometry (CSG) derived from circular and elliptical cross-sections includes the parametric representation of the curve and the moments of area, which are necessary for the evaluation of the bending stiffness as well as for FE simulations. For freeform cross-sections, the calculation of the moments is usually performed in a large number of numerically treated point coordinates, where they are determined via a boundary integral. In a recent publication [15], instead of a numerical calculation approach, a parametric formula was derived analytically, e.g., for the area of a triangle and rectangle control polygon. Figure 1 shows the example of a bar with Cartesian coordinates and with a parametric of the control polygon of a B-spline. However, since, in [15], only a triangle and a rectangle are considered and a numerical estimation of the coefficients of the second moments of area is carried out, a parametric description of the moments of area is analyzed in the context of this work. On one hand, the zero-and second-order moments of area are determined analytically, and, on the other hand, in addition to the triangle and rectangle, various control polygons, such as the moments of area of a parallelogram, a trapeze, a symmetric pentagon, and a symmetric hexagon control polygon, are derived.
In addition to the determination of the equations for the moments, an extensive validation strategy is presented. First, the formulas are checked against correlations of valid cross-sections, so that, for example, the cross-sectional area must always be greater than 0. Then, the freeform curves are converted into polygons by an appropriate choice of control points and compared with results from the literature using a triangle and a rectangle as examples. Finally, a numerical comparison of the moments of area is performed with alternative calculation methods of the moments of polygons as well as of 2D binary images. This validation can be used to ensure the validity of the automatically calculated formulas.
In the following, the properties and the methods for the determination of the moments of area of periodic splines are described. Then, alternative methods for calculating moments of polygons and images are explained. Finally, the essential parameters of moments are described.

State of the Art
The parametric representation of various shapes and topologies has been discussed in various articles for simple polygons as common cross-section types [16,17] and also for more complex topologies consisting of multiple polygons such as hexagonal networks [18,19]. The knot positions of these for one or several polygons can be considered as control points for tensor product splines.
There are several different kinds of splines such as the Overhauser spline [20,21], the Catmull-Rom spline [22], B-splines [23], and Bezier splines [24]. These different spline types may differ in properties such as the convex hull criterion or the type of continuity [25]. The convex hull criterion describes the property in which, given a convex control polygon, the resulting spline lies within that control polygon. While B-splines provide C 2 continuity and the convex hull criterion, Bezier curves only guarantee C 1 continuity and the convex hull criterion [25]. Catmull-Rom splines are only C 1 continuous and violate the convex hull criterion [25]. The Catmull-Rom spline and the Bezier spline offer. in contrast to B-splines. the advantage that the control points are located on the curve. Due to the convex criterion and the C 2 continuity, this article focuses on B-splines. Such a cross-section can be used to describe 3D surfaces by using operations, such as skinning or sweeping, along a curve [26] to design, for example, a propeller blade [27]. Furthermore, B-splines can be used to model the mechanical behavior of a beam [15,28]. Additionally, they can be used in the structural optimization of lattices [15,[29][30][31], so that the beam line or its cross-section changes due to some objective function.
The calculation of the moments of freeform curves has been performed in several publications [32][33][34]. The calculation is carried out via the boundary integral along the spline using Green's Theorem in order to be able to calculate the moments of area directly [32,33]. This boundary integral can be traced back to a summation of the individual points, including weighting factors. The authors of [32] compared their equations using several B-splines to approximate the ellipse against the exact moments of area. While the authors of [32,33] considered the calculation on 2D shapes, the authors of [35] calculated the moment of inertia for the 3D shapes of freeform surfaces instead. Such moments of area, particularly for splines, are often used for shape matching [36,37] due to the invariant properties.
However, since this summation has a large number of coefficients, a more compact parametric description is often desirable. The authors of [15] were able to find an exact parametric description of triangles and rectangles for the value of the cross-sectional area, the formula of which was subsequently used for the truss optimization as well as the 3D reconstruction. In this work, analogous to [15], such a compact description shall be found for different control polygons and for different types of splines. In contrast to [15], a complete analytical description of the second order of the moments of area, as well as the transfer to control polygons consisting of a parallelogram, a trapeze, a symmetric pentagon, and a symmetric hexagon, is guaranteed.
In addition to the numerical calculation of spline cross-sections, alternative geometric representations such as a polygon or an image can also be used. The moments of binary images were investigated in several articles such as [16,38]. By summing up the single pixels to a rectangle, the area can be calculated by considering Steiner's theorem and the center of area, and the second moments of area can be calculated with the following equations [16]: A Img = ∑ i∈B 1; S x Img = ∑ i∈B y i 1 2 ; S y Img = ∑ i∈B x i 1 2 (1) I x Img = ∑ i∈B 1 12 + (y s − y i ) 2 ; I y Img = ∑ i∈B 1 12 For polygonal cross-sections, the moments of area with respect to the center of area can be determined with the following equations [39,40]: Typically, cross-sections can be converted from algebraic curves to images or polygons directly. Therefore, it is reasonable to cross-validate the new equations to the alternative representations using Equations (1) and (2). While the equations of the polygon cross-section are determined by a boundary integration, the equations for the binary image were determined by an area integration. While these numerical approximations of the moments of area can be computed quite quickly, the main advantage of parametric cross-sections is their interpretability and direct use in algebraic equations. For example, the beam stiffness matrix can be constructed directly using the parametric spline description, which can be further optimized [15].

Materials and Methods
In order to determine the formulas for the moments, the description of a periodic B-spline is first explained in more detail. Then, based on the publication [32], the approach to derive the formulas for the analytical moments is presented. Finally, a suitable experimental setup is presented to automatically test the formulas numerically against alternative calculation methods as well as against general correlations of valid cross-sections. A tensor product spline describes a family of curves that can be represented [25,41] with where P(t) describes the curve, T describes the monomial basis, C describes the control points of the spline, and M describes the geometry matrix [25]. In the case of a cubic B-spline, the relationship for a segment can be described as follows: where c i is the individual control points and t is the parametrization along the spline of the monomial basis. Figure 2 shows for a triangular control polygon the computation of the B-spline using different sequences of control points. A periodic B-spline can be obtained by repeating the first two control points. If the individual control points are repeated in the sequence itself, a sharper spline is obtained, and repeating twice gives the control polygon as a contour. In this work, we restrict ourselves to periodic splines since they only lead to a closed cross-section. For the first validation, the moments of area of the control polygon calculated by repeating the control points must match with the moments of area of a directly computed polygon in Equation (2). Therefore, the moment formulas of a rectangle or triangle must match those from the approach with the B-spline.

Moments of Area of a Periodic B-Spline
Different control polygons can be parametrized for the calculation of the moments of area. Figure 3 shows a variation of different control polygons with the parameters used in each case. For the moments of splines, the authors of [32,33] used a boundary integral along the tensor product spline with N control points and the coordinates X n , Y n to calculate the area of such a spline with where the coefficient C lm can be calculated by summing the geometry matrix [32] with: Analogously, the first and second order moments were determined in [32] using the following equations: The coefficients C lmn and C lmno can be calculated as follows [32]: With the help of these equations, the parametric descriptions of the control polygons can be generated. In the following, the parametrization is determined schematically for a triangular control polygon.

Parametric Representation of the B-Spline of a Triangle
Based on the parametric in Figure 3, the area can now be determined. For a B-spline, the area can be calculated as follows: This results in an expression similar to that found in [15]: Analogously, the first and second order moments of area with respect to the coordinate origin can be calculated with From the first moments of area, the center of area of the spline cross-section can now be calculated with Using the center of area, the second order moments can now be referenced to the center of area with It is noticeable that the structure of the moments of the B-spline differs from that of a triangle only in the coefficients (see also Table 1). To check the validity of the formulas found for the moments, it is necessary to compare them with alternative calculation methods and to check valid cross-section properties.

Comparison to Polygon Cross-Sections
By repeating the control points, the B-spline formula can be used to accurately reproduce the shape of a polygon and, therefore, its moments of area. If the parametric formula is derived from this, the moment of area formula of, for example, a rectangle or a triangle is obtained in Table 2. The following table shows the determination of the moments via the B-spline formula, which can also be derived from Equation (2) or found in the literature [1].  The comparison with the table shows an agreement of the calculation methods with the literature. Thus, it can be seen that if the control points (polygon) are repeated twice, the results from the literature can be determined directly.

Numerical Comparison Framework
To ensure the validity of the formulas with a high degree of accuracy, they must be validated with alternative calculation methods and by checking the Jordan curve theorem and valid cross-section properties. Figure 4 shows the steps involved in the automatic validation of the equations for the cross-sections. First, a tensor product spline is defined. This curve is then converted into a discrete polygon and the control polygon points. From the control polygon points, the parametric equation is derived and the numerical results of the moments are then compared to the moments of the polygon as well as the moments from a binary image.
In addition, for each formula it is checked whether it is a valid cross-section or a curve, as determined by the Jordan curve theorem.

Spline Cross-Section with Valid Cross-Section Property
A valid cross-section has a positive cross-sectional area and positive principal axis moments (eigenvalues), so that all combinations of parameters must fulfill Principal moments can be computed with However, since this expression can be very complex, it is first necessary to find a simplified criterion for valid cross-sections. It is sufficient to state that the smaller principal moment of area given by must be greater than zero. This leads to I y + I z 2 > I y − I z 2 2 + I 2 yz I 2 y + 2I y I z + I 2 z > I 2 y − 2I y I z + I z 2 + 4I 2 yz I y I z > I 2 yz . Therefore, for all parameter combinations, a valid cross-section has to fulfill In addition to the relationship between the moments of area for valid cross-sections, it is also necessary to compare the formula found with various alternative calculation methods.

Spline Cross-Section as Valid Jordan Curve
For validation, the spline is converted into a polygon and into a 2D binary image. Then, the moments can be calculated in different ways for the particular spline. Figure 4 shows three different B-splines, their polygons (red and green), and a binary image of their cross-sections.
A comparison of Equations (1) and (2) is used to check the accuracy and validity. As the number of segments along the polygon line is increased, the accuracy of the moments of area estimate also increases. The comparison with the formula of the binary image serves to ensure the validity of the calculated curve, so that no Jordan curves are detected. Figure 5 shows a non-Jordan curve by swapping the order of the nodes. While such a cross-section can be estimated with some accuracy using the binary image, the boundary integration approach using the polygon approach, as well as the chosen formula derived for the B-spline, leads to incorrect results (e.g., area = 0, in this case). To achieve a high degree of coverage, it is necessary to compare the approach with a large number of possible polygon and binary image cross-sections. For each parametrization, a Latin hypercube sampling is chosen by generating a large number of cross-sections. Then, the mean error and the variance of the error are chosen as evaluation criteria in comparison to the alternative computational methods. For this purpose, the relative errors are determined as follows.

Spline Cross-Section Numerically Compared to Polygon and Image Cross-Section
To validate each formula, the moments from the derived polygon cross-section and the image A Img, Poly , I x Img, Poly , I y Img, Poly , I xy Img, Poly are compared with the moments of the B-spline formula A TPS , I x TPS , I y TPS , I xy TPS . Thereby, the relative errors of a large number of combinations of the control polygons, including Thus, each individual geometric variable and its influence can be checked directly. However, since an evaluation up to ∞ is not possible, a limiting parameter of the geometric variable of 100.0 is chosen. For each case, 100 samples are generated using Latin Hypercube Sampling.

Results
Based on the described strategy for the parametrization as well as for the evaluation of the found formulas, it is necessary in the following to design different parametric control points for the tensor product splines. From these parametric control point coordinates, the respective moments are then calculated automatically and analytically. In this work, the moments of a general triangle, a rectangle, a trapeze, a parallelogram, an isosceles pentagon, and an isosceles hexagonal honeycomb are considered, since, for these parametric quantities, there is a suitable simple expression, which can still be presented on a few lines.
For the evaluation of these moments of area, the approach from Section 2.4 is chosen. By using the Jordan curve theorem, the parametric is restricted so that only valid Jordan curves are used as cross-section results. Table 3 shows for different control polygon types several cases with different parameters (see also Figure 3). For comparison, the resulting curve was rasterized into an 8 × 8 pixel image and segmented into a polygon consisting of six segments.

Moments of Area Parametrization of a Triangle Control Polygon
Since the triangle itself is always a convex polygon, the curve also lies within the selected polygon. The value of the area must, therefore, be smaller than that of the triangle itself. Table 4 shows the formulas for calculating the moments of area and the relative errors compared to a polygon with 100 segments, a polygon with 10 segments per spline segment, an image I 128 with a grid size of 128 × 128 pixels, and an image I 16 with a grid size of 16 × 16 pixels. Equation (26) always shows values greater than zero for the geometric parameters of c, h; thus, the essential properties for a valid cross-section are guaranteed for positive geometric parameters. The relative error from the calculation shows an average relative error of 0.015% for P 100 . This error increases when fewer segments per spline P 10 are used. The errors for binary images are significantly higher compared to the polygon approach. Furthermore, if a 16 × 16 pixel grid is chosen, an error of 25.7% can occur for the second order moment of area.
The relative errors show good agreement between the different calculation methods, so that the formulas from Table 1 can be assumed to be correct. In particular, the small error for a high resolution of the spline as polygon P 100 shows good agreement.

Moments of Area Parametrization of a Quadrilateral Control polygon Area
For a quadrangular control polygon, the cross-sectional area of the B-spline can be generally expressed as according to the parametrization covered in Figure 3. However, the parametrization of the general quadrilateral can lead to the violation of the Jordan curve theorem, so that the curve can intersect itself. This can lead to a negative cross-sectional area, so that more appropriate boundary conditions for the dependencies of the parameters of the control polygon have to be considered for a robust application. In the following, the quadrilateral is constructed as a rectangle, a trapeze, and a parallelogram.

Moments of Area Parametrization of a Rectangle Control Polygon
Due to the chosen parametrization of a rectangle, only positive and valid cross-sections can be realized compared to the general quadrilateral. Table 5 shows the equations for the moments of area of the rectangular control polygon as well as the numerical errors. Analogous to the triangle, a high accuracy of the relative errors is again shown in comparison to the polygonal approach. Similarly, it can be seen that Equation (26) leads exclusively to positive values. The moment of area of I xy leads to a value of 0 due to the symmetric shape of the control polygon.  Table 6 shows the results for the moments of area of the control polygon as a parallelogram as well as the numerical errors. Analogous to the triangle, a high accuracy of the relative errors is also shown here in comparison to the polygonal approach. Similarly, it can be seen that Equation (26) leads exclusively to positive values. The moment of area I xy is 0 for the parallelogram with p = 0, which represents a rectangle. Otherwise, this leads to values unequal to 0 due to the asymmetry of the cross-section.

Moments of Area Parametrization of a Trapeze Control Polygon
For the validity of the trapezoids, according to Equation (26), the following relation is positive and, therefore, valid for each possible parameter combination: Table 7 shows the results for the moments of area of the control polygon as a trapeze as well as the numerical errors. Analogous to the triangle, a high accuracy of the relative errors is also shown in comparison to the polygonal approach. The moment I xy is consistently zero due to the symmetry. For the parameter p = b 2 , the relation of the rectangle is obtained.  In an analogous way, further quadrilaterals can now be parametrized and their formulas for the moments of area can be derived. In the following, the calculation of the moments of area of a parametric pentagon, as well as of a hexagon, is performed.

Moments of Area Parametrization of a Symmetric Pentagon Control Polygon
For the validity of the pentagon, according to Equation (19), the following relation leads to only positive values: Table 8 shows the results for the moments of area of the control polygon as a symmetric pentagon as well as the numerical errors. Analogous to the triangle, the relative errors also show a high accuracy compared to the polygonal approach. The moment I xy is consistently zero due to the symmetry. Finally, the parametrization for a hexagon can now be specified analogously.

Moments of Area Parametrization of a Symmetric Hexagonal Control Polygon
A valid hexagonal has to fulfill the following equation: Table 9 shows the results for the moments of area of the control polygon as a symmetric hexagon as well as the numerical errors. Analogous to the triangle, the relative errors also show a high accuracy compared to the polygonal approach. The moment I xy is consistently zero due to the symmetry. Table 9. Equations for the parametric control polygon for the rectangle and its relative error.

Equation
Error

Discussion
The final formulas show a very good suitability for the design and determination of beams with freeform cross-sections. In particular, the comparison of the formulas with alternative calculation methods suggests a high validity.
One point of criticism could be the chosen parametrization of the control polygons. While the triangle was still covered for arbitrary shapes, there are already restrictions for the moment of area for a quadrilateral due to the complexity of the perpetual expressions. The same is true for pentagons and hexagons. Only a restriction of the parametric allows simpler expressions, e.g., for a parallelogram as well as a trapeze. However, this simplification can be improved to achieve high shape coverage with a suitable set of variables. For example, the parametric of the positive lengths of the symmetric hexagon yields exclusively convex polygons, so this unfavorable choice implicitly excludes many alternative symmetric hexagons.
While the numerical formula for determining the moments of area is easy to implement and universally applicable, the symbolic expressions lead to the restriction of the crosssectional geometry. However, due to the numerical accuracy of such formulas, erroneous moments of area cannot be absolutely guaranteed, unlike in the analytical formula. The symbolic expressions can be used completely up to the limit ranges, so that a consideration of the convergence behavior towards infinity is also possible. Especially in the case of optimization, cross-section values close to zero can occur, at which point a numerical approximation can lead do misleading results.
The validation framework exhibits high robustness and reliability, so that symbolic formulas can be tested directly. However, for future work, the estimation of a polygon consisting of many segments is usually sufficient. Unlike the polygon and the B-spline, the binary image and the evaluation step is based on an area integral rather than a boundary integral and is, therefore, not directly comparable.
In summary, however, a large number of expressions are shown, which can be used to determine moments of area of such freeform curves in the simplest way. These can now not only be used for aspects of structural optimization, but also for reconstructions analogous to [15]. In contrast to [15], however, a fully analytical function of the beam stiffness matrix can be realized, so that geometric values close to zero can be accurately captured.

Conclusions
This work has dealt with the derivation of analytical formulas for the moments of area of periodic B-splines. The position of the control points was mapped parametrically and then embedded in the boundary integral for the calculation of the moments of area of splines. In contrast to common methods for the numerical determination of moments of area, a symbolic calculation with an integer numerator and denominator was considered. This integer calculation leads to an exact determination of the cross-sectional area and the second moments of area of such periodic B-spline cross-sections.
While, in [15], only the cross-sectional area was determined analytically, in this work, a symbolic description for the second moments of area could be obtained. Especially in structural optimization, cross-section parameters close to zero can be determined, for which an exact calculation of the moments is necessary.
The obtained expressions can now be used for various applications in the field of reconstruction design, as well as in verification calculations. Similarly, further control polygons can be parametrized using the approach described above.