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,227 @@
|
|
|
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 collections.abc import Callable, Sequence
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
from typing import Protocol
|
|
10
|
+
|
|
11
|
+
from stbkit.core.data_model import stb_v2_0_2, stb_v2_1_0
|
|
12
|
+
from stbkit.core.data_model.common import StBridgeElement
|
|
13
|
+
from stbkit.core.stb_exceptions import NoneAccessError
|
|
14
|
+
from stbkit.core.stb_reporting import Code, Phase, Reporter
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class HasSize(Protocol):
|
|
18
|
+
@property
|
|
19
|
+
def width(self) -> float: ...
|
|
20
|
+
@property
|
|
21
|
+
def depth(self) -> float: ...
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class HasPosAndSize(HasSize, Protocol):
|
|
25
|
+
@property
|
|
26
|
+
def pos(self) -> str: ...
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@dataclass(frozen=True, kw_only=True, slots=True)
|
|
30
|
+
class ConcreteBeamKind[T: StBridgeElement]:
|
|
31
|
+
"""RCとSRCで分ける処理"""
|
|
32
|
+
|
|
33
|
+
straight_figure: Callable[[int, stb_v2_1_0.StbSecBeamStraight], T]
|
|
34
|
+
taper_figure: Callable[[int, stb_v2_1_0.StbSecBeamTaper], T]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
BEAM_KIND_RC: ConcreteBeamKind[stb_v2_1_0.StbSecFigureBeamRc] = ConcreteBeamKind(
|
|
38
|
+
straight_figure=lambda order, straight: stb_v2_1_0.StbSecFigureBeamRc(
|
|
39
|
+
order=order, stb_sec_beam_straight=straight
|
|
40
|
+
),
|
|
41
|
+
taper_figure=lambda order, taper: stb_v2_1_0.StbSecFigureBeamRc(
|
|
42
|
+
order=order, stb_sec_beam_taper=taper
|
|
43
|
+
),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
BEAM_KIND_SRC: ConcreteBeamKind[stb_v2_1_0.StbSecFigureBeamSrc] = ConcreteBeamKind(
|
|
47
|
+
straight_figure=lambda order, straight: stb_v2_1_0.StbSecFigureBeamSrc(
|
|
48
|
+
order=order, stb_sec_beam_straight=straight
|
|
49
|
+
),
|
|
50
|
+
taper_figure=lambda order, taper: stb_v2_1_0.StbSecFigureBeamSrc(
|
|
51
|
+
order=order, stb_sec_beam_taper=taper
|
|
52
|
+
),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def convert_figure[T: StBridgeElement](
|
|
57
|
+
kind: ConcreteBeamKind[T],
|
|
58
|
+
*,
|
|
59
|
+
straight: HasSize | None,
|
|
60
|
+
tapers: Sequence[HasPosAndSize],
|
|
61
|
+
haunches: Sequence[HasPosAndSize],
|
|
62
|
+
element: StBridgeElement,
|
|
63
|
+
reporter: Reporter,
|
|
64
|
+
) -> list[T]:
|
|
65
|
+
figures: list[T] = []
|
|
66
|
+
if straight is not None:
|
|
67
|
+
figures.append(
|
|
68
|
+
kind.straight_figure(
|
|
69
|
+
1,
|
|
70
|
+
stb_v2_1_0.StbSecBeamStraight(
|
|
71
|
+
width=straight.width,
|
|
72
|
+
depth=straight.depth,
|
|
73
|
+
),
|
|
74
|
+
)
|
|
75
|
+
)
|
|
76
|
+
if tapers:
|
|
77
|
+
if len(tapers) != 2:
|
|
78
|
+
reporter.warning(
|
|
79
|
+
message="Taperの回数がスキーマ違反のため変換できません",
|
|
80
|
+
code=Code.SCHEMA_ERROR,
|
|
81
|
+
phase=Phase.UPGRADE,
|
|
82
|
+
stb_element=element,
|
|
83
|
+
)
|
|
84
|
+
return []
|
|
85
|
+
try:
|
|
86
|
+
taper_start: HasPosAndSize = next(
|
|
87
|
+
segment for segment in tapers if segment.pos == "START"
|
|
88
|
+
)
|
|
89
|
+
taper_end: HasPosAndSize = next(
|
|
90
|
+
segment for segment in tapers if segment.pos == "END"
|
|
91
|
+
)
|
|
92
|
+
except StopIteration:
|
|
93
|
+
reporter.warning(
|
|
94
|
+
message="TaperのSTART,ENDが1回ずつ使われていないため変換できません",
|
|
95
|
+
code=Code.SCHEMA_ERROR,
|
|
96
|
+
phase=Phase.UPGRADE,
|
|
97
|
+
stb_element=element,
|
|
98
|
+
)
|
|
99
|
+
return []
|
|
100
|
+
figures.append(
|
|
101
|
+
kind.taper_figure(
|
|
102
|
+
1,
|
|
103
|
+
stb_v2_1_0.StbSecBeamTaper(
|
|
104
|
+
start_width=taper_start.width,
|
|
105
|
+
start_depth=taper_start.depth,
|
|
106
|
+
end_width=taper_end.width,
|
|
107
|
+
end_depth=taper_end.depth,
|
|
108
|
+
),
|
|
109
|
+
)
|
|
110
|
+
)
|
|
111
|
+
if haunches:
|
|
112
|
+
if len(haunches) != 3:
|
|
113
|
+
reporter.warning(
|
|
114
|
+
message="Haunchの回数がスキーマ違反のため変換できません",
|
|
115
|
+
code=Code.SCHEMA_ERROR,
|
|
116
|
+
phase=Phase.UPGRADE,
|
|
117
|
+
stb_element=element,
|
|
118
|
+
)
|
|
119
|
+
return []
|
|
120
|
+
try:
|
|
121
|
+
haunch_start: HasPosAndSize = next(
|
|
122
|
+
segment for segment in haunches if segment.pos == "START"
|
|
123
|
+
)
|
|
124
|
+
haunch_center: HasPosAndSize = next(
|
|
125
|
+
segment for segment in haunches if segment.pos == "CENTER"
|
|
126
|
+
)
|
|
127
|
+
haunch_end: HasPosAndSize = next(
|
|
128
|
+
segment for segment in haunches if segment.pos == "END"
|
|
129
|
+
)
|
|
130
|
+
except StopIteration:
|
|
131
|
+
reporter.warning(
|
|
132
|
+
message="HaunchのSTART,CENTER,ENDが1回ずつ使われていないため変換できません",
|
|
133
|
+
code=Code.SCHEMA_ERROR,
|
|
134
|
+
phase=Phase.UPGRADE,
|
|
135
|
+
stb_element=element,
|
|
136
|
+
)
|
|
137
|
+
return []
|
|
138
|
+
figures.append(
|
|
139
|
+
kind.taper_figure(
|
|
140
|
+
1,
|
|
141
|
+
stb_v2_1_0.StbSecBeamTaper(
|
|
142
|
+
start_width=haunch_start.width,
|
|
143
|
+
start_depth=haunch_start.depth,
|
|
144
|
+
end_width=haunch_center.width,
|
|
145
|
+
end_depth=haunch_center.depth,
|
|
146
|
+
),
|
|
147
|
+
)
|
|
148
|
+
)
|
|
149
|
+
figures.append(
|
|
150
|
+
kind.straight_figure(
|
|
151
|
+
2,
|
|
152
|
+
stb_v2_1_0.StbSecBeamStraight(
|
|
153
|
+
width=haunch_center.width,
|
|
154
|
+
depth=haunch_center.depth,
|
|
155
|
+
),
|
|
156
|
+
)
|
|
157
|
+
)
|
|
158
|
+
figures.append(
|
|
159
|
+
kind.taper_figure(
|
|
160
|
+
3,
|
|
161
|
+
stb_v2_1_0.StbSecBeamTaper(
|
|
162
|
+
start_width=haunch_center.width,
|
|
163
|
+
start_depth=haunch_center.depth,
|
|
164
|
+
end_width=haunch_end.width,
|
|
165
|
+
end_depth=haunch_end.depth,
|
|
166
|
+
),
|
|
167
|
+
)
|
|
168
|
+
)
|
|
169
|
+
return figures
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def post_sec_beam_rc(
|
|
173
|
+
v202: stb_v2_0_2.StBridge, v210: stb_v2_1_0.StBridge, *, reporter: Reporter
|
|
174
|
+
) -> None:
|
|
175
|
+
try:
|
|
176
|
+
v202_sections: list[stb_v2_0_2.StbSecBeamRc] = (
|
|
177
|
+
v202.stb_model.stb_sections.stb_sec_beam_rc
|
|
178
|
+
)
|
|
179
|
+
v210_sections: list[stb_v2_1_0.StbSecBeamRc] = (
|
|
180
|
+
v210.stb_model.stb_sections.stb_sec_beam_rc
|
|
181
|
+
)
|
|
182
|
+
for v202_section, v210_section in zip(v202_sections, v210_sections):
|
|
183
|
+
v202_figure: stb_v2_0_2.StbSecFigureBeamRc | None = (
|
|
184
|
+
v202_section.stb_sec_figure_beam_rc_or_none
|
|
185
|
+
)
|
|
186
|
+
if v202_figure is None:
|
|
187
|
+
v210_section.stb_sec_figure_beam_rc = []
|
|
188
|
+
continue
|
|
189
|
+
v210_section.stb_sec_figure_beam_rc = convert_figure(
|
|
190
|
+
BEAM_KIND_RC,
|
|
191
|
+
straight=v202_figure.stb_sec_beam_rc_straight_or_none,
|
|
192
|
+
tapers=v202_figure.stb_sec_beam_rc_taper,
|
|
193
|
+
haunches=v202_figure.stb_sec_beam_rc_haunch,
|
|
194
|
+
element=v202_figure,
|
|
195
|
+
reporter=reporter,
|
|
196
|
+
)
|
|
197
|
+
except NoneAccessError:
|
|
198
|
+
return
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
def post_sec_beam_src_rc(
|
|
202
|
+
v202: stb_v2_0_2.StBridge, v210: stb_v2_1_0.StBridge, *, reporter: Reporter
|
|
203
|
+
) -> None:
|
|
204
|
+
try:
|
|
205
|
+
v202_sections: list[stb_v2_0_2.StbSecBeamSrc] = (
|
|
206
|
+
v202.stb_model.stb_sections.stb_sec_beam_src
|
|
207
|
+
)
|
|
208
|
+
v210_sections: list[stb_v2_1_0.StbSecBeamSrc] = (
|
|
209
|
+
v210.stb_model.stb_sections.stb_sec_beam_src
|
|
210
|
+
)
|
|
211
|
+
for v202_section, v210_section in zip(v202_sections, v210_sections):
|
|
212
|
+
v202_figure: stb_v2_0_2.StbSecFigureBeamSrc | None = (
|
|
213
|
+
v202_section.stb_sec_figure_beam_src_or_none
|
|
214
|
+
)
|
|
215
|
+
if v202_figure is None:
|
|
216
|
+
v210_section.stb_sec_figure_beam_src = []
|
|
217
|
+
continue
|
|
218
|
+
v210_section.stb_sec_figure_beam_src = convert_figure(
|
|
219
|
+
BEAM_KIND_SRC,
|
|
220
|
+
straight=v202_figure.stb_sec_beam_src_straight_or_none,
|
|
221
|
+
tapers=v202_figure.stb_sec_beam_src_taper,
|
|
222
|
+
haunches=v202_figure.stb_sec_beam_src_haunch,
|
|
223
|
+
element=v202_figure,
|
|
224
|
+
reporter=reporter,
|
|
225
|
+
)
|
|
226
|
+
except NoneAccessError:
|
|
227
|
+
return
|