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,225 @@
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_reporting import Code, Phase, Reporter
8
+
9
+ from stbkit.api.stb_latest import (
10
+ StbSecFigureFoundationRc,
11
+ StbSecFoundationRc,
12
+ StbSecFoundationRcContinuous,
13
+ StbSecFoundationRcEquiTriangle,
14
+ StbSecFoundationRcOctagon,
15
+ StbSecFoundationRcRect,
16
+ StbSecFoundationRcTaperedRect,
17
+ StbSecFoundationRcTriangle,
18
+ )
19
+
20
+ from ....._internal.data_model.shape_data import (
21
+ SHAPE_PAIRS_UNDEFINED,
22
+ ShapeEquilateralTriangle,
23
+ ShapeOctagon,
24
+ ShapePair,
25
+ ShapeRectangle,
26
+ ShapeRightTriangle,
27
+ )
28
+
29
+
30
+ def stb_sec_foundation_rc_to_shapes_and_depth(
31
+ stb_sec_foundation_rc: StbSecFoundationRc,
32
+ reporter: Reporter,
33
+ *,
34
+ column_width_x: float | None = None,
35
+ column_width_y: float | None = None,
36
+ girder_width: float | None = None,
37
+ ) -> tuple[list[ShapePair], list[float]]:
38
+ figure: StbSecFigureFoundationRc | None = (
39
+ stb_sec_foundation_rc.stb_sec_figure_foundation_rc
40
+ )
41
+ if not figure:
42
+ return ([], [])
43
+ rect: StbSecFoundationRcRect | None = figure.stb_sec_foundation_rc_rect_or_none
44
+ if rect is not None:
45
+ return (
46
+ [
47
+ ShapePair(
48
+ ShapeRectangle(
49
+ name=stb_sec_foundation_rc.name,
50
+ width_x=rect.width_x,
51
+ width_y=rect.width_y,
52
+ )
53
+ )
54
+ ],
55
+ [rect.depth],
56
+ )
57
+ tapered_rect: StbSecFoundationRcTaperedRect | None = (
58
+ figure.stb_sec_foundation_rc_tapered_rect_or_none
59
+ )
60
+ if tapered_rect is not None:
61
+ depth_tip: float = tapered_rect.depth_tip_or_none or 0.0
62
+ depth_base: float = tapered_rect.depth_base_or_none or 0.0
63
+ top_width_x: float | None = column_width_x
64
+ top_width_y: float | None = column_width_y
65
+ if top_width_x is None or top_width_y is None:
66
+ reporter.warning(
67
+ "TaperedRectの上側のサイズが不明なため、底面の1/2のサイズで出力します。",
68
+ code=Code.UNEXPECTED_ERROR,
69
+ phase=Phase.CONVERT_IFC,
70
+ )
71
+ top_width_x = top_width_x or tapered_rect.width_x / 2.0
72
+ top_width_y = top_width_y or tapered_rect.width_y / 2.0
73
+ return [
74
+ ShapePair(
75
+ ShapeRectangle(
76
+ name=f"{stb_sec_foundation_rc.name}_bottom",
77
+ width_x=tapered_rect.width_x,
78
+ width_y=tapered_rect.width_y,
79
+ )
80
+ ),
81
+ ShapePair(
82
+ ShapeRectangle(
83
+ name=f"{stb_sec_foundation_rc.name}_switch",
84
+ width_x=tapered_rect.width_x,
85
+ width_y=tapered_rect.width_y,
86
+ ),
87
+ ShapeRectangle(
88
+ name=f"{stb_sec_foundation_rc.name}_top",
89
+ width_x=top_width_x,
90
+ width_y=top_width_y,
91
+ ),
92
+ ),
93
+ ], [depth_tip, depth_base - depth_tip]
94
+ triangle: StbSecFoundationRcTriangle | None = (
95
+ figure.stb_sec_foundation_rc_triangle_or_none
96
+ )
97
+ if triangle is not None:
98
+ return [
99
+ ShapePair(
100
+ ShapeRightTriangle(
101
+ name=stb_sec_foundation_rc.name,
102
+ width_x=triangle.width_x_or_none or 0.0,
103
+ width_y=triangle.width_y_or_none or 0.0,
104
+ chamfer_x=triangle.width_chamfer_x_or_none or 0.0,
105
+ chamfer_y=triangle.width_chamfer_y_or_none or 0.0,
106
+ )
107
+ )
108
+ ], [triangle.depth_or_none or 0.0]
109
+ equi_triangle: StbSecFoundationRcEquiTriangle | None = (
110
+ figure.stb_sec_foundation_rc_equi_triangle_or_none
111
+ )
112
+ if equi_triangle is not None:
113
+ return [
114
+ ShapePair(
115
+ ShapeEquilateralTriangle(
116
+ name=stb_sec_foundation_rc.name,
117
+ width_base=equi_triangle.width_base_or_none or 0.0,
118
+ width_chamfer=equi_triangle.width_chamfer_or_none or 0.0,
119
+ )
120
+ )
121
+ ], [equi_triangle.depth_or_none or 0.0]
122
+ octagon: StbSecFoundationRcOctagon | None = (
123
+ figure.stb_sec_foundation_rc_octagon_or_none
124
+ )
125
+ if octagon is not None:
126
+ return [
127
+ ShapePair(
128
+ ShapeOctagon(
129
+ name=stb_sec_foundation_rc.name,
130
+ width_x=octagon.width_x_or_none or 0.0,
131
+ width_y=octagon.width_y_or_none or 0.0,
132
+ width_chamfer_bottom_left_x=octagon.width_chamfer1_x_or_none or 0.0,
133
+ width_chamfer_bottom_left_y=octagon.width_chamfer1_y_or_none or 0.0,
134
+ width_chamfer_bottom_right_x=octagon.width_chamfer2_x_or_none
135
+ or 0.0,
136
+ width_chamfer_bottom_right_y=octagon.width_chamfer2_y_or_none
137
+ or 0.0,
138
+ width_chamfer_top_right_x=octagon.width_chamfer3_x_or_none or 0.0,
139
+ width_chamfer_top_right_y=octagon.width_chamfer3_y_or_none or 0.0,
140
+ width_chamfer_top_left_x=octagon.width_chamfer4_x_or_none or 0.0,
141
+ width_chamfer_top_left_y=octagon.width_chamfer4_y_or_none or 0.0,
142
+ )
143
+ )
144
+ ], [octagon.depth]
145
+
146
+ continuous: StbSecFoundationRcContinuous | None = (
147
+ figure.stb_sec_foundation_rc_continuous_or_none
148
+ )
149
+ if continuous is not None:
150
+ width_x: float = continuous.width_or_none or 0.0
151
+ width_y: float = continuous.depth_base_or_none or 0.0
152
+ width_top_x: float | None = girder_width
153
+ if width_top_x is None:
154
+ reporter.warning(
155
+ "連続基礎の上側の幅が不明なため、底面の1/2のサイズで出力します。",
156
+ code=Code.UNEXPECTED_ERROR,
157
+ phase=Phase.CONVERT_IFC,
158
+ )
159
+ width_top_x = width_x / 2.0
160
+ match continuous.type_or_none:
161
+ case "RIGHT_L" | "LEFT_L":
162
+ chamfer_x: float = width_x - width_top_x
163
+ case "REVERSE_T":
164
+ chamfer_x = (width_x - width_top_x) / 2.0
165
+ case _:
166
+ reporter.warning(
167
+ f"連続基礎のタイプ '{continuous.type_or_none}' はスキーマ違反です",
168
+ code=Code.SCHEMA_ERROR,
169
+ phase=Phase.CONVERT_IFC,
170
+ stb_element=continuous,
171
+ )
172
+ return (SHAPE_PAIRS_UNDEFINED, [])
173
+ chamfer_y: float = width_y - (continuous.depth_tip_or_none or 0.0)
174
+ if chamfer_x == 0.0 or chamfer_y == 0.0:
175
+ return [
176
+ ShapePair(
177
+ ShapeRectangle(
178
+ name=stb_sec_foundation_rc.name,
179
+ width_x=width_x,
180
+ width_y=width_y,
181
+ )
182
+ )
183
+ ], []
184
+ match continuous.type_or_none:
185
+ case "RIGHT_L":
186
+ return [
187
+ ShapePair(
188
+ ShapeOctagon(
189
+ name=stb_sec_foundation_rc.name,
190
+ width_x=width_x,
191
+ width_y=width_y,
192
+ width_chamfer_top_right_x=chamfer_x,
193
+ width_chamfer_top_right_y=chamfer_y,
194
+ )
195
+ )
196
+ ], []
197
+ case "LEFT_L":
198
+ return [
199
+ ShapePair(
200
+ ShapeOctagon(
201
+ name=stb_sec_foundation_rc.name,
202
+ width_x=width_x,
203
+ width_y=width_y,
204
+ width_chamfer_top_left_x=chamfer_x,
205
+ width_chamfer_top_left_y=chamfer_y,
206
+ )
207
+ )
208
+ ], []
209
+
210
+ case "REVERSE_T":
211
+ return [
212
+ ShapePair(
213
+ ShapeOctagon(
214
+ name=stb_sec_foundation_rc.name,
215
+ width_x=width_x,
216
+ width_y=width_y,
217
+ width_chamfer_top_right_x=chamfer_x,
218
+ width_chamfer_top_right_y=chamfer_y,
219
+ width_chamfer_top_left_x=chamfer_x,
220
+ width_chamfer_top_left_y=chamfer_y,
221
+ )
222
+ )
223
+ ], []
224
+
225
+ return ([], [])
@@ -0,0 +1,53 @@
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_reporting import Code, Phase, Reporter
8
+
9
+ from stbkit.api.stb_latest import (
10
+ StbSecFigureParapetRc,
11
+ StbSecParapetRc,
12
+ StbSecParapetRcTypeI,
13
+ )
14
+
15
+ from ....._internal.data_model.shape_data import (
16
+ SHAPE_PAIRS_UNKNOWN,
17
+ Shape,
18
+ ShapePair,
19
+ ShapeRectangle,
20
+ )
21
+ from ... import name_converter
22
+
23
+
24
+ def stb_sec_parapet_rc_to_shapes(
25
+ stb_sec_parapet_rc: StbSecParapetRc, reporter: Reporter
26
+ ) -> list[ShapePair]:
27
+ figure: StbSecFigureParapetRc | None = (
28
+ stb_sec_parapet_rc.stb_sec_figure_parapet_rc_or_none
29
+ )
30
+ if figure is None:
31
+ reporter.warning(
32
+ "StbSecFigureParapet_RCが設定されていません。",
33
+ code=Code.SCHEMA_ERROR,
34
+ phase=Phase.CONVERT_IFC,
35
+ stb_element=stb_sec_parapet_rc,
36
+ )
37
+ return SHAPE_PAIRS_UNKNOWN
38
+ type_i: StbSecParapetRcTypeI | None = figure.stb_sec_parapet_rc_type_i_or_none
39
+ if type_i is not None:
40
+ shape: Shape = ShapeRectangle(
41
+ name=name_converter.stb_element_to_ifc_name(stb_sec_parapet_rc),
42
+ width_x=type_i.t_t_or_none or 0.0,
43
+ width_y=type_i.depth_h_or_none or 0.0,
44
+ )
45
+ return [ShapePair(shape)]
46
+ else:
47
+ reporter.warning(
48
+ "パラペットはI型以外の変換は対応していません",
49
+ code=Code.SCHEMA_ERROR,
50
+ phase=Phase.CONVERT_IFC,
51
+ stb_element=stb_sec_parapet_rc,
52
+ )
53
+ return SHAPE_PAIRS_UNKNOWN
@@ -0,0 +1,106 @@
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.stb_latest import (
11
+ StbSecFigurePileRcConventional,
12
+ StbSecPileRc,
13
+ StbSecPileRcConventionalExtendedFoot,
14
+ StbSecPileRcConventionalExtendedTop,
15
+ StbSecPileRcConventionalExtendedTopFoot,
16
+ StbSecPileRcConventionalStraight,
17
+ )
18
+
19
+ from ....._internal.data_model.shape_data import (
20
+ SHAPE_PAIRS_UNKNOWN,
21
+ ShapeCircle,
22
+ ShapePair,
23
+ )
24
+ from ... import name_converter
25
+
26
+
27
+ def stb_sec_pile_rc_to_shapes(
28
+ stb_sec_pile_rc: StbSecPileRc, reporter: Reporter
29
+ ) -> list[ShapePair]:
30
+ try:
31
+ conventional: StbSecFigurePileRcConventional | None = (
32
+ stb_sec_pile_rc.stb_sec_pile_rc_conventional.stb_sec_figure_pile_rc_conventional
33
+ )
34
+ except NoneAccessError:
35
+ conventional = None
36
+ name: str = name_converter.stb_element_to_ifc_name(stb_sec_pile_rc)
37
+ if conventional is not None:
38
+ straight: StbSecPileRcConventionalStraight | None = (
39
+ conventional.stb_sec_pile_rc_conventional_straight_or_none
40
+ )
41
+ if straight is not None:
42
+ circle: ShapeCircle = ShapeCircle(name=stb_sec_pile_rc.name, d=straight.d)
43
+ return [ShapePair(circle)]
44
+ # ここから拡底、拡頭系の処理
45
+ result: list[ShapePair] = []
46
+ extend_foot: (
47
+ StbSecPileRcConventionalExtendedFoot
48
+ | StbSecPileRcConventionalExtendedTopFoot
49
+ | None
50
+ ) = (
51
+ conventional.stb_sec_pile_rc_conventional_extended_foot_or_none
52
+ or conventional.stb_sec_pile_rc_conventional_extended_top_foot_or_none
53
+ )
54
+
55
+ if extend_foot is not None:
56
+ d_foot: float = extend_foot.d_extended_foot_or_none or 0.0
57
+ d_axial: float = extend_foot.d_axial_or_none or 0.0
58
+ length_extend_foot: float = extend_foot.length_extended_foot_or_none or 0.0
59
+ angle_extend_foot_taper: float = (
60
+ extend_foot.angle_extended_foot_taper_or_none or 0.0
61
+ )
62
+ if length_extend_foot > 0.0:
63
+ result.append(ShapePair(ShapeCircle(name=name, d=d_foot)))
64
+ if 0.0 < angle_extend_foot_taper < 90.0 and length_extend_foot > 0.0:
65
+ result.append(
66
+ ShapePair(
67
+ ShapeCircle(name=name, d=d_foot),
68
+ ShapeCircle(name=name, d=d_axial),
69
+ )
70
+ )
71
+ result.append(ShapePair(ShapeCircle(name=name, d=d_axial)))
72
+ extend_top: (
73
+ StbSecPileRcConventionalExtendedTop
74
+ | StbSecPileRcConventionalExtendedTopFoot
75
+ | None
76
+ ) = (
77
+ conventional.stb_sec_pile_rc_conventional_extended_top_or_none
78
+ or conventional.stb_sec_pile_rc_conventional_extended_top_foot_or_none
79
+ )
80
+
81
+ if extend_top is not None:
82
+ d_top: float = extend_top.d_extended_top_or_none or 0.0
83
+ d_axial = extend_top.d_axial_or_none or 0.0
84
+ angle_extend_top_taper: float = (
85
+ extend_top.angle_extended_top_taper_or_none or 0.0
86
+ )
87
+ if not isinstance(extend_top, StbSecPileRcConventionalExtendedTopFoot):
88
+ result.append(ShapePair(ShapeCircle(name=name, d=d_axial)))
89
+ if 0.0 < angle_extend_top_taper < 90.0:
90
+ result.append(
91
+ ShapePair(
92
+ ShapeCircle(name=name, d=d_axial),
93
+ ShapeCircle(name=name, d=d_top),
94
+ )
95
+ )
96
+ result.append(ShapePair(ShapeCircle(name=name, d=d_top)))
97
+ return result
98
+ # 拡底、拡頭系の処理ここまで
99
+
100
+ reporter.warning(
101
+ "変換できない杭断面です",
102
+ code=Code.SCHEMA_ERROR,
103
+ phase=Phase.CONVERT_IFC,
104
+ stb_element=stb_sec_pile_rc,
105
+ )
106
+ return SHAPE_PAIRS_UNKNOWN
@@ -0,0 +1,100 @@
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
+
9
+ from stbkit.api.stb_latest import (
10
+ StbSecFigurePileS,
11
+ StbSecPileS,
12
+ StbSecPileSRotational,
13
+ StbSecPileSStraight,
14
+ StbSecPileSTaper,
15
+ )
16
+
17
+ from ....._internal.data_model.shape_data import (
18
+ SHAPE_PAIRS_UNKNOWN,
19
+ ShapePair,
20
+ ShapePipe,
21
+ )
22
+ from ... import name_converter
23
+
24
+
25
+ def stb_sec_pile_s_to_shapes_and_length(
26
+ stb_sec_pile_s: StbSecPileS,
27
+ ) -> tuple[list[ShapePair], list[float]]:
28
+ try:
29
+ conventional: StbSecFigurePileS | None = (
30
+ stb_sec_pile_s.stb_sec_pile_s_conventional.stb_sec_figure_pile_s
31
+ )
32
+ except NoneAccessError:
33
+ conventional = None
34
+ name: str = name_converter.stb_element_to_ifc_name(stb_sec_pile_s)
35
+ if conventional is not None:
36
+ piles: list[StbSecPileSStraight | StbSecPileSRotational | StbSecPileSTaper] = []
37
+ piles.extend(conventional.stb_sec_pile_s_straight)
38
+ piles.extend(conventional.stb_sec_pile_s_rotational)
39
+ piles.extend(conventional.stb_sec_pile_s_taper)
40
+ piles.sort(key=lambda p: -p.id_order)
41
+ shapes: list[ShapePair] = []
42
+ lengths: list[float] = []
43
+ for i, pile in enumerate(piles):
44
+ match pile:
45
+ case StbSecPileSStraight() as straight:
46
+ shapes.append(
47
+ ShapePair(
48
+ ShapePipe(
49
+ name=f"{name}_{i}",
50
+ d=straight.d_or_none or 0.0,
51
+ t=straight.t_or_none or 0.0,
52
+ )
53
+ )
54
+ )
55
+ lengths.append(straight.length_pile_or_none or 0.0)
56
+ case StbSecPileSRotational() as rotational:
57
+ shapes.append(
58
+ ShapePair(
59
+ ShapePipe(
60
+ name=f"{name}_{i}",
61
+ d=rotational.d2_or_none or 0.0,
62
+ t=(rotational.d2_or_none or 0.0) / 2.0,
63
+ )
64
+ )
65
+ )
66
+ lengths.append(rotational.t_or_none or 0.0)
67
+ shapes.append(
68
+ ShapePair(
69
+ ShapePipe(
70
+ name=f"{name}_{i}",
71
+ d=rotational.d1_or_none or 0.0,
72
+ t=rotational.t_or_none or 0.0,
73
+ )
74
+ )
75
+ )
76
+ lengths.append(
77
+ (rotational.length_pile_or_none or 0.0)
78
+ - (rotational.t_or_none or 0.0)
79
+ )
80
+ case StbSecPileSTaper() as taper:
81
+ shapes.append(
82
+ ShapePair(
83
+ ShapePipe(
84
+ name=f"{name}_{i}",
85
+ d=taper.d2_or_none or 0.0,
86
+ t=taper.t_or_none or 0.0,
87
+ ),
88
+ ShapePipe(
89
+ name=f"{name}_{i}",
90
+ d=taper.d1_or_none or 0.0,
91
+ t=taper.t_or_none or 0.0,
92
+ ),
93
+ )
94
+ )
95
+ lengths.append(taper.length_pile_or_none or 0.0)
96
+ case _:
97
+ raise AssertionError("想定外の杭断面です")
98
+ return shapes, lengths
99
+
100
+ return SHAPE_PAIRS_UNKNOWN, [0.0]