#include svg_drawing.cpd
"Prestressed TT Panel
#deg
'Dimensions:
'Rib height -'h = ? {750}'mm
'Rib top width -'b_2 = ? {200}'mm
'Slab depth -'h_f = ? {100}'mm
'Rib spacing c/c -'B_0 = ? {1500}'mm
'Slab width -'B = ? {2500}'mm
#post
'Total height -'H = h + h_f'mm
'Rib bottom width -'b_1 = b_2 - (h - 30)/10'mm
'- mean -'b_w = (b_1 + b_2)/2'mm
'- at <var>z</var> from top -'b(z) = b_2 - (b_2 - b_1)*z/h'mm
'Rib effective width -'b_f = B/2'mm
#post
#show
'Distance from the center of the first row of tendons to the bottom edge -'d_p1 = ? {80}'mm
'Number of tendons in one row -'n_ph = ? {2}'
'Number of rows -'n_pv = ? {3}'
#pre
'<img  style="width:450pt;" src="https://proektsoft.bg/calcpad/Media/Structures/RC/Precast/TT-section.png" alt="TT-section.png">
#hide
x_1 = B_0/2
x_2 = x_1 + b_2/2
x_3 = x_2 + 140
x_4 = x_1 + b_1/2
x_5 = x_4 - b_1
x_6 = x_2 - b_2
x_7 = x_6 - 140
x_8 = x_1 - 20*(n_ph - 1)
#post
#val
'<svg viewbox="'-b_f - 200' -150 'B + 300' 'H + 400'" xmlns="http://www.w3.org/2000/svg" version="1.1" style="font-family: Arial Nova Cond, Noto Sans Cond, Segoe UI; font-size: '54'px; width:500pt; height:'500*H/B + 50'pt"> 
'<polygon points="'b_f','0' 'b_f','h_f' 'x_3','h_f' 'x_2','h_f + 30' 'x_4','H' 'x_5','H' 'x_6','h_f + 30' 'x_7','h_f' '-x_7','h_f' '-x_6','h_f + 30' '-x_5','H' '-x_4','H' '-x_2','h_f + 30' '-x_3','h_f' '-b_f','h_f' '-b_f','0'" sec_style$/>
line$(-x_1; -100; -x_1; H + 100; axis_style$)
line$( x_1; -100; x_1; H + 100; axis_style$)
dimh$(-b_f; b_f; -60; B = 'B' mm)
dimv$(-b_f - 60; 0; H; H = 'H' mm)
dimv$(-b_f + 80; 0; h_f; h<tspan dy=20>f</tspan><tspan dy=-20> = </tspan>'h_f' mm         )
dimv$(-b_f + 80; h_f; H; <tspan dy=100>h = 'h' mm</tspan>)
dimh$(-x_1; x_1; H + 180; B<tspan dy=5>₀</tspan><tspan dy=-5> = 'B_0'</tspan> mm)
dimh$(-x_2; -x_6; h_f + 120;            b<tspan dy=5>₂</tspan><tspan dy=-5> = </tspan>'b_2' mm)
dimh$(-x_4; -x_5; H + 80;            b<tspan dy=5>₁</tspan><tspan dy=-5> = </tspan>'b_1' mm)
#hide
#def tendon$ = r="10" style="stroke:red; fill:red; stroke-width:1"
i = 0
#repeat n_pv
	j = 0
	#repeat n_ph
		#post
		'<circle cx="'x_8 + 40*j'" cy="'H - d_p1 - 40*i'" tendon$/>
		'<circle cx="'-x_8 - 40*j'" cy="'H - d_p1 - 40*i'" tendon$/>
		#hide
		j = j + 1
	#loop
	i = i + 1
#loop
#post
'</svg>
#equ