@@ -92,39 +92,30 @@ def concrete_rectangular_section(
92
92
x_i_bot = cover + dia_bot / 2
93
93
spacing_top = (b - 2 * cover - dia_top ) / (n_top - 1 )
94
94
spacing_bot = (b - 2 * cover - dia_bot ) / (n_bot - 1 )
95
+
96
+ if area_top is None :
97
+ area_top = np .pi * dia_top ** 2 / 4
98
+ if area_bottom is None :
99
+ area_bottom = np .pi * dia_bot ** 2 / 4
95
100
96
101
# add top bars
97
102
for i in range (n_top ):
98
- if area_top :
99
- bar = primitive_sections .circular_section_by_area (
100
- area = area_top , n = n_circle , material = steel_mat
101
- )
102
- else :
103
- bar = primitive_sections .circular_section (
104
- d = dia_top , n = n_circle , material = steel_mat
105
- )
106
-
103
+ bar = primitive_sections .circular_section_by_area (
104
+ area = area_top , n = n_circle , material = steel_mat
105
+ )
107
106
bar = bar .shift_section (
108
107
x_offset = x_i_top + spacing_top * i , y_offset = d - cover - dia_top / 2
109
108
)
110
-
111
109
geom = (geom - bar ) + bar
112
110
113
111
# add bot bars
114
112
for i in range (n_bot ):
115
- if area_bot :
116
- bar = primitive_sections .circular_section_by_area (
117
- area = area_bot , n = n_circle , material = steel_mat
118
- )
119
- else :
120
- bar = primitive_sections .circular_section (
121
- d = dia_bot , n = n_circle , material = steel_mat
122
- )
123
-
113
+ bar = primitive_sections .circular_section_by_area (
114
+ area = area_bot , n = n_circle , material = steel_mat
115
+ )
124
116
bar = bar .shift_section (
125
117
x_offset = x_i_bot + spacing_bot * i , y_offset = cover + dia_bot / 2
126
118
)
127
-
128
119
geom = (geom - bar ) + bar
129
120
130
121
return geom
@@ -346,16 +337,16 @@ def concrete_tee_section(
346
337
spacing_top = (b_f - 2 * cover - dia_top ) / (n_top - 1 )
347
338
spacing_bot = (b - 2 * cover - dia_bot ) / (n_bot - 1 )
348
339
340
+ if area_top is None :
341
+ area_top = np .pi * dia_top ** 2 / 4
342
+ if area_bot is None :
343
+ area_bot = np .pi * dia_bot ** 2 / 4
344
+
349
345
# add top bars
350
346
for i in range (n_top ):
351
- if area_top :
352
- bar = primitive_sections .circular_section_by_area (
353
- area = area_top , n = n_circle , material = steel_mat
354
- )
355
- else :
356
- bar = primitive_sections .circular_section (
357
- d = dia_top , n = n_circle , material = steel_mat
358
- )
347
+ bar = primitive_sections .circular_section_by_area (
348
+ area = area_top , n = n_circle , material = steel_mat
349
+ )
359
350
360
351
bar = bar .shift_section (
361
352
x_offset = x_i_top + spacing_top * i , y_offset = d - cover - dia_top / 2
@@ -365,14 +356,9 @@ def concrete_tee_section(
365
356
366
357
# add bot bars
367
358
for i in range (n_bot ):
368
- if area_bot :
369
- bar = primitive_sections .circular_section_by_area (
370
- area = area_bot , n = n_circle , material = steel_mat
371
- )
372
- else :
373
- bar = primitive_sections .circular_section (
374
- d = dia_bot , n = n_circle , material = steel_mat
375
- )
359
+ bar = primitive_sections .circular_section (
360
+ d = dia_bot , n = n_circle , material = steel_mat
361
+ )
376
362
377
363
bar = bar .shift_section (
378
364
x_offset = x_i_bot + spacing_bot * i , y_offset = cover + dia_bot / 2
@@ -465,20 +451,15 @@ def concrete_circular_section(
465
451
r = d / 2 - cover - dia / 2
466
452
d_theta = 2 * np .pi / n_bar
467
453
454
+ if area_bar is None :
455
+ area_bar = np .pi * dia ** 2 / 4
468
456
for i in range (n_bar ):
469
- if area_bar :
470
- bar = primitive_sections .circular_section_by_area (
471
- area = area_bar , n = n_circle , material = steel_mat
472
- )
473
- else :
474
- bar = primitive_sections .circular_section (
475
- d = dia , n = n_circle , material = steel_mat
476
- )
477
-
457
+ bar = primitive_sections .circular_section_by_area (
458
+ area = area_bar , n = n_circle , material = steel_mat
459
+ )
478
460
bar = bar .shift_section (
479
461
x_offset = r * np .cos (i * d_theta ), y_offset = r * np .sin (i * d_theta )
480
462
)
481
-
482
463
geom = (geom - bar ) + bar
483
464
484
465
return geom
0 commit comments