=Paper=
{{Paper
|id=Vol-2744/paper52
|storemode=property
|title=Construction of the Functional Voxel Model for a Spline Curve
|pdfUrl=https://ceur-ws.org/Vol-2744/paper52.pdf
|volume=Vol-2744
|authors=Alexey Tolok,Nataliya Tolok,Anastasiya Sycheva
}}
==Construction of the Functional Voxel Model for a Spline Curve==
Construction of the Functional Voxel Model for a Spline Curve* Alexey Tolok 1[0000-0002-7257-9029], Nataliya Tolok 1[0000-0002-5511-4852], Anastasiya 1[0000-0003-3230-4271] Sycheva 1 V.A. Trapeznikov Institute of Control Science of Russian Academy of Sciences, 65 Profso- yuznaya street, Moscow, 117997, Russia tolok61@mail.ru, nat_tolok@mail.ru, a.a.sycheva@mail.ru Abstract. Analytical models are the most accurate method of geometric infor- mation representation. Parameterized smooth curves cannot be used in the field of analytical geometry, which explains the necessity for finding of analytical rep- resentation of such curves. The article considered the construction of a smooth curve presented in an analytical form and some approaches to finding an analyt- ical model for a parametric Bezier curve. Π presentation of a function in the form of its functional areas was chosen as prototype of the analytical model. The se- lected representation formed on the basis of the De Casteljau's method of con- structing the Bezier curve and set-theoretic modeling. The Rvachev functions (R- functions) are used as the mathematical apparatus of set-theoretic operations on function areas. The functional-voxel method makes it possible to simplify the computation of R-functional procedures. An algorithm for constructing the func- tional area of the Bezier curve is developed on the basis of the presented com- bined R-voxel approach. The obtained results allow for the conclusions about the adequacy of this approach and its development protentional to construct more complicated structures. Keywords: Bezier curve, De Casteljau's algorithm, R-functional modelling, Functional voxel modelling, R- voxel modelling. 1 Introduction Computer synthesis of simple and complex geometrical objects and their transfor- mations is essential for the wide range of design problems. The necessity to construct the maximally accurate computer geometrical models for the contemporary design problems remains to be the primary. Nowadays the Set-theoretic operations for the analytical modelling of a space of the complex function (Rvachev function [1,2]) are one of the most curious approaches to constructing the analytically set objects of complex geometrical shape. Copyright c 2020 for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). 2 A.Tolok, N. Tolok, A. Sycheva CAD is traditionally considered to be the main application field of computer geom- etry though the construction of smooth curves and surfaces in this sphere is based on the parametrical descriptions of functions which makes impossible to apply them both in the analytical geometry and in the R-Functional modelling. The Functional Voxel Method [3] allows to solve this problem by providing the mechanism for replacing the space of the analytical function π = π(ππ with the space of the local functions π1 π₯1 + β― + ππ π₯π = ππ+1 . 2 Previous Work Smooth curves are one of the basic design tools applied in contemporary CAD. For example, the reference [4] describes the application of Spline Approximation in the CAD Systems for the Linear Constructions. The Bezier curves represent the classic type of smooth curves are of the greatest interest in this current research. The Bezier curvesβ segmentation is described in [5]. However, we shouldnβt overlook the application of other types of curves in solving various design problems. In [6] and [7] the application of parametrically described B- spline in the CAD parametrical geometry optimization problems and pavement model- ling is considered. T-splines being the generalization of B-splines are becoming more widespread. The authors of [7] represented their own isogeometric approach to shape optimization on the basis of this type of splines. 3 Analytical representation of smooth curve 3.1 Smoothing cubic spline One of the simplest analytical approaches to a smooth curve representation is to define it in the polynomial form. Having the purpose to obtain smoother shape and more flex- ible design, letβs consider cubic polynomial: π¦=ππ₯3+ππ₯2+ππ₯+π (1) The cubic spline construction is specified by four points P0(x0, y0), P1(x1, y1), P2(x2, y2), P3(x3, y3). At the same time, points P0 and P3 are situated on the segment borders and points P1 and P2 allow to define the position of a tangent to a curve in the boundary points. Smoothing cubic spline construction demands implementation of several conditions: 1. The curve passes through the boundary points of the segment 2. First derivatives of the neighbor segments of the spline should be equal in the bound- ary points These conditions can be described by the system of four equations (2). Construction of Functional Voxel Model for a Spline Curve 3 π¦0 = ππ₯03 + ππ₯02 + ππ₯0 + π π¦3 = ππ₯33 + ππ₯32 + ππ₯3 + π π¦1 βπ¦0 (2) = 3ππ₯02 + ππ₯0 + π π₯ βπ₯ 1 0 π¦2 βπ¦3 2 { π₯2βπ₯3 = 3ππ₯3 + ππ₯3 + π The results of visualizing the cubic polynomial which coefficients are determined by represented system of equations are illustrated in Fig.1. The construction of smooth curve can be achieved when the conditions (2) are met. However, constructing the closed contours is hindered β the curve is buckling on a tangent in reverse preventing self-intersections. Fig. 1. Construction of the smooth cubic spline by 4 points. The application of the proposed approach gives us the possibility to depict the curve that consists of several segments (Fig.2) successfully. Unfortunately, it doesnβt solve the problem of constructing the complex closed structures.x Fig. 2. Construction of the smooth cubic spline by 4 points. 3.2 Bezier curve Bezier spline is the classical type of smooth curves represented parametrically. The construction of Bezier curve is carried out by means of Bernstein polynomials [4]: ππ,π (π‘) = (ππ)π‘ π (1 β π‘)πβπ , π! (3) (ππ) = , π!(πβπ)! where (ππ) β the amount of combinations of n choose i, n β exponent of the polynomi- als, i - consecutive number of the anchor vertex. At the same time, abscissa and ordinate are described parametrically by the system of equations (4). π₯ (π‘) = βππ=0 π₯π ππ,π (π‘), 0 β€ π‘ β€ 1 { (4) π¦(π‘) = βππ=0 π¦π ππ,π (π‘), 0 β€ π‘ β€ 1 4 A.Tolok, N. Tolok, A. Sycheva where xi and yi - coordinates of anchor vertex i. However, the application of this type of curves in the analytical calculations of the R-functional modelling demands its representation in the form Ο = π (x, y). The most evident approach to solving this problem is to express parameter t in terms of one of the coordinates. To simplify evaluations letβs consider the expression of t- parameter in terms of x-coordinate in case of Bezier curve of degree 2 with anchor vertices P0(x0, y0), P1(x1, y1), P2(x2, y2). The parameter t in the current point A will be expressed as: π0 βπ1 Β±β(π0 β2π1 +π2 )π΄+π12 βπ0 π2 , π0 β 2π1 + π2 β 0 π0 β2π1 +π2 π΄βπ0 π‘= , π0 β 2π1 + π2 = 0 ΠΈ π1 β π0 (5) 2(π1 βπ0 ) π΄βπ 0 β , π0 = π1 β π3 { π2βπ1 Even in case of Quadratic Bezier Curve the complexity of parameter expression is ob- served. The parameter t can also be expressed by means of local computer geometry as t=f(x). For this purpose, itβs possible to use the equation of a tangent to the curve in the point A(tA, XA): π΄π‘ + π΅π₯ + πΆ = 0 (6) The coefficients of the equation will be defined via inclination angles n1, n2, n3 between the normal to the tangent at the point of a curve and the coordinate axes OX, OY, OZ. Considering that the tangent line passes through some point B(tA+ΞtA, XA+ΞXA) in the neighborhood of the point A, letβs write the determinant: π‘ π₯ 1 | π‘π΄ ππ΄ 1| = βΞππ΄ π‘ + Ξπ‘π΄ π + (π‘π΄ (ππ΄ + Ξππ΄ ) β ππ΄ (π‘π΄ + Ξπ‘π΄ )) (7) π‘π΄ + Ξπ‘π΄ ππ΄ + Ξππ΄ 1 Thus, the coefficients of the equation are: π΄ = βΞππ΄ π΅ = Ξπ‘π΄ (8) πΆ = π‘π΄ ππ΄ + Ξππ΄ ) β ππ΄ (π‘π΄ + Ξπ‘π΄ ) ( We determine the inclination angles n1, n2, n3 by normalizing the coefficients: π΄ π΅ πΆ π = βπ΄2 + π΅2 + πΆ 2 , π1 = π , π2 = π , π3 = π (9) On this basis we can obtain the expression t=f(x): π1 π‘ + π2 π₯ + π3 = 0 π‘= βπ2 π₯+π3 (10) βπ1 Construction of Functional Voxel Model for a Spline Curve 5 The local geometrical characteristics are calculated and kept over the entire interval from 0 till 1 of the t-parameter. Using the given value of the x coordinate and the cor- responding inclination angles n1, n2, n3, we determine the value of the y coordinate: βπ2 π₯+π3 2 βπ2 π₯+π3 βπ2 π₯+π3 2 π¦(π₯ ) = (1 β ) π¦0 + (2 β ) π‘π¦1 + ( ) π¦2 (11) βπ1 βπ1 βπ1 The result of such algorithm implementation is represented in Fig. 3: Fig. 3. Construction of the Bezier curve by means of local-geometric approach Bezier curve can be successfully visualized in case of sequent location of anchor points along the axis x. Otherwise, the construction of the curve disrupts because of itsβ cur- vature which is peculiar to the parametrical nature. In this case, itβs possible to apply the rotation of the coordinate system so that the second anchor point will always lie between the first and the last one [9]. But with an increase of the amount of anchor points the complexity of multiple coordinate system rotations together with their cor- respondence will arise. Letβs consider another approach to the analytical representation of the Bezier curve. Parameters tx and ty separately determine the values of coordinates X and Y corre- spondingly to the parametrical expression of the Bezier curve. The points where pa- rameters tx and ty are matching, form the Bezier curve. The sign of the Difference of parameters tx and ty will determine the external and internal fields of the surface z = ty β tx of the Bezier curve. Fig.4 illustrates the implementation of such an approach: Fig. 4. Constructing the surface z. Itβs possible to draw a conclusion that the application of this algorithm also doesnβt allow to obtain an appropriate image of the Bezier curve in consequence of the curva- ture peculiar to it. Speaking about the Bezier curve, we cannot help but mention the De Casteljau's algorithm (Fig.5) [4]. On the basis of this algorithm lies the finding the Bezier curve tangents at each value of t-parameter. In case of the quadratic Bezier curve, t-parameter defines the location of the tangent segment Q0Q1, which ends are situated on the 6 A.Tolok, N. Tolok, A. Sycheva segments P0P1, P1P2 of anchor polygon. The point of tangency R in the segment Q0Q1 can also be determined by the t-parameter. Fig. 5. De Casteljau's algorithm. This algorithm is not only easy to implement but also convenient to apply in case of Bezier curve of higher degrees. To construct the cubic Bezier curve (Fig.5) the t-pa- rameter determines location of the tangent point A on the segment R0R1, location of the endpoints R0 and R1 on the segments Q0Q1 and Q1Q2 and location of the endpoints Q0, Q1, Q2 on the segments P0P1, P1P2, P2P3. De Casteljau's algorithm does not define the analytical representation of the Bezier curve, but can well be applied for this purpose. As an analytical representation of a function, we can use ranges of a function. Each tangent to a Bezier curve determines two half-planes with positive and negative value of the function space and the zero value on the boundary. Intersection of areas of two tangent lines will give itsβ aggregate positive area. The sequential intersection of the areas of the tangent functions form the different-sign space of the curve function. Internal area of the curve will be defined by the positive sign of the area, external β by the negative sign. Zero boundary will de- scribe the curve. The Fig.6 illustrates the intersection of areas of tangent functions obtained when t=t1 ΠΈ t=t2. Hatched areas visualize the positive areas of functions for each tangent. The cross-hatched area is the result of their intersection, so it is the aggregate positive area of the functions. Fig. 6. Intersection of the areas of two tangent functions to the Bezier curve. Construction of Functional Voxel Model for a Spline Curve 7 4 R-voxel modelling 4.1 The principles R-voxel modelling The proposed algorithm application demands set-theoretic operations on the areas of analytically represented functions. The analytical representation of the space of each function allow to obtain the method functional voxel modelling in the form of space of the local function as it was mentioned above. At the same time, the function is described by a set of voxel images (Image-model or M-image), mapping the local geometrical characteristics at each point of the function space β the components of a normal of higher dimensionality [3]. Realization of set-theoretic operations on the analytical representation of the func- tions is possible with the application of R-functional modelling [1, 2]. Negation operation for the function as well as union and intersection operations for the areas of two functions form the complete πΌ-system of R-functions: πΜ β‘ βπ 1 X β¨πΌ π = 1+πΌ (π + π + βπ 2 + π 2 β 2πΌππ) (12) 1 X β§πΌ π = (π + π β βπ 2 + π 2 β 2πΌππ) 1+πΌ Application of the R-functional calculations in pure form is a complex computational procedure. At the same time, the computational complexity of the resulting expression directly depends on the complexity of the original functions. Application of the func- tional voxel method (FVM) to the calculation of R-functional expressions significantly simplifies computing of the resulting function. These two approaches can be united by one general condition β preserving positive value in the internal area of a function, the negative value β in the external area and zero value on the boundaries. Moreover, this condition is met at any value of the parameter Ξ± of complete system of R-functions that allow to simplify calculations assuming Ξ±=1. Intersection operation for areas of two functions with the accepted simplification is described by the expression: π β§1 π = 0.5(π + π β βπ 2 + π 2 β 2ππ) = (13) 0.5(π + π β β(π β π)2 ) = 0.5(π + π β |π β π|) Within solving problem it is possible to ignore the multiplication of the resulting expression on the positive number because it doesnβt affect the sign of expression: X β§1 π = π + π β |π β π| (14) As it seen from the expression, intersection operation for areas of two functions consti- tutes the sequential realization of four operations: 1. Union of areas of original functions; 2. Complement of areas of original functions; 3. Absolute value of the complement of areas of original functions; 8 A.Tolok, N. Tolok, A. Sycheva 4. Complement of areas obtained at the stages 1 and 3. Let us consider the simple example of an implementation of such algorithm. We carry out the intersection of areas for functions X and Y for horizontal and ver- tical lines. The first function is described by four images πΆπ1 , πΆπ2 , πΆπ3 , πΆπ4 , the second β similarly by images πΆπ1 , πΆπ2 , πΆπ3 , πΆπ4 . The fig. 7 illustrates M-images of the functions X and Y as well as visualization of space of their functional areas ππ , ππ . The first three images for each line describe the components of a normal n1, n2, n3 at each point of space, while fourth images are mapping the component n4, which provide a character- istic of binding of tangent location to the corresponding point of the space. Fig. 7. The Functional-voxel model of two lines. Let n1X , nX2 , nX3 , nX4 denote the components of a normal of the first straight line, and n1Y , nY2 , nY3 , nY4 - the components of a normal of the second straight line. For each operation of the introduced algorithm, we calculate the values of n1, n2, n3, n4, relatively to the colour intensity palette πΆπ (π = 1 β¦ 4) for the application in further calculations. Then, the first step of the algorithm (union) will be implemented by the following expressions [3]: π1π+π = π1π π3π + π1π π3π π2π+π = π2π π3π + π2π π3π (15) π3π+π = π3π π3π π4 = π4π π3π + π4π π3π π+π In turn, the Complement will be almost similarly implemented by changing the sign to minus: π1πβπ = π1π π3π β π1π π3π π2πβπ = π2π π3π β π2π π3π (16) π3πβπ = π3π π3π π4πβπ = π4π π3π β π4π π3π Construction of Functional Voxel Model for a Spline Curve 9 Computing the Absolute value of the complement of original expressions is carried out in dependence if the sign of the local function: π πβπ π πβπ π πβπ π§ = β π1πβπ π₯ β π2πβπ π¦ + π4πβπ 3 3 3 |πβπ| π3 = π3πβπ (17) |πβπ| πβπ π§ < 0, π1,2,4 = 1 β π1,2,4 |πβπ| πβπ π§ > 0, π1,2,4 = π1,2,4 The last step is the Complement of expressions obtained at the stages 1 and 3: π+πβ|πβπ| |πβπ| |πβπ| π+π π1 = π1π+π π3 π3 β π1 π+πβ|πβπ| π+π |πβπ| |πβπ| π+π π2 = π 2 π3 β π2 π3 π+πβ|πβπ| (18) π+π |πβπ| π3 = π3 π3 π+πβ|πβπ| π+π |πβπ| |πβπ| π+π π4 = π 4 π3 β π4 π3 π+πβ|πβπ| Four M-images with calculated values n1,2,3,4 , as well as the visualization of the obtained functional area are represented in the Fig.8. Fig. 8. The result of intersection of two straight lines. Thus, we can observe R-voxel implementation for Intersection operation for areas of two functions. 4.2 R-voxel modelling of the Bezier curve The construction of the Bezier curve by an approach proposed in paragraph 3.2 is im- plemented by means of the algorithm represented in paragraph 4.1. Thus, the algorithm of creating functional-voxel representation of the Bezier curve has the following order: 1. Constructing the initial functional-voxel model of the first tangent line (t=0) by means of a set of M-images of the function X (πΆπ1 , πΆπ2 , πΆπ3 , πΆπ4 ). 2. Increase the value of the t-parameter by the value of chosen step. 3. Do while t<1 : a. Construct the functional voxel model of the tangent at the current value of t as M- images of the function Y (πΆπ1 , πΆπ2 , πΆπ3 , πΆπ4 ). b. Carry out the intersection of the areas of functions X and Y. 10 A.Tolok, N. Tolok, A. Sycheva c. Keep the result of intersection as M-images of the function X (πΆπ1 , πΆπ2 , πΆπ3 , πΆπ4 ). d. Increase the value of t-parameter by the value of chosen step. 4. Visualize the functional area of the resulting function X. Figure 9 represents the four M-images and visualization of the Range of a curve constructed by means of this algorithm. The last image (on the right side) illustrates the anchor points of the curve and the set of used tangents. Fig. 9. Analytical representation of the Bezier curve. Thus, the construction of the smooth curve can be successfully realized. Due to the De Casteljau's method lying in the base it is possible to similarly construct the curves by more points. The figure 10 represents the set of different curves constructed by 4 anchor points. Fig. 10. Cubic Bezier curve. As it seen from the represented images, it is also possible to construct closed contours applying this method. Further, via intersection of the areas of the few Bezier curves with each other or with the areas of other functions, it will be possible to construct more complicated structures. 5 Conclusion The represented approach provides the great opportunities of complete application of parametrically defined Bezier curve for the analytical modelling in the R-functional modelling procedures, which broadens the set of complicated curvilinear contours ap- plied for the construction in CAD models. Construction of Functional Voxel Model for a Spline Curve 11 References 1. Rvachev V.: Theory of R-functions and Some Applications. Naukova Dumka, Kiev (1982). 2. Sheiko T., Maksimenko-Sheiko K., Litvinova Yu., Lisin D.: R-functions and chevron sur- faces in machine building. Problemy mashinostroeniya 20(2), 54-60 (2017). 3. Tolok A.: Functional Voxel Method in Computer Modeling. Fizmatlit, Moscow (2016). 4. Karpov D., Struchenkov V.: Dynamic Programming as a Method of Spline Approximation in the CAD Systems of Linear Constructions. Russian Technological Journal 7(3), 77-88 (2019). 5. Guo M., Wang W., Zhao G. and Du X.: BΓ©zier Segmentation of T-spline Solids in Paramet- ric Domain. Computer-Aided Design & Applications 17(3), 502-512 (2019). 6. Zhang X.: CAD-based geometry parametrisation for shape optimisation using Non-uniform Rational B-splines. Doctoral dissertation, Queen Mary University of London (2018). 7. Wedel A., Franke U., Badino H., Cremers D.: B-spline modeling of road surfaces for freespace estimation. 2008 IEEE Intelligent Vehicles Symposium, 828-833 (2008) 8. Lian H., Kerfriden P., Bordas S.: Shape optimization directly from CAD: An isogeometric boundary element approach using T-splines. Computer Methods in Applied Mechanics and Engineering 317, 1-41 (2017). 9. Tolok A., Tolok N., Loktev M.: Modeling Function Domain for Curves Constructed Based on a Linear Combination of Basis Bernstein Polynomials. Programming and Computer Soft- ware 44(6), 526β532 (2018).