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.
- stbkit/__main__.py +10 -0
- stbkit/api/__init__.py +48 -0
- stbkit/api/experimental/__init__.py +19 -0
- stbkit/api/experimental/repository/__init__.py +30 -0
- stbkit/api/py.typed +0 -0
- stbkit/api/stb_latest.py +7 -0
- stbkit/api/stb_v2_0_2.py +11 -0
- stbkit/api/stb_v2_1_1.py +9 -0
- stbkit/cli/__init__.py +17 -0
- stbkit/cli/_internal/cli_main.py +114 -0
- stbkit/cli/_internal/common.py +126 -0
- stbkit/cli/_internal/constants_exit_code.py +59 -0
- stbkit/cli/_internal/converter.py +693 -0
- stbkit/cli/_internal/diff.py +213 -0
- stbkit/cli/_internal/entry_points.py +25 -0
- stbkit/cli/_internal/global_parent.py +70 -0
- stbkit/cli/_internal/show_versions.py +36 -0
- stbkit/cli/_internal/validate.py +310 -0
- stbkit/cli/commands/convert.py +16 -0
- stbkit/cli/commands/diff.py +16 -0
- stbkit/cli/commands/validate.py +16 -0
- stbkit/cli/py.typed +0 -0
- stbkit/tools/__init__.py +12 -0
- stbkit/tools/_internal/__init__.py +5 -0
- stbkit/tools/_internal/constants.py +21 -0
- stbkit/tools/_internal/data_model/building_geometry.py +1208 -0
- stbkit/tools/_internal/data_model/building_geometry_web.py +106 -0
- stbkit/tools/_internal/data_model/element_data.py +93 -0
- stbkit/tools/_internal/data_model/ifc_data/entity_data.py +67 -0
- stbkit/tools/_internal/data_model/ifc_data/entity_names.py +32 -0
- stbkit/tools/_internal/data_model/shape_data.py +1089 -0
- stbkit/tools/_internal/diff/__init__.py +5 -0
- stbkit/tools/_internal/diff/common.py +50 -0
- stbkit/tools/_internal/diff/diff_xml.py +796 -0
- stbkit/tools/_internal/matrix.py +51 -0
- stbkit/tools/_internal/optional_dependencies/__init__.py +5 -0
- stbkit/tools/_internal/optional_dependencies/ifc_common.py +28 -0
- stbkit/tools/_internal/optional_dependencies/ifc_exporter/ifc_entity_exporter.py +473 -0
- stbkit/tools/_internal/optional_dependencies/ifc_exporter/ifc_profile_exporter.py +267 -0
- stbkit/tools/_internal/optional_dependencies/ifc_exporter/ifc_representation_exporter.py +178 -0
- stbkit/tools/_internal/optional_dependencies/ifc_pipeline.py +133 -0
- stbkit/tools/_internal/optional_dependencies/ifc_to_building_geometry.py +64 -0
- stbkit/tools/_internal/stb_io.py +116 -0
- stbkit/tools/_internal/stb_repair/_common.py +24 -0
- stbkit/tools/_internal/stb_repair/_stb_repair.py +197 -0
- stbkit/tools/_internal/stb_repair/_stb_v2_0_2_repair.py +53 -0
- stbkit/tools/_internal/stb_repair/_stb_v2_1_0_repair.py +109 -0
- stbkit/tools/_internal/stb_repair/_stb_v2_1_1_repair.py +109 -0
- stbkit/tools/_internal/studio_report.py +49 -0
- stbkit/tools/_internal/utils/atomic_writer.py +57 -0
- stbkit/tools/_internal/utils/float_rounding.py +49 -0
- stbkit/tools/_internal/utils/girder_utils.py +91 -0
- stbkit/tools/_internal/utils/guid_utils.py +30 -0
- stbkit/tools/_internal/utils/mesh_utils.py +1305 -0
- stbkit/tools/_internal/utils/node_utils.py +50 -0
- stbkit/tools/_internal/utils/unit_utils.py +23 -0
- stbkit/tools/_internal/vectors.py +222 -0
- stbkit/tools/converters/__init__.py +39 -0
- stbkit/tools/converters/_internal/__init__.py +5 -0
- stbkit/tools/converters/_internal/building_geometry_to_ply_text.py +32 -0
- stbkit/tools/converters/_internal/coord_converter.py +151 -0
- stbkit/tools/converters/_internal/element_data_to_building_geometry.py +549 -0
- stbkit/tools/converters/_internal/ifc_to_ply_text.py +21 -0
- stbkit/tools/converters/_internal/name_converter.py +23 -0
- stbkit/tools/converters/_internal/pipeline/__init__.py +5 -0
- stbkit/tools/converters/_internal/pipeline/data.py +188 -0
- stbkit/tools/converters/_internal/pipeline/execution.py +569 -0
- stbkit/tools/converters/_internal/pipeline/ply_pipeline.py +52 -0
- stbkit/tools/converters/_internal/pipeline/stb_pipeline.py +226 -0
- stbkit/tools/converters/_internal/pipeline/stb_pipeline_latest.py +39 -0
- stbkit/tools/converters/_internal/pipeline/step.py +139 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/__init__.py +17 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/_stb_latest_to_element_data.py +186 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/member/member_footing.py +49 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/member/member_line.py +533 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/member/member_pile.py +100 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/member/member_plane.py +103 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/open.py +70 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec.py +214 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_beam_rc.py +67 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_beam_s.py +97 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_beam_src.py +28 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_brace_s.py +49 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_column_cft.py +217 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_column_rc.py +41 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_column_s.py +127 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_column_src.py +173 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_foundation.py +225 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_parapet_rc.py +53 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_pile_rc.py +106 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_pile_s.py +100 -0
- stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_steel.py +432 -0
- stbkit/tools/converters/_internal/stb_to_building_geometry.py +44 -0
- stbkit/tools/converters/_internal/stb_to_ifc_data/__init__.py +5 -0
- stbkit/tools/converters/_internal/stb_to_ifc_data/_stb_to_ifc_data.py +59 -0
- stbkit/tools/converters/_internal/stb_to_ifc_data/convert_option.py +22 -0
- stbkit/tools/converters/_internal/stb_to_ply_text.py +22 -0
- stbkit/tools/py.typed +0 -0
- stbkit/tools/upgrade/__init__.py +13 -0
- stbkit/tools/upgrade/_internal/__init__.py +5 -0
- stbkit/tools/upgrade/_internal/common.py +205 -0
- stbkit/tools/upgrade/_internal/upgrade.py +228 -0
- stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/__init__.py +60 -0
- stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_common.py +62 -0
- stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_joint_beam_shape_h.py +44 -0
- stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_sec_pile_rc.py +101 -0
- stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_sec_pile_s.py +78 -0
- stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_sec_slab_deck.py +56 -0
- stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_sec_slab_rc.py +128 -0
- stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/post_girder.py +126 -0
- stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/post_open.py +110 -0
- stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/post_sec_beam_rc.py +227 -0
- stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/post_sec_beam_s.py +1153 -0
- stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hooks.py +22 -0
- stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/post.py +42 -0
- stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/tables.py +99 -0
- stbkit/tools/upgrade/_internal/v2_1_0_to_v2_1_1/__init__.py +58 -0
- stbkit/tools/upgrade/_internal/v2_1_0_to_v2_1_1/hooks.py +32 -0
- stbkit/tools/upgrade/_internal/v2_1_0_to_v2_1_1/tables.py +56 -0
- stbkit-0.1.0a9.dev1.dist-info/METADATA +196 -0
- stbkit-0.1.0a9.dev1.dist-info/RECORD +125 -0
- stbkit-0.1.0a9.dev1.dist-info/WHEEL +5 -0
- stbkit-0.1.0a9.dev1.dist-info/entry_points.txt +2 -0
- stbkit-0.1.0a9.dev1.dist-info/licenses/LICENSE +373 -0
- stbkit-0.1.0a9.dev1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,432 @@
|
|
|
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.data_model.common import StBridgeElement
|
|
8
|
+
from stbkit.core.stb_exceptions import ReferenceElementNotFoundError, StbError
|
|
9
|
+
from stbkit.core.stb_reporting import Code, Phase, Reporter
|
|
10
|
+
|
|
11
|
+
from stbkit.api.experimental.repository import RepositoryLatest
|
|
12
|
+
from stbkit.api.stb_latest import (
|
|
13
|
+
StbSecBuildBox,
|
|
14
|
+
StbSecBuildH,
|
|
15
|
+
StbSecBuildT,
|
|
16
|
+
StbSecFlatBar,
|
|
17
|
+
StbSecLipC,
|
|
18
|
+
StbSecPipe,
|
|
19
|
+
StbSecRollBox,
|
|
20
|
+
StbSecRollC,
|
|
21
|
+
StbSecRollH,
|
|
22
|
+
StbSecRollL,
|
|
23
|
+
StbSecRollT,
|
|
24
|
+
StbSecRoundBar,
|
|
25
|
+
StbSecSteelColumnSrcNotSame,
|
|
26
|
+
StbSecSteelColumnSrcSame,
|
|
27
|
+
StbSecSteelColumnSrcShapeBox,
|
|
28
|
+
StbSecSteelColumnSrcShapeCross1,
|
|
29
|
+
StbSecSteelColumnSrcShapeH,
|
|
30
|
+
StbSecSteelColumnSrcShapePipe,
|
|
31
|
+
StbSecSteelColumnSrcShapeT,
|
|
32
|
+
StbSecSteelColumnSrcThreeTypes,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
from ....._internal.data_model.shape_data import (
|
|
36
|
+
SHAPE_PAIR_UNKNOWN,
|
|
37
|
+
Shape,
|
|
38
|
+
ShapeAngle,
|
|
39
|
+
ShapeBox,
|
|
40
|
+
ShapeBuildBox,
|
|
41
|
+
ShapeChannel,
|
|
42
|
+
ShapeCircle,
|
|
43
|
+
ShapeCrossH,
|
|
44
|
+
ShapeH,
|
|
45
|
+
ShapeLipC,
|
|
46
|
+
ShapePair,
|
|
47
|
+
ShapePipe,
|
|
48
|
+
ShapeRectangle,
|
|
49
|
+
ShapeT,
|
|
50
|
+
ShapeTSrc,
|
|
51
|
+
)
|
|
52
|
+
from ....._internal.vectors import Vector2d
|
|
53
|
+
from ... import name_converter
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def stb_sec_steel_column_src_shape_to_shape_pair(
|
|
57
|
+
repo: RepositoryLatest,
|
|
58
|
+
sec_steel_column_src: StbSecSteelColumnSrcSame
|
|
59
|
+
| StbSecSteelColumnSrcNotSame
|
|
60
|
+
| StbSecSteelColumnSrcThreeTypes,
|
|
61
|
+
reporter: Reporter,
|
|
62
|
+
) -> ShapePair:
|
|
63
|
+
try:
|
|
64
|
+
if sec_steel_column_src.stb_sec_steel_column_src_shape_h_or_none:
|
|
65
|
+
return ShapePair(
|
|
66
|
+
stb_sec_steel_column_src_shape_h_to_shape(
|
|
67
|
+
repo,
|
|
68
|
+
sec_steel_column_src.stb_sec_steel_column_src_shape_h,
|
|
69
|
+
)
|
|
70
|
+
)
|
|
71
|
+
elif sec_steel_column_src.stb_sec_steel_column_src_shape_box_or_none:
|
|
72
|
+
return ShapePair(
|
|
73
|
+
stb_sec_steel_column_src_shape_box_to_shape(
|
|
74
|
+
repo,
|
|
75
|
+
sec_steel_column_src.stb_sec_steel_column_src_shape_box,
|
|
76
|
+
)
|
|
77
|
+
)
|
|
78
|
+
elif sec_steel_column_src.stb_sec_steel_column_src_shape_pipe_or_none:
|
|
79
|
+
return ShapePair(
|
|
80
|
+
stb_sec_steel_column_src_shape_pipe_to_shape(
|
|
81
|
+
repo,
|
|
82
|
+
sec_steel_column_src.stb_sec_steel_column_src_shape_pipe,
|
|
83
|
+
)
|
|
84
|
+
)
|
|
85
|
+
elif sec_steel_column_src.stb_sec_steel_column_src_shape_cross1_or_none:
|
|
86
|
+
return ShapePair(
|
|
87
|
+
stb_sec_steel_column_src_shape_cross1_to_shape(
|
|
88
|
+
repo,
|
|
89
|
+
sec_steel_column_src.stb_sec_steel_column_src_shape_cross1,
|
|
90
|
+
)
|
|
91
|
+
)
|
|
92
|
+
elif sec_steel_column_src.stb_sec_steel_column_src_shape_t_or_none:
|
|
93
|
+
return ShapePair(
|
|
94
|
+
stb_sec_steel_column_src_shape_t_to_shape(
|
|
95
|
+
repo,
|
|
96
|
+
sec_steel_column_src.stb_sec_steel_column_src_shape_t,
|
|
97
|
+
)
|
|
98
|
+
)
|
|
99
|
+
else:
|
|
100
|
+
reporter.warning(
|
|
101
|
+
message="非対応の断面です",
|
|
102
|
+
code=Code.MISSING_ATTRIBUTE,
|
|
103
|
+
phase=Phase.CONVERT_IFC,
|
|
104
|
+
stb_element=sec_steel_column_src,
|
|
105
|
+
)
|
|
106
|
+
return SHAPE_PAIR_UNKNOWN
|
|
107
|
+
except ReferenceElementNotFoundError as e:
|
|
108
|
+
reporter.warning(
|
|
109
|
+
message=str(e),
|
|
110
|
+
code=Code.REFERENCE_NOT_FOUND,
|
|
111
|
+
phase=Phase.CONVERT_IFC,
|
|
112
|
+
stb_element=sec_steel_column_src,
|
|
113
|
+
)
|
|
114
|
+
return SHAPE_PAIR_UNKNOWN
|
|
115
|
+
except (StbError, RuntimeError, AssertionError, TypeError):
|
|
116
|
+
reporter.error(
|
|
117
|
+
message="断面の変換中にエラーが発生しました",
|
|
118
|
+
code=Code.UNEXPECTED_ERROR,
|
|
119
|
+
phase=Phase.CONVERT_IFC,
|
|
120
|
+
stb_element=sec_steel_column_src,
|
|
121
|
+
)
|
|
122
|
+
return SHAPE_PAIR_UNKNOWN
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def stb_sec_steel_column_src_shape_h_to_shape(
|
|
126
|
+
repo: RepositoryLatest,
|
|
127
|
+
stb_sec_steel_column_src_shape_h: StbSecSteelColumnSrcShapeH,
|
|
128
|
+
) -> ShapeH:
|
|
129
|
+
stb_sec_h: StBridgeElement = repo.get_steel(stb_sec_steel_column_src_shape_h.shape)
|
|
130
|
+
match stb_sec_h:
|
|
131
|
+
case StbSecRollH() as roll_h:
|
|
132
|
+
result: ShapeH = stb_sec_roll_h_to_shape(roll_h)
|
|
133
|
+
case StbSecBuildH() as build_h:
|
|
134
|
+
result = stb_sec_build_h_to_shape(build_h)
|
|
135
|
+
case _:
|
|
136
|
+
raise ReferenceElementNotFoundError(
|
|
137
|
+
f"{stb_sec_steel_column_src_shape_h.shape}はH形鋼ではありません",
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
result.offset = Vector2d(
|
|
141
|
+
stb_sec_steel_column_src_shape_h.offset_x_or_none or 0.0,
|
|
142
|
+
stb_sec_steel_column_src_shape_h.offset_y_or_none or 0.0,
|
|
143
|
+
)
|
|
144
|
+
if stb_sec_steel_column_src_shape_h.direction_type == "H":
|
|
145
|
+
result.rotate_degree = 90.0
|
|
146
|
+
return result
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def stb_sec_steel_column_src_shape_box_to_shape(
|
|
150
|
+
repo: RepositoryLatest,
|
|
151
|
+
stb_sec_steel_column_src_shape_box: StbSecSteelColumnSrcShapeBox,
|
|
152
|
+
) -> ShapeBox | ShapeBuildBox:
|
|
153
|
+
stb_sec_box: StBridgeElement = repo.get_steel(
|
|
154
|
+
stb_sec_steel_column_src_shape_box.shape
|
|
155
|
+
)
|
|
156
|
+
match stb_sec_box:
|
|
157
|
+
case StbSecRollBox() as roll_box:
|
|
158
|
+
result: ShapeBox | ShapeBuildBox = stb_sec_roll_box_to_shape(roll_box)
|
|
159
|
+
case StbSecBuildBox() as build_box:
|
|
160
|
+
result = stb_sec_build_box_to_shape(build_box)
|
|
161
|
+
case _:
|
|
162
|
+
raise ReferenceElementNotFoundError(
|
|
163
|
+
f"{stb_sec_steel_column_src_shape_box.shape}は角形鋼管ではありません",
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
result.offset = Vector2d(
|
|
167
|
+
stb_sec_steel_column_src_shape_box.offset_x_or_none or 0.0,
|
|
168
|
+
stb_sec_steel_column_src_shape_box.offset_y_or_none or 0.0,
|
|
169
|
+
)
|
|
170
|
+
return result
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
def stb_sec_steel_column_src_shape_pipe_to_shape(
|
|
174
|
+
repo: RepositoryLatest,
|
|
175
|
+
stb_sec_steel_column_src_shape_pipe: StbSecSteelColumnSrcShapePipe,
|
|
176
|
+
) -> ShapePipe:
|
|
177
|
+
stb_sec_pipe: StBridgeElement = repo.get_steel(
|
|
178
|
+
stb_sec_steel_column_src_shape_pipe.shape
|
|
179
|
+
)
|
|
180
|
+
match stb_sec_pipe:
|
|
181
|
+
case StbSecPipe() as pipe:
|
|
182
|
+
result: ShapePipe = stb_sec_pipe_to_shape(pipe)
|
|
183
|
+
case _:
|
|
184
|
+
raise ReferenceElementNotFoundError(
|
|
185
|
+
f"{stb_sec_steel_column_src_shape_pipe.shape}は円形鋼管ではありません",
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
result.offset = Vector2d(
|
|
189
|
+
stb_sec_steel_column_src_shape_pipe.offset_x_or_none or 0.0,
|
|
190
|
+
stb_sec_steel_column_src_shape_pipe.offset_y_or_none or 0.0,
|
|
191
|
+
)
|
|
192
|
+
return result
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
def stb_sec_steel_column_src_shape_cross1_to_shape(
|
|
196
|
+
repo: RepositoryLatest,
|
|
197
|
+
stb_sec_steel_column_src_shape_cross1: StbSecSteelColumnSrcShapeCross1,
|
|
198
|
+
) -> ShapeCrossH:
|
|
199
|
+
stb_sec_h_x: StBridgeElement = repo.get_steel(
|
|
200
|
+
stb_sec_steel_column_src_shape_cross1.shape_x
|
|
201
|
+
)
|
|
202
|
+
stb_sec_h_y: StBridgeElement = repo.get_steel(
|
|
203
|
+
stb_sec_steel_column_src_shape_cross1.shape_y
|
|
204
|
+
)
|
|
205
|
+
if not isinstance(stb_sec_h_x, (StbSecRollH, StbSecBuildH)) or not isinstance(
|
|
206
|
+
stb_sec_h_y, (StbSecRollH, StbSecBuildH)
|
|
207
|
+
):
|
|
208
|
+
raise ReferenceElementNotFoundError(
|
|
209
|
+
f"{stb_sec_steel_column_src_shape_cross1.shape_x}または{stb_sec_steel_column_src_shape_cross1.shape_y}はH形鋼ではありません",
|
|
210
|
+
)
|
|
211
|
+
return ShapeCrossH(
|
|
212
|
+
name="",
|
|
213
|
+
h_h=stb_sec_h_x.a,
|
|
214
|
+
h_b=stb_sec_h_x.b,
|
|
215
|
+
h_tw=stb_sec_h_x.t1,
|
|
216
|
+
h_tf=stb_sec_h_x.t2,
|
|
217
|
+
i_h=stb_sec_h_y.a,
|
|
218
|
+
i_b=stb_sec_h_y.b,
|
|
219
|
+
i_tw=stb_sec_h_y.t1,
|
|
220
|
+
i_tf=stb_sec_h_y.t2,
|
|
221
|
+
h_offset_y=(stb_sec_steel_column_src_shape_cross1.offset_xy_or_none or 0.0)
|
|
222
|
+
- (stb_sec_steel_column_src_shape_cross1.offset_yy_or_none or 0.0),
|
|
223
|
+
i_offset_x=(stb_sec_steel_column_src_shape_cross1.offset_yx_or_none or 0.0)
|
|
224
|
+
- (stb_sec_steel_column_src_shape_cross1.offset_xx_or_none or 0.0),
|
|
225
|
+
offset=Vector2d(
|
|
226
|
+
stb_sec_steel_column_src_shape_cross1.offset_xx_or_none or 0.0,
|
|
227
|
+
stb_sec_steel_column_src_shape_cross1.offset_yy_or_none or 0.0,
|
|
228
|
+
),
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def stb_sec_steel_column_src_shape_t_to_shape(
|
|
233
|
+
repo: RepositoryLatest, stb_sec_steel_column_src_shape_t: StbSecSteelColumnSrcShapeT
|
|
234
|
+
) -> ShapeTSrc:
|
|
235
|
+
stb_sec_h: StBridgeElement = repo.get_steel(
|
|
236
|
+
stb_sec_steel_column_src_shape_t.shape_h
|
|
237
|
+
)
|
|
238
|
+
stb_sec_t: StBridgeElement = repo.get_steel(
|
|
239
|
+
stb_sec_steel_column_src_shape_t.shape_t
|
|
240
|
+
)
|
|
241
|
+
if not isinstance(stb_sec_h, (StbSecRollH, StbSecBuildH)):
|
|
242
|
+
raise ReferenceElementNotFoundError(
|
|
243
|
+
f"{stb_sec_steel_column_src_shape_t.shape_h}はH形鋼ではありません",
|
|
244
|
+
)
|
|
245
|
+
if not isinstance(stb_sec_t, (StbSecRollT, StbSecBuildT)):
|
|
246
|
+
raise ReferenceElementNotFoundError(
|
|
247
|
+
f"{stb_sec_steel_column_src_shape_t.shape_t}はT形鋼ではありません",
|
|
248
|
+
)
|
|
249
|
+
match stb_sec_steel_column_src_shape_t.direction_type_or_none:
|
|
250
|
+
case "T4":
|
|
251
|
+
rotate_degree = 90.0
|
|
252
|
+
case "T3":
|
|
253
|
+
rotate_degree = 180.0
|
|
254
|
+
case "T2":
|
|
255
|
+
rotate_degree = 270.0
|
|
256
|
+
case _:
|
|
257
|
+
rotate_degree = 0.0
|
|
258
|
+
name: str = name_converter.stb_element_to_ifc_name(stb_sec_steel_column_src_shape_t)
|
|
259
|
+
offset: Vector2d = Vector2d(
|
|
260
|
+
stb_sec_steel_column_src_shape_t.offset_hx_or_none or 0.0,
|
|
261
|
+
(stb_sec_steel_column_src_shape_t.offset_hy_or_none or 0.0)
|
|
262
|
+
- ((stb_sec_t.a + stb_sec_h.b / 2.0) / 2.0 - (stb_sec_h.b / 2.0)),
|
|
263
|
+
).rotate(rotate_degree)
|
|
264
|
+
return ShapeTSrc(
|
|
265
|
+
name=name,
|
|
266
|
+
h_h=stb_sec_h.a,
|
|
267
|
+
h_b=stb_sec_h.b,
|
|
268
|
+
h_tw=stb_sec_h.t1,
|
|
269
|
+
h_tf=stb_sec_h.t2,
|
|
270
|
+
t_h=stb_sec_t.a,
|
|
271
|
+
t_b=stb_sec_t.b,
|
|
272
|
+
t_tw=stb_sec_t.t1,
|
|
273
|
+
t_tf=stb_sec_t.t2,
|
|
274
|
+
offset=offset,
|
|
275
|
+
t_offset_x=(stb_sec_steel_column_src_shape_t.offset_t_or_none or 0.0)
|
|
276
|
+
- (stb_sec_steel_column_src_shape_t.offset_hx_or_none or 0.0),
|
|
277
|
+
rotate_degree=rotate_degree,
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
def stb_sec_roll_h_to_shape(
|
|
282
|
+
stb_sec_roll_h: StbSecRollH,
|
|
283
|
+
) -> ShapeH:
|
|
284
|
+
return ShapeH(
|
|
285
|
+
name=stb_sec_roll_h.name,
|
|
286
|
+
a=stb_sec_roll_h.a,
|
|
287
|
+
b=stb_sec_roll_h.b,
|
|
288
|
+
t1=stb_sec_roll_h.t1,
|
|
289
|
+
t2=stb_sec_roll_h.t2,
|
|
290
|
+
r=stb_sec_roll_h.r,
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
def stb_sec_build_h_to_shape(
|
|
295
|
+
stb_sec_build_h: StbSecBuildH,
|
|
296
|
+
) -> ShapeH:
|
|
297
|
+
return ShapeH(
|
|
298
|
+
name=stb_sec_build_h.name,
|
|
299
|
+
a=stb_sec_build_h.a,
|
|
300
|
+
b=stb_sec_build_h.b,
|
|
301
|
+
t1=stb_sec_build_h.t1,
|
|
302
|
+
t2=stb_sec_build_h.t2,
|
|
303
|
+
r=0.0,
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
def stb_sec_roll_box_to_shape(
|
|
308
|
+
stb_sec_roll_box: StbSecRollBox,
|
|
309
|
+
) -> ShapeBox:
|
|
310
|
+
return ShapeBox(
|
|
311
|
+
name=stb_sec_roll_box.name,
|
|
312
|
+
a=stb_sec_roll_box.a,
|
|
313
|
+
b=stb_sec_roll_box.b,
|
|
314
|
+
t=stb_sec_roll_box.t,
|
|
315
|
+
r=stb_sec_roll_box.r,
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
def stb_sec_build_box_to_shape(
|
|
320
|
+
stb_sec_build_box: StbSecBuildBox,
|
|
321
|
+
) -> ShapeBuildBox:
|
|
322
|
+
return ShapeBuildBox(
|
|
323
|
+
name=stb_sec_build_box.name,
|
|
324
|
+
a=stb_sec_build_box.a,
|
|
325
|
+
b=stb_sec_build_box.b,
|
|
326
|
+
t1=stb_sec_build_box.t1,
|
|
327
|
+
t2=stb_sec_build_box.t2,
|
|
328
|
+
)
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
def stb_sec_pipe_to_shape(stb_sec_pipe: StbSecPipe) -> ShapePipe:
|
|
332
|
+
return ShapePipe(name=stb_sec_pipe.name, d=stb_sec_pipe.d, t=stb_sec_pipe.t)
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
def stb_sec_roll_t_to_shape(
|
|
336
|
+
stb_sec_roll_t: StbSecRollT,
|
|
337
|
+
) -> ShapeT:
|
|
338
|
+
return ShapeT(
|
|
339
|
+
name=stb_sec_roll_t.name,
|
|
340
|
+
a=stb_sec_roll_t.a,
|
|
341
|
+
b=stb_sec_roll_t.b,
|
|
342
|
+
t1=stb_sec_roll_t.t1,
|
|
343
|
+
t2=stb_sec_roll_t.t2,
|
|
344
|
+
r=stb_sec_roll_t.r,
|
|
345
|
+
)
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
def stb_sec_roll_c_to_shape(stb_sec_roll_c: StbSecRollC) -> ShapeChannel:
|
|
349
|
+
return ShapeChannel(
|
|
350
|
+
name=stb_sec_roll_c.name,
|
|
351
|
+
a=stb_sec_roll_c.a,
|
|
352
|
+
b=stb_sec_roll_c.b,
|
|
353
|
+
t1=stb_sec_roll_c.t1,
|
|
354
|
+
t2=stb_sec_roll_c.t2,
|
|
355
|
+
r1=stb_sec_roll_c.r1_or_none or 0.0,
|
|
356
|
+
r2=stb_sec_roll_c.r2_or_none or 0.0,
|
|
357
|
+
)
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
def stb_sec_roll_l_to_shape(stb_sec_roll_l: StbSecRollL) -> ShapeAngle:
|
|
361
|
+
return ShapeAngle(
|
|
362
|
+
name=stb_sec_roll_l.name,
|
|
363
|
+
a=stb_sec_roll_l.a,
|
|
364
|
+
b=stb_sec_roll_l.b,
|
|
365
|
+
t1=stb_sec_roll_l.t1,
|
|
366
|
+
t2=stb_sec_roll_l.t2,
|
|
367
|
+
r1=stb_sec_roll_l.r1_or_none or 0.0,
|
|
368
|
+
r2=stb_sec_roll_l.r2_or_none or 0.0,
|
|
369
|
+
)
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
def stb_sec_lip_c_to_shape(stb_sec_lip_c: StbSecLipC) -> ShapeLipC:
|
|
373
|
+
return ShapeLipC(
|
|
374
|
+
name=stb_sec_lip_c.name,
|
|
375
|
+
h=stb_sec_lip_c.h,
|
|
376
|
+
a=stb_sec_lip_c.a,
|
|
377
|
+
c=stb_sec_lip_c.c,
|
|
378
|
+
t=stb_sec_lip_c.t,
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
def stb_sec_flat_bar_to_shape(stb_sec_float_bar: StbSecFlatBar) -> ShapeRectangle:
|
|
383
|
+
return ShapeRectangle(
|
|
384
|
+
name=stb_sec_float_bar.name,
|
|
385
|
+
width_x=stb_sec_float_bar.t,
|
|
386
|
+
width_y=stb_sec_float_bar.b,
|
|
387
|
+
)
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
def stb_sec_round_bar_to_shape(stb_sec_round_bar: StbSecRoundBar) -> ShapeCircle:
|
|
391
|
+
return ShapeCircle(
|
|
392
|
+
name=stb_sec_round_bar.name,
|
|
393
|
+
d=stb_sec_round_bar.r,
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
def stb_sec_steel_name_to_shape(
|
|
398
|
+
repo: RepositoryLatest, name: str, reporter: Reporter
|
|
399
|
+
) -> Shape:
|
|
400
|
+
stb_sec = repo.get_steel(name)
|
|
401
|
+
match stb_sec:
|
|
402
|
+
case StbSecRollH():
|
|
403
|
+
return stb_sec_roll_h_to_shape(stb_sec)
|
|
404
|
+
case StbSecBuildH():
|
|
405
|
+
return stb_sec_build_h_to_shape(stb_sec)
|
|
406
|
+
case StbSecRollBox():
|
|
407
|
+
return stb_sec_roll_box_to_shape(stb_sec)
|
|
408
|
+
case StbSecBuildBox():
|
|
409
|
+
return stb_sec_build_box_to_shape(stb_sec)
|
|
410
|
+
case StbSecPipe():
|
|
411
|
+
return stb_sec_pipe_to_shape(stb_sec)
|
|
412
|
+
case StbSecRollT():
|
|
413
|
+
return stb_sec_roll_t_to_shape(stb_sec)
|
|
414
|
+
case StbSecRollC():
|
|
415
|
+
return stb_sec_roll_c_to_shape(stb_sec)
|
|
416
|
+
case StbSecRollL():
|
|
417
|
+
return stb_sec_roll_l_to_shape(stb_sec)
|
|
418
|
+
case StbSecLipC():
|
|
419
|
+
return stb_sec_lip_c_to_shape(stb_sec)
|
|
420
|
+
case StbSecFlatBar():
|
|
421
|
+
return stb_sec_flat_bar_to_shape(stb_sec)
|
|
422
|
+
case StbSecRoundBar():
|
|
423
|
+
return stb_sec_round_bar_to_shape(stb_sec)
|
|
424
|
+
case _:
|
|
425
|
+
pass
|
|
426
|
+
|
|
427
|
+
reporter.warning(
|
|
428
|
+
message=f"{name}という鉄骨形状が見つかりません",
|
|
429
|
+
code=Code.REFERENCE_NOT_FOUND,
|
|
430
|
+
phase=Phase.CONVERT_IFC,
|
|
431
|
+
)
|
|
432
|
+
return ShapeRectangle(name="UNKNOWN", width_x=10.0, width_y=10.0)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Copyright 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 Reporter
|
|
9
|
+
|
|
10
|
+
from stbkit.api.stb_latest import StBridge
|
|
11
|
+
from stbkit.tools._internal.data_model.building_geometry import BuildingGeometry
|
|
12
|
+
from stbkit.tools._internal.data_model.element_data import (
|
|
13
|
+
ElementData,
|
|
14
|
+
Node,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
from .element_data_to_building_geometry import element_data_to_building_geometry
|
|
18
|
+
from .stb_latest_to_element_data import (
|
|
19
|
+
node_infos_from_stb_nodes,
|
|
20
|
+
stb_to_element_data,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def stb_to_building_geometry(
|
|
25
|
+
stb: StBridge,
|
|
26
|
+
*,
|
|
27
|
+
reporter: Reporter,
|
|
28
|
+
) -> BuildingGeometry:
|
|
29
|
+
elements: ElementData = stb_to_element_data(
|
|
30
|
+
stb,
|
|
31
|
+
reporter=reporter,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
node_datas: dict[int, Node] | None = None
|
|
35
|
+
try:
|
|
36
|
+
node_datas = node_infos_from_stb_nodes(stb.stb_model.stb_nodes)
|
|
37
|
+
except NoneAccessError:
|
|
38
|
+
pass
|
|
39
|
+
return element_data_to_building_geometry(
|
|
40
|
+
elements,
|
|
41
|
+
allow_polygons=False,
|
|
42
|
+
reporter=reporter,
|
|
43
|
+
node_infos=node_datas,
|
|
44
|
+
)
|
|
@@ -0,0 +1,5 @@
|
|
|
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/.
|
|
@@ -0,0 +1,59 @@
|
|
|
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 import stb_latest
|
|
10
|
+
|
|
11
|
+
from ...._internal.data_model.ifc_data.entity_data import (
|
|
12
|
+
IfcBuilding,
|
|
13
|
+
IfcBuildingStorey,
|
|
14
|
+
IfcModel,
|
|
15
|
+
IfcProject,
|
|
16
|
+
IfcSite,
|
|
17
|
+
)
|
|
18
|
+
from ..stb_latest_to_element_data import stb_to_element_data
|
|
19
|
+
from .convert_option import ConvertOptionStbToIfc
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def stb_to_ifc_data(
|
|
23
|
+
stb: stb_latest.StBridge,
|
|
24
|
+
*,
|
|
25
|
+
option: ConvertOptionStbToIfc | None = None,
|
|
26
|
+
reporter: Reporter,
|
|
27
|
+
) -> IfcModel:
|
|
28
|
+
"""現在Storeyを1つしか作っていない。
|
|
29
|
+
階を定義していないST-Bridgeもあるため暫定処置。
|
|
30
|
+
TODO:ST-Bridgeの階情報に応じてIFCの階を設定する
|
|
31
|
+
"""
|
|
32
|
+
reporter.info(
|
|
33
|
+
"---ST-Bridge->IFCジオメトリデータ変換処理開始---",
|
|
34
|
+
code=Code.PROGRESS_INFO,
|
|
35
|
+
phase=Phase.CONVERT_IFC,
|
|
36
|
+
)
|
|
37
|
+
option = option or ConvertOptionStbToIfc()
|
|
38
|
+
|
|
39
|
+
elements = stb_to_element_data(stb, reporter=reporter)
|
|
40
|
+
|
|
41
|
+
building_storey: IfcBuildingStorey = IfcBuildingStorey(
|
|
42
|
+
name="1FL", elements=elements
|
|
43
|
+
)
|
|
44
|
+
building: IfcBuilding = IfcBuilding(
|
|
45
|
+
name="Building", building_storeys=[building_storey]
|
|
46
|
+
)
|
|
47
|
+
site: IfcSite = IfcSite(name="Site", building=building)
|
|
48
|
+
if stb.stb_common_or_none and stb.stb_common.project_name:
|
|
49
|
+
project_name: str = stb.stb_common.project_name
|
|
50
|
+
else:
|
|
51
|
+
project_name = "Untitled Project"
|
|
52
|
+
project: IfcProject = IfcProject(name=project_name, site=site)
|
|
53
|
+
model: IfcModel = IfcModel(project=project)
|
|
54
|
+
reporter.info(
|
|
55
|
+
"---ST-Bridge->IFCジオメトリデータ変換処理終了---",
|
|
56
|
+
code=Code.PROGRESS_INFO,
|
|
57
|
+
phase=Phase.CONVERT_IFC,
|
|
58
|
+
)
|
|
59
|
+
return model
|
|
@@ -0,0 +1,22 @@
|
|
|
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 dataclasses import dataclass
|
|
8
|
+
from enum import Enum
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class SrcConversionMode(Enum):
|
|
12
|
+
"""SRC部材の変換モード"""
|
|
13
|
+
|
|
14
|
+
RC_ONLY = "rc_only"
|
|
15
|
+
"""RC形状のみ変換"""
|
|
16
|
+
RC_AND_STEEL = "rc_and_steel"
|
|
17
|
+
"""鉄骨も含めて変換"""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@dataclass
|
|
21
|
+
class ConvertOptionStbToIfc:
|
|
22
|
+
src_conversion_mode: SrcConversionMode = SrcConversionMode.RC_AND_STEEL
|
|
@@ -0,0 +1,22 @@
|
|
|
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 Reporter
|
|
8
|
+
|
|
9
|
+
from stbkit.api.stb_latest import StBridge
|
|
10
|
+
|
|
11
|
+
from .building_geometry_to_ply_text import building_geometry_to_ply_text
|
|
12
|
+
from .element_data_to_building_geometry import element_data_to_building_geometry
|
|
13
|
+
from .stb_latest_to_element_data import stb_to_element_data
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def stb_to_ply_text(stb: StBridge, *, reporter: Reporter) -> str:
|
|
17
|
+
geom = element_data_to_building_geometry(
|
|
18
|
+
stb_to_element_data(stb, reporter=reporter),
|
|
19
|
+
allow_polygons=True,
|
|
20
|
+
reporter=reporter,
|
|
21
|
+
)
|
|
22
|
+
return building_geometry_to_ply_text(geom)
|
stbkit/tools/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Copyright 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 ._internal.upgrade import upgrade_to as upgrade_to
|
|
8
|
+
from ._internal.upgrade import upgrade_to_latest as upgrade_to_latest
|
|
9
|
+
|
|
10
|
+
__all__ = [
|
|
11
|
+
"upgrade_to",
|
|
12
|
+
"upgrade_to_latest",
|
|
13
|
+
]
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Copyright 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/.
|