stbkit 0.1.0a9.dev1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. stbkit/__main__.py +10 -0
  2. stbkit/api/__init__.py +48 -0
  3. stbkit/api/experimental/__init__.py +19 -0
  4. stbkit/api/experimental/repository/__init__.py +30 -0
  5. stbkit/api/py.typed +0 -0
  6. stbkit/api/stb_latest.py +7 -0
  7. stbkit/api/stb_v2_0_2.py +11 -0
  8. stbkit/api/stb_v2_1_1.py +9 -0
  9. stbkit/cli/__init__.py +17 -0
  10. stbkit/cli/_internal/cli_main.py +114 -0
  11. stbkit/cli/_internal/common.py +126 -0
  12. stbkit/cli/_internal/constants_exit_code.py +59 -0
  13. stbkit/cli/_internal/converter.py +693 -0
  14. stbkit/cli/_internal/diff.py +213 -0
  15. stbkit/cli/_internal/entry_points.py +25 -0
  16. stbkit/cli/_internal/global_parent.py +70 -0
  17. stbkit/cli/_internal/show_versions.py +36 -0
  18. stbkit/cli/_internal/validate.py +310 -0
  19. stbkit/cli/commands/convert.py +16 -0
  20. stbkit/cli/commands/diff.py +16 -0
  21. stbkit/cli/commands/validate.py +16 -0
  22. stbkit/cli/py.typed +0 -0
  23. stbkit/tools/__init__.py +12 -0
  24. stbkit/tools/_internal/__init__.py +5 -0
  25. stbkit/tools/_internal/constants.py +21 -0
  26. stbkit/tools/_internal/data_model/building_geometry.py +1208 -0
  27. stbkit/tools/_internal/data_model/building_geometry_web.py +106 -0
  28. stbkit/tools/_internal/data_model/element_data.py +93 -0
  29. stbkit/tools/_internal/data_model/ifc_data/entity_data.py +67 -0
  30. stbkit/tools/_internal/data_model/ifc_data/entity_names.py +32 -0
  31. stbkit/tools/_internal/data_model/shape_data.py +1089 -0
  32. stbkit/tools/_internal/diff/__init__.py +5 -0
  33. stbkit/tools/_internal/diff/common.py +50 -0
  34. stbkit/tools/_internal/diff/diff_xml.py +796 -0
  35. stbkit/tools/_internal/matrix.py +51 -0
  36. stbkit/tools/_internal/optional_dependencies/__init__.py +5 -0
  37. stbkit/tools/_internal/optional_dependencies/ifc_common.py +28 -0
  38. stbkit/tools/_internal/optional_dependencies/ifc_exporter/ifc_entity_exporter.py +473 -0
  39. stbkit/tools/_internal/optional_dependencies/ifc_exporter/ifc_profile_exporter.py +267 -0
  40. stbkit/tools/_internal/optional_dependencies/ifc_exporter/ifc_representation_exporter.py +178 -0
  41. stbkit/tools/_internal/optional_dependencies/ifc_pipeline.py +133 -0
  42. stbkit/tools/_internal/optional_dependencies/ifc_to_building_geometry.py +64 -0
  43. stbkit/tools/_internal/stb_io.py +116 -0
  44. stbkit/tools/_internal/stb_repair/_common.py +24 -0
  45. stbkit/tools/_internal/stb_repair/_stb_repair.py +197 -0
  46. stbkit/tools/_internal/stb_repair/_stb_v2_0_2_repair.py +53 -0
  47. stbkit/tools/_internal/stb_repair/_stb_v2_1_0_repair.py +109 -0
  48. stbkit/tools/_internal/stb_repair/_stb_v2_1_1_repair.py +109 -0
  49. stbkit/tools/_internal/studio_report.py +49 -0
  50. stbkit/tools/_internal/utils/atomic_writer.py +57 -0
  51. stbkit/tools/_internal/utils/float_rounding.py +49 -0
  52. stbkit/tools/_internal/utils/girder_utils.py +91 -0
  53. stbkit/tools/_internal/utils/guid_utils.py +30 -0
  54. stbkit/tools/_internal/utils/mesh_utils.py +1305 -0
  55. stbkit/tools/_internal/utils/node_utils.py +50 -0
  56. stbkit/tools/_internal/utils/unit_utils.py +23 -0
  57. stbkit/tools/_internal/vectors.py +222 -0
  58. stbkit/tools/converters/__init__.py +39 -0
  59. stbkit/tools/converters/_internal/__init__.py +5 -0
  60. stbkit/tools/converters/_internal/building_geometry_to_ply_text.py +32 -0
  61. stbkit/tools/converters/_internal/coord_converter.py +151 -0
  62. stbkit/tools/converters/_internal/element_data_to_building_geometry.py +549 -0
  63. stbkit/tools/converters/_internal/ifc_to_ply_text.py +21 -0
  64. stbkit/tools/converters/_internal/name_converter.py +23 -0
  65. stbkit/tools/converters/_internal/pipeline/__init__.py +5 -0
  66. stbkit/tools/converters/_internal/pipeline/data.py +188 -0
  67. stbkit/tools/converters/_internal/pipeline/execution.py +569 -0
  68. stbkit/tools/converters/_internal/pipeline/ply_pipeline.py +52 -0
  69. stbkit/tools/converters/_internal/pipeline/stb_pipeline.py +226 -0
  70. stbkit/tools/converters/_internal/pipeline/stb_pipeline_latest.py +39 -0
  71. stbkit/tools/converters/_internal/pipeline/step.py +139 -0
  72. stbkit/tools/converters/_internal/stb_latest_to_element_data/__init__.py +17 -0
  73. stbkit/tools/converters/_internal/stb_latest_to_element_data/_stb_latest_to_element_data.py +186 -0
  74. stbkit/tools/converters/_internal/stb_latest_to_element_data/member/member_footing.py +49 -0
  75. stbkit/tools/converters/_internal/stb_latest_to_element_data/member/member_line.py +533 -0
  76. stbkit/tools/converters/_internal/stb_latest_to_element_data/member/member_pile.py +100 -0
  77. stbkit/tools/converters/_internal/stb_latest_to_element_data/member/member_plane.py +103 -0
  78. stbkit/tools/converters/_internal/stb_latest_to_element_data/open.py +70 -0
  79. stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec.py +214 -0
  80. stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_beam_rc.py +67 -0
  81. stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_beam_s.py +97 -0
  82. stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_beam_src.py +28 -0
  83. stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_brace_s.py +49 -0
  84. stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_column_cft.py +217 -0
  85. stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_column_rc.py +41 -0
  86. stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_column_s.py +127 -0
  87. stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_column_src.py +173 -0
  88. stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_foundation.py +225 -0
  89. stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_parapet_rc.py +53 -0
  90. stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_pile_rc.py +106 -0
  91. stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_pile_s.py +100 -0
  92. stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_steel.py +432 -0
  93. stbkit/tools/converters/_internal/stb_to_building_geometry.py +44 -0
  94. stbkit/tools/converters/_internal/stb_to_ifc_data/__init__.py +5 -0
  95. stbkit/tools/converters/_internal/stb_to_ifc_data/_stb_to_ifc_data.py +59 -0
  96. stbkit/tools/converters/_internal/stb_to_ifc_data/convert_option.py +22 -0
  97. stbkit/tools/converters/_internal/stb_to_ply_text.py +22 -0
  98. stbkit/tools/py.typed +0 -0
  99. stbkit/tools/upgrade/__init__.py +13 -0
  100. stbkit/tools/upgrade/_internal/__init__.py +5 -0
  101. stbkit/tools/upgrade/_internal/common.py +205 -0
  102. stbkit/tools/upgrade/_internal/upgrade.py +228 -0
  103. stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/__init__.py +60 -0
  104. stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_common.py +62 -0
  105. stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_joint_beam_shape_h.py +44 -0
  106. stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_sec_pile_rc.py +101 -0
  107. stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_sec_pile_s.py +78 -0
  108. stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_sec_slab_deck.py +56 -0
  109. stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_sec_slab_rc.py +128 -0
  110. stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/post_girder.py +126 -0
  111. stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/post_open.py +110 -0
  112. stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/post_sec_beam_rc.py +227 -0
  113. stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/post_sec_beam_s.py +1153 -0
  114. stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hooks.py +22 -0
  115. stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/post.py +42 -0
  116. stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/tables.py +99 -0
  117. stbkit/tools/upgrade/_internal/v2_1_0_to_v2_1_1/__init__.py +58 -0
  118. stbkit/tools/upgrade/_internal/v2_1_0_to_v2_1_1/hooks.py +32 -0
  119. stbkit/tools/upgrade/_internal/v2_1_0_to_v2_1_1/tables.py +56 -0
  120. stbkit-0.1.0a9.dev1.dist-info/METADATA +196 -0
  121. stbkit-0.1.0a9.dev1.dist-info/RECORD +125 -0
  122. stbkit-0.1.0a9.dev1.dist-info/WHEEL +5 -0
  123. stbkit-0.1.0a9.dev1.dist-info/entry_points.txt +2 -0
  124. stbkit-0.1.0a9.dev1.dist-info/licenses/LICENSE +373 -0
  125. stbkit-0.1.0a9.dev1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,217 @@
1
+ # Copyright 2025-2026 TAISEI CORPORATION
2
+ # SPDX-License-Identifier: MPL-2.0
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
+
7
+ from stbkit.core.stb_exceptions import NoneAccessError
8
+ from stbkit.core.stb_reporting import Code, Phase, Reporter
9
+
10
+ from stbkit.api.experimental.repository import RepositoryLatest
11
+ from stbkit.api.stb_latest import (
12
+ StbSecColumnCft,
13
+ StbSecSteelColumnCftNotSame,
14
+ StbSecSteelColumnCftThreeTypes,
15
+ StbSecSteelFigureColumnCft,
16
+ )
17
+
18
+ from ....._internal.data_model.shape_data import (
19
+ SHAPE_PAIRS_UNKNOWN,
20
+ Shape,
21
+ ShapeBox,
22
+ ShapeBuildBox,
23
+ ShapeCircle,
24
+ ShapePair,
25
+ ShapePipe,
26
+ ShapeRectangle,
27
+ ShapeUnknown,
28
+ )
29
+ from . import sec_steel
30
+
31
+
32
+ def _filled_concrete_shape(shape: Shape, report: Reporter) -> Shape:
33
+ match shape:
34
+ case ShapeBox():
35
+ return ShapeRectangle(
36
+ name=shape.name,
37
+ width_x=shape.b - 2 * shape.t,
38
+ width_y=shape.a - 2 * shape.t,
39
+ )
40
+ case ShapeBuildBox():
41
+ return ShapeRectangle(
42
+ name=shape.name,
43
+ width_x=shape.b - 2 * shape.t1,
44
+ width_y=shape.a - 2 * shape.t2,
45
+ )
46
+ case ShapePipe():
47
+ return ShapeCircle(name=shape.name, d=shape.d - 2 * shape.t)
48
+ case _:
49
+ report.warning(
50
+ message="充填できない形状の断面がCFTに使われています",
51
+ code=Code.SCHEMA_ERROR,
52
+ phase=Phase.CONVERT_IFC,
53
+ )
54
+ return ShapeUnknown()
55
+
56
+
57
+ def stb_sec_column_cft_to_shapes(
58
+ repo: RepositoryLatest, sec_column_cft: StbSecColumnCft, reporter: Reporter
59
+ ) -> list[ShapePair] | tuple[list[ShapePair], list[ShapePair]]:
60
+ try:
61
+ steel_figure: StbSecSteelFigureColumnCft = (
62
+ sec_column_cft.stb_sec_steel_figure_column_cft
63
+ )
64
+ except NoneAccessError:
65
+ reporter.warning(
66
+ message="鉄骨形状が設定されていません",
67
+ code=Code.SCHEMA_ERROR,
68
+ phase=Phase.CONVERT_IFC,
69
+ stb_element=sec_column_cft,
70
+ )
71
+ return SHAPE_PAIRS_UNKNOWN
72
+ try:
73
+ shape: Shape = sec_steel.stb_sec_steel_name_to_shape(
74
+ repo, steel_figure.stb_sec_steel_column_cft_same.shape, reporter=reporter
75
+ )
76
+ return (
77
+ [ShapePair(_filled_concrete_shape(shape, reporter))],
78
+ [ShapePair(shape)],
79
+ )
80
+ except NoneAccessError:
81
+ pass
82
+ not_same: list[StbSecSteelColumnCftNotSame] = (
83
+ steel_figure.stb_sec_steel_column_cft_not_same
84
+ )
85
+ three_types: list[StbSecSteelColumnCftThreeTypes] = (
86
+ steel_figure.stb_sec_steel_column_cft_three_types
87
+ )
88
+ if not_same:
89
+ not_same_bottom: StbSecSteelColumnCftNotSame | None = next(
90
+ (x for x in not_same if x.pos == "BOTTOM"), None
91
+ )
92
+ not_same_top: StbSecSteelColumnCftNotSame | None = next(
93
+ (x for x in not_same if x.pos == "TOP"), None
94
+ )
95
+ if (
96
+ not_same_bottom is None
97
+ or not_same_top is None
98
+ or not_same_bottom.shape_or_none is None
99
+ or not_same_top.shape_or_none is None
100
+ ):
101
+ reporter.warning(
102
+ message="TOP,BOTTOMがそろっていません",
103
+ code=Code.SCHEMA_ERROR,
104
+ phase=Phase.CONVERT_IFC,
105
+ stb_element=sec_column_cft,
106
+ )
107
+ return SHAPE_PAIRS_UNKNOWN
108
+ return (
109
+ [
110
+ ShapePair(
111
+ _filled_concrete_shape(
112
+ sec_steel.stb_sec_steel_name_to_shape(
113
+ repo, not_same_bottom.shape, reporter
114
+ ),
115
+ reporter,
116
+ )
117
+ ),
118
+ ShapePair(
119
+ _filled_concrete_shape(
120
+ sec_steel.stb_sec_steel_name_to_shape(
121
+ repo, not_same_top.shape, reporter
122
+ ),
123
+ reporter,
124
+ ),
125
+ ),
126
+ ],
127
+ [
128
+ ShapePair(
129
+ sec_steel.stb_sec_steel_name_to_shape(
130
+ repo, not_same_bottom.shape, reporter
131
+ )
132
+ ),
133
+ ShapePair(
134
+ sec_steel.stb_sec_steel_name_to_shape(
135
+ repo, not_same_top.shape, reporter
136
+ ),
137
+ ),
138
+ ],
139
+ )
140
+ elif three_types:
141
+ three_types_bottom: StbSecSteelColumnCftThreeTypes | None = next(
142
+ (x for x in three_types if x.pos == "BOTTOM"), None
143
+ )
144
+ three_types_center: StbSecSteelColumnCftThreeTypes | None = next(
145
+ (x for x in three_types if x.pos == "CENTER"), None
146
+ )
147
+ three_types_top: StbSecSteelColumnCftThreeTypes | None = next(
148
+ (x for x in three_types if x.pos == "TOP"), None
149
+ )
150
+ if (
151
+ three_types_bottom is None
152
+ or three_types_center is None
153
+ or three_types_top is None
154
+ or three_types_bottom.shape_or_none is None
155
+ or three_types_center.shape_or_none is None
156
+ or three_types_top.shape_or_none is None
157
+ ):
158
+ reporter.warning(
159
+ message="TOP,CENTER,BOTTOMがそろっていません",
160
+ code=Code.SCHEMA_ERROR,
161
+ phase=Phase.CONVERT_IFC,
162
+ stb_element=sec_column_cft,
163
+ )
164
+ return SHAPE_PAIRS_UNKNOWN
165
+ return (
166
+ [
167
+ ShapePair(
168
+ _filled_concrete_shape(
169
+ sec_steel.stb_sec_steel_name_to_shape(
170
+ repo, three_types_bottom.shape, reporter
171
+ ),
172
+ reporter,
173
+ )
174
+ ),
175
+ ShapePair(
176
+ _filled_concrete_shape(
177
+ sec_steel.stb_sec_steel_name_to_shape(
178
+ repo, three_types_center.shape, reporter
179
+ ),
180
+ reporter,
181
+ )
182
+ ),
183
+ ShapePair(
184
+ _filled_concrete_shape(
185
+ sec_steel.stb_sec_steel_name_to_shape(
186
+ repo, three_types_top.shape, reporter
187
+ ),
188
+ reporter,
189
+ )
190
+ ),
191
+ ],
192
+ [
193
+ ShapePair(
194
+ sec_steel.stb_sec_steel_name_to_shape(
195
+ repo, three_types_bottom.shape, reporter
196
+ )
197
+ ),
198
+ ShapePair(
199
+ sec_steel.stb_sec_steel_name_to_shape(
200
+ repo, three_types_center.shape, reporter
201
+ ),
202
+ ),
203
+ ShapePair(
204
+ sec_steel.stb_sec_steel_name_to_shape(
205
+ repo, three_types_top.shape, reporter
206
+ ),
207
+ ),
208
+ ],
209
+ )
210
+
211
+ reporter.warning(
212
+ message="鉄骨形状が設定されていません",
213
+ code=Code.SCHEMA_ERROR,
214
+ phase=Phase.CONVERT_IFC,
215
+ stb_element=sec_column_cft,
216
+ )
217
+ return SHAPE_PAIRS_UNKNOWN
@@ -0,0 +1,41 @@
1
+ # Copyright 2025-2026 TAISEI CORPORATION
2
+ # SPDX-License-Identifier: MPL-2.0
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
+
7
+ from stbkit.api.stb_latest import (
8
+ StbSecColumnCircle,
9
+ StbSecColumnRc,
10
+ StbSecColumnRect,
11
+ StbSecFigureColumnRc,
12
+ )
13
+
14
+ from ....._internal.data_model.shape_data import (
15
+ ShapeCircle,
16
+ ShapePair,
17
+ ShapeRectangle,
18
+ )
19
+
20
+
21
+ def stb_sec_column_rc_to_shapes(
22
+ stb_sec_column_rc: StbSecColumnRc,
23
+ ) -> list[ShapePair]:
24
+ figure: StbSecFigureColumnRc | None = stb_sec_column_rc.stb_sec_figure_column_rc
25
+ if not figure:
26
+ return []
27
+ rect: StbSecColumnRect | None = figure.stb_sec_column_rect_or_none
28
+ if rect:
29
+ return [
30
+ ShapePair(
31
+ ShapeRectangle(
32
+ name=stb_sec_column_rc.name,
33
+ width_x=rect.width_x,
34
+ width_y=rect.width_y,
35
+ )
36
+ )
37
+ ]
38
+ circle: StbSecColumnCircle | None = figure.stb_sec_column_circle_or_none
39
+ if circle:
40
+ return [ShapePair(ShapeCircle(name=stb_sec_column_rc.name, d=circle.d))]
41
+ return []
@@ -0,0 +1,127 @@
1
+ # Copyright 2025-2026 TAISEI CORPORATION
2
+ # SPDX-License-Identifier: MPL-2.0
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
+
7
+ from stbkit.core.stb_exceptions import StbError
8
+ from stbkit.core.stb_reporting import Code, Phase, Reporter
9
+
10
+ from stbkit.api.experimental.repository import RepositoryLatest
11
+ from stbkit.api.stb_latest import (
12
+ StbSecColumnS,
13
+ StbSecSteelColumnSNotSame,
14
+ StbSecSteelColumnSSame,
15
+ StbSecSteelColumnSThreeTypes,
16
+ StbSecSteelFigureColumnS,
17
+ )
18
+
19
+ from ....._internal.data_model.shape_data import SHAPE_PAIRS_UNKNOWN, Shape, ShapePair
20
+ from . import sec_steel
21
+
22
+
23
+ def stb_sec_column_s_to_shapes(
24
+ repo: RepositoryLatest,
25
+ sec_c: StbSecColumnS,
26
+ reporter: Reporter,
27
+ ) -> list[ShapePair]:
28
+ result: list[ShapePair] = []
29
+ figure: StbSecSteelFigureColumnS = sec_c.stb_sec_steel_figure_column_s
30
+ try:
31
+ same: StbSecSteelColumnSSame | None = figure.stb_sec_steel_column_s_same_or_none
32
+ not_sames: list[StbSecSteelColumnSNotSame] = (
33
+ figure.stb_sec_steel_column_s_not_same
34
+ )
35
+ three_types_list: list[StbSecSteelColumnSThreeTypes] = (
36
+ figure.stb_sec_steel_column_s_three_types
37
+ )
38
+
39
+ if same is not None:
40
+ shape_name: str | None = same.shape
41
+ if shape_name:
42
+ shape: Shape = sec_steel.stb_sec_steel_name_to_shape(
43
+ repo, shape_name, reporter=reporter
44
+ )
45
+ result = [ShapePair(shape)]
46
+ elif not_sames:
47
+ try:
48
+ bottom: StbSecSteelColumnSNotSame = next(
49
+ not_same for not_same in not_sames if not_same.pos == "BOTTOM"
50
+ )
51
+ top: StbSecSteelColumnSNotSame = next(
52
+ not_same for not_same in not_sames if not_same.pos == "TOP"
53
+ )
54
+ except StopIteration:
55
+ reporter.warning(
56
+ message="not_same断面にBOTTOM,TOPの両方が指定されていません",
57
+ code=Code.SCHEMA_ERROR,
58
+ phase=Phase.CONVERT_IFC,
59
+ stb_element=sec_c,
60
+ )
61
+ return SHAPE_PAIRS_UNKNOWN
62
+ for not_same in (bottom, top):
63
+ shape_name = not_same.shape
64
+ if shape_name:
65
+ shape = sec_steel.stb_sec_steel_name_to_shape(
66
+ repo, shape_name, reporter
67
+ )
68
+ result.append(ShapePair(shape))
69
+ elif three_types_list:
70
+ try:
71
+ three_types_bottom: StbSecSteelColumnSThreeTypes = next(
72
+ three_types
73
+ for three_types in three_types_list
74
+ if three_types.pos == "BOTTOM"
75
+ )
76
+ three_types_center: StbSecSteelColumnSThreeTypes = next(
77
+ three_types
78
+ for three_types in three_types_list
79
+ if three_types.pos == "CENTER"
80
+ )
81
+ three_types_top: StbSecSteelColumnSThreeTypes = next(
82
+ three_types
83
+ for three_types in three_types_list
84
+ if three_types.pos == "TOP"
85
+ )
86
+ except StopIteration:
87
+ reporter.warning(
88
+ message="three_types断面にBOTTOM,CENTER,TOPの全てが指定されていません",
89
+ code=Code.SCHEMA_ERROR,
90
+ phase=Phase.CONVERT_IFC,
91
+ stb_element=sec_c,
92
+ )
93
+ return SHAPE_PAIRS_UNKNOWN
94
+ for three_types in (
95
+ three_types_bottom,
96
+ three_types_center,
97
+ three_types_top,
98
+ ):
99
+ shape_name = three_types.shape
100
+ if shape_name:
101
+ shape = sec_steel.stb_sec_steel_name_to_shape(
102
+ repo, shape_name, reporter
103
+ )
104
+ result.append(ShapePair(shape))
105
+ if (
106
+ sec_c.is_reference_direction_or_none is not None
107
+ and not sec_c.is_reference_direction_or_none
108
+ ):
109
+ for shape_pair in result:
110
+ if shape_pair.start.rotate_degree:
111
+ shape_pair.start.rotate_degree += 90.0
112
+ else:
113
+ shape_pair.start.rotate_degree = 90.0
114
+ if shape_pair.end:
115
+ if shape_pair.end.rotate_degree:
116
+ shape_pair.end.rotate_degree += 90.0
117
+ else:
118
+ shape_pair.end.rotate_degree = 90.0
119
+ return result
120
+ except (StbError, RuntimeError, AssertionError, TypeError, ValueError):
121
+ reporter.warning(
122
+ message="断面形状が不明です",
123
+ code=Code.SCHEMA_ERROR,
124
+ phase=Phase.CONVERT_IFC,
125
+ stb_element=sec_c,
126
+ )
127
+ return SHAPE_PAIRS_UNKNOWN
@@ -0,0 +1,173 @@
1
+ # Copyright 2025-2026 TAISEI CORPORATION
2
+ # SPDX-License-Identifier: MPL-2.0
3
+ # This Source Code Form is subject to the terms of the Mozilla Public
4
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ # file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
+
7
+ from stbkit.core.stb_exceptions import NoneAccessError
8
+ from stbkit.core.stb_reporting import Code, Phase, Reporter
9
+
10
+ from stbkit.api.experimental.repository import RepositoryLatest
11
+ from stbkit.api.stb_latest import (
12
+ StbSecColumnRect,
13
+ StbSecColumnSrc,
14
+ StbSecFigureColumnSrc,
15
+ StbSecSteelColumnSrcNotSame,
16
+ StbSecSteelColumnSrcSame,
17
+ StbSecSteelColumnSrcThreeTypes,
18
+ StbSecSteelFigureColumnSrc,
19
+ )
20
+
21
+ from ....._internal.data_model.shape_data import (
22
+ SHAPE_PAIR_UNDEFINED,
23
+ ShapeCircle,
24
+ ShapePair,
25
+ ShapeRectangle,
26
+ )
27
+ from . import sec_steel
28
+
29
+
30
+ def stb_sec_column_src_to_shapes(
31
+ repo: RepositoryLatest, sec_column_src: StbSecColumnSrc, reporter: Reporter
32
+ ) -> list[ShapePair] | tuple[list[ShapePair], list[ShapePair]] | None:
33
+ shapes_rc: list[ShapePair] = []
34
+ shapes_s: list[ShapePair] = []
35
+
36
+ # RC断面
37
+ sec_figure_column_src: StbSecFigureColumnSrc | None = (
38
+ sec_column_src.stb_sec_figure_column_src_or_none
39
+ )
40
+ if sec_figure_column_src:
41
+ name_rc: str = f"{sec_column_src.name_or_none}_RC"
42
+ try:
43
+ shapes_rc.append(
44
+ ShapePair(
45
+ ShapeCircle(
46
+ name=name_rc,
47
+ d=sec_figure_column_src.stb_sec_column_circle.d,
48
+ ),
49
+ )
50
+ )
51
+ except NoneAccessError:
52
+ pass
53
+ try:
54
+ sec_column_rect: StbSecColumnRect = (
55
+ sec_figure_column_src.stb_sec_column_rect
56
+ )
57
+ shapes_rc.append(
58
+ ShapePair(
59
+ ShapeRectangle(
60
+ name=name_rc,
61
+ width_x=sec_column_rect.width_x,
62
+ width_y=sec_column_rect.width_y,
63
+ ),
64
+ )
65
+ )
66
+ except NoneAccessError:
67
+ pass
68
+ if not shapes_rc:
69
+ reporter.warning(
70
+ message="RC断面の形状が取得できません",
71
+ code=Code.MISSING_ATTRIBUTE,
72
+ phase=Phase.CONVERT_IFC,
73
+ stb_element=sec_figure_column_src,
74
+ )
75
+ # S断面
76
+ sec_steel_figure_column_src: StbSecSteelFigureColumnSrc | None = (
77
+ sec_column_src.stb_sec_steel_figure_column_src_or_none
78
+ )
79
+ if sec_steel_figure_column_src:
80
+ sec_steel_column_src_same: StbSecSteelColumnSrcSame | None = (
81
+ sec_steel_figure_column_src.stb_sec_steel_column_src_same_or_none
82
+ )
83
+ src_not_same_list: list[StbSecSteelColumnSrcNotSame] = (
84
+ sec_steel_figure_column_src.stb_sec_steel_column_src_not_same
85
+ )
86
+ src_three_types_list: list[StbSecSteelColumnSrcThreeTypes] = (
87
+ sec_steel_figure_column_src.stb_sec_steel_column_src_three_types
88
+ )
89
+ if sec_steel_column_src_same:
90
+ shapes_s.append(
91
+ sec_steel.stb_sec_steel_column_src_shape_to_shape_pair(
92
+ repo,
93
+ sec_steel_column_src_same,
94
+ reporter,
95
+ )
96
+ )
97
+ elif src_not_same_list:
98
+ try:
99
+ bottom: StbSecSteelColumnSrcNotSame = next(
100
+ not_same
101
+ for not_same in src_not_same_list
102
+ if not_same.pos == "BOTTOM"
103
+ )
104
+ shapes_s.append(
105
+ sec_steel.stb_sec_steel_column_src_shape_to_shape_pair(
106
+ repo,
107
+ bottom,
108
+ reporter,
109
+ )
110
+ )
111
+ except StopIteration:
112
+ shapes_s.append(SHAPE_PAIR_UNDEFINED)
113
+ try:
114
+ top: StbSecSteelColumnSrcNotSame = next(
115
+ not_same for not_same in src_not_same_list if not_same.pos == "TOP"
116
+ )
117
+ shapes_s.append(
118
+ sec_steel.stb_sec_steel_column_src_shape_to_shape_pair(
119
+ repo,
120
+ top,
121
+ reporter,
122
+ )
123
+ )
124
+ except StopIteration:
125
+ shapes_s.append(SHAPE_PAIR_UNDEFINED)
126
+ elif src_three_types_list:
127
+ try:
128
+ bottom_three: StbSecSteelColumnSrcThreeTypes = next(
129
+ three_types
130
+ for three_types in src_three_types_list
131
+ if three_types.pos == "BOTTOM"
132
+ )
133
+ shapes_s.append(
134
+ sec_steel.stb_sec_steel_column_src_shape_to_shape_pair(
135
+ repo,
136
+ bottom_three,
137
+ reporter,
138
+ )
139
+ )
140
+ except StopIteration:
141
+ shapes_s.append(SHAPE_PAIR_UNDEFINED)
142
+ try:
143
+ center_three: StbSecSteelColumnSrcThreeTypes = next(
144
+ three_types
145
+ for three_types in src_three_types_list
146
+ if three_types.pos == "CENTER"
147
+ )
148
+ shapes_s.append(
149
+ sec_steel.stb_sec_steel_column_src_shape_to_shape_pair(
150
+ repo,
151
+ center_three,
152
+ reporter,
153
+ )
154
+ )
155
+ except StopIteration:
156
+ shapes_s.append(SHAPE_PAIR_UNDEFINED)
157
+ try:
158
+ top_three: StbSecSteelColumnSrcThreeTypes = next(
159
+ three_types
160
+ for three_types in src_three_types_list
161
+ if three_types.pos == "TOP"
162
+ )
163
+ shapes_s.append(
164
+ sec_steel.stb_sec_steel_column_src_shape_to_shape_pair(
165
+ repo,
166
+ top_three,
167
+ reporter,
168
+ )
169
+ )
170
+ except StopIteration:
171
+ shapes_s.append(SHAPE_PAIR_UNDEFINED)
172
+
173
+ return (shapes_rc, shapes_s)