# Short Cyclic Algorithm for Turbo Block Construction
## 5 Short Cyclic Algorithm for Turbo Block Construction--AutoLISP-Based  
Based on the discussion in the previous paragraph, a short AutoLISP program is written and presented in Figure 15 (AutoCAD v.2024 and AutoLISP are trademarks of AutoDesk, Inc., San Francisco, CA, USA). Figure 14: Centers’ dispositions—squared connections. The function that draws the turbo block is named _draw-turbo-block_. _Draw-turbo-block_ draws a set of arcs, with each particular arc drawn by calling the function _draw_arc_, given in the lower part of the listing. The function _draw_arc_ draws an arc with the center at point _pt_, starting at azimuth _ang_I and ending at azimuth _ang_I. In the AutoCAD environment, the azimuth is measured from the east in the counterclockwise direction. The arc is drawn with radius \(r\) and placed in layer _lay_. The main function _draw-turbo-block_ receives the following arguments:  
_tc_--roundabout center  
_tau_--translation angle (\(\tau\), angle between translation axis and centerline leg, 30\({}^{\circ}\))  
_n_--number of translation axes (number of spirals)  
_RC1_, _Rm1_--in innermost radii  
_Rm2_, _Rc2_, _Rc3_, _Rm3_--radii of first divider  
_Rm4_, _Rc4_, _Rc5_, _Rm5_--radii of second divider  
_Rm6_, _Rc6_--outermost radii  
_laym_--layer for marking arcs  
_layc_--layer for curb arcs  
On line number 7, the angle _delta_ is calculated. This is the angle between two consecutive translation axes. Figure 15: AutoLISP function constructing the turbo block. All arcs are drawn in angular terms, from the starting to the ending azimuth. Angle _beta_ is going to be the start of a particular spiral and its starting value is equal to the translation angle _tau_ (line number 8). In line number 9, the center of the first part of the first spiral _C1_ is set at point _tc_. Then comes the _repeat_ cycle, starting at line 11 and closing at line 29. The cycle is repeated \(n\) times. In the case of turbo-rotor \(n\) is 4, in the case of turbo-star \(n\) is 3 and in the case of turbo-basic, turbo-egg, and turbo-spiral \(n\) is 2. The general idea is to draw turbo-rotor in four passes (four cycles), turbo-star in three cycles, and the rest in two cycles only. On the right side in Figure 16, it is shown that the turbo-rotor block is drawn as a set of _4_\(\times\)_4_ = _16_ subsets of arcs. In the case of turbo-egg, turbo-basic, or turbo-spiral block, there are only _2_\(\times\)_4_ = \(8\) subsets of arcs, but they still form three spiraling lanes just as the 16 of turbo-rotor subsets do. In fact, turbo-egg, turbo-basic, and turbo-spiral arcs are drawn in two cycles only, but with the double angle _delta_\(=180^{\circ}\). In the case of turbo-rotor, _delta_ is \(90^{\circ}\). Just after entering the _repeat_ cycle, the innermost arcs with radii _RC1_ and _Rm1_ are drawn (lines 12 and 13). These arcs start at the current angle _beta_ and extend up to _beta_\(+\)_delta_. Their center is at point _C1_. At line 14, the construction of the next segment of the spiraling arcs starts. These are the arcs surrounding the second divider (radii _Rm2_, _Rc2_, _Rc3_, and _Rm3_). In this short listing, matching only the marking lines is supported. Therefore, center _C23_ is moved for _Rm3-Rm1_ along the consecutive translation axis (azimuth _beta_\(+\)_pi_\(+\)_delta_) from center _C1_. All arcs belonging to this part of the spiral start at azimuth _beta_\(+\)_delta_ and end at azimuth _beta_\(+\)_2_\(\times\)_delta_. It should be noted that all curb arcs are drawn in layer _layc_, while all the marking arcs are drawn in layer _laym_. At line number 19, the construction of the next part of the spiral, the arcs with radii Rm4, Rc4, Rc5, and Rm5, starts. Their center _C45_ is moved from the previous center _C23_ along the next translation axis (with azimuth _beta_\(+\)_pi_\(+\)_2_\(\times\)_delta_), for _Rm4-Rm2_. All these arcs are centered at _C45_ and start at _beta_\(+\)_2_\(\times\)_delta_ and end at _beta_\(+\)_3_\(\times\)_delta_. Construction of the finishing part of the spiral starts at line 24 and ends at line 27.