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,103 @@
|
|
|
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 import stb_latest
|
|
10
|
+
from stbkit.api.experimental.repository import RepositoryLatest
|
|
11
|
+
|
|
12
|
+
from ....._internal.data_model.element_data import ElementPlane, ElementType
|
|
13
|
+
from ....._internal.vectors import Vector3d
|
|
14
|
+
from ... import coord_converter
|
|
15
|
+
from ..section import sec
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def stb_wall_to_ifc_data(
|
|
19
|
+
stb_wall: stb_latest.StbWall,
|
|
20
|
+
node_coords: dict[int, Vector3d],
|
|
21
|
+
repo: RepositoryLatest,
|
|
22
|
+
stb_id_to_planes: dict[int, ElementPlane],
|
|
23
|
+
reporter: Reporter,
|
|
24
|
+
) -> ElementPlane:
|
|
25
|
+
points: list[Vector3d] = []
|
|
26
|
+
node_ids: list[int] = list(stb_wall.stb_node_id_order.content)
|
|
27
|
+
node_points: list[Vector3d] = [node_coords[id] for id in node_ids]
|
|
28
|
+
for id in node_ids:
|
|
29
|
+
point: Vector3d = node_coords[id]
|
|
30
|
+
if stb_wall.stb_wall_offset_list_or_none is not None:
|
|
31
|
+
for stb_offset in stb_wall.stb_wall_offset_list.stb_wall_offset:
|
|
32
|
+
if stb_offset.id_node == id:
|
|
33
|
+
offset: Vector3d = Vector3d(
|
|
34
|
+
stb_offset.offset_x,
|
|
35
|
+
stb_offset.offset_y,
|
|
36
|
+
stb_offset.offset_z,
|
|
37
|
+
)
|
|
38
|
+
point += offset
|
|
39
|
+
break
|
|
40
|
+
points.append(point)
|
|
41
|
+
thickness: float = sec.get_wall_t(repo, stb_wall, reporter)
|
|
42
|
+
(_vx, _vy, vz) = coord_converter.axis_vector_plate(points)
|
|
43
|
+
points = [point - thickness / 2.0 * vz for point in points]
|
|
44
|
+
name: str = str(stb_wall.id)
|
|
45
|
+
|
|
46
|
+
if stb_wall.name:
|
|
47
|
+
name += f"_{stb_wall.name}"
|
|
48
|
+
plate: ElementPlane = ElementPlane(
|
|
49
|
+
element_type=ElementType.WALL,
|
|
50
|
+
name=name,
|
|
51
|
+
guid=stb_wall.guid_or_none,
|
|
52
|
+
points=points,
|
|
53
|
+
thickness=thickness,
|
|
54
|
+
path=stb_wall._path_xml(),
|
|
55
|
+
node_ids=node_ids,
|
|
56
|
+
node_points=node_points,
|
|
57
|
+
)
|
|
58
|
+
stb_id_to_planes[stb_wall.id] = plate
|
|
59
|
+
return plate
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def stb_slab_to_ifc_data(
|
|
63
|
+
stb_slab: stb_latest.StbSlab,
|
|
64
|
+
node_coords: dict[int, Vector3d],
|
|
65
|
+
repo: RepositoryLatest,
|
|
66
|
+
stb_id_to_planes: dict[int, ElementPlane],
|
|
67
|
+
reporter: Reporter,
|
|
68
|
+
) -> ElementPlane:
|
|
69
|
+
points: list[Vector3d] = []
|
|
70
|
+
node_ids: list[int] = list(stb_slab.stb_node_id_order.content)
|
|
71
|
+
node_points: list[Vector3d] = [node_coords[id] for id in node_ids]
|
|
72
|
+
for id in node_ids:
|
|
73
|
+
point: Vector3d = node_coords[id]
|
|
74
|
+
if stb_slab.stb_slab_offset_list_or_none:
|
|
75
|
+
for stb_offset in stb_slab.stb_slab_offset_list.stb_slab_offset:
|
|
76
|
+
if stb_offset.id_node == id:
|
|
77
|
+
offset: Vector3d = Vector3d(
|
|
78
|
+
stb_offset.offset_x,
|
|
79
|
+
stb_offset.offset_y,
|
|
80
|
+
stb_offset.offset_z,
|
|
81
|
+
)
|
|
82
|
+
point += offset
|
|
83
|
+
break
|
|
84
|
+
points.append(point)
|
|
85
|
+
thickness: float = sec.get_slab_depth(repo, stb_slab, reporter)
|
|
86
|
+
(_vx, _vy, vz) = coord_converter.axis_vector_plate(points)
|
|
87
|
+
points = [point - thickness * vz for point in points]
|
|
88
|
+
name: str = str(stb_slab.id)
|
|
89
|
+
|
|
90
|
+
if stb_slab.name:
|
|
91
|
+
name += f"_{stb_slab.name}"
|
|
92
|
+
plate: ElementPlane = ElementPlane(
|
|
93
|
+
element_type=ElementType.SLAB,
|
|
94
|
+
name=name,
|
|
95
|
+
guid=stb_slab.guid_or_none,
|
|
96
|
+
points=points,
|
|
97
|
+
thickness=thickness,
|
|
98
|
+
path=stb_slab._path_xml(),
|
|
99
|
+
node_ids=node_ids,
|
|
100
|
+
node_points=node_points,
|
|
101
|
+
)
|
|
102
|
+
stb_id_to_planes[stb_slab.id] = plate
|
|
103
|
+
return plate
|
|
@@ -0,0 +1,70 @@
|
|
|
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 StbModel, StbOpenArrangement, StbSecOpenRc
|
|
11
|
+
|
|
12
|
+
from ...._internal.data_model.element_data import ElementPlane
|
|
13
|
+
from ...._internal.vectors import Vector2d
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def add_open(
|
|
17
|
+
stb_model: StbModel,
|
|
18
|
+
stb_id_to_planes: dict[int, ElementPlane],
|
|
19
|
+
*,
|
|
20
|
+
reporter: Reporter,
|
|
21
|
+
) -> None:
|
|
22
|
+
"""開口の追加
|
|
23
|
+
TODO:回転は未実装"""
|
|
24
|
+
try:
|
|
25
|
+
stb_opens: list[StbOpenArrangement] = (
|
|
26
|
+
stb_model.stb_members.stb_open_arrangements.stb_open_arrangement
|
|
27
|
+
)
|
|
28
|
+
stb_sec_opens: list[StbSecOpenRc] = stb_model.stb_sections.stb_sec_open_rc
|
|
29
|
+
except NoneAccessError:
|
|
30
|
+
return
|
|
31
|
+
for stb_open in stb_opens:
|
|
32
|
+
if stb_open.rotate_or_none is not None and stb_open.rotate != 0.0:
|
|
33
|
+
reporter.warning(
|
|
34
|
+
message="開口の回転は未実装です",
|
|
35
|
+
code=Code.NOT_IMPLEMENTED,
|
|
36
|
+
phase=Phase.CONVERT_GEOMETRY,
|
|
37
|
+
stb_element=stb_open,
|
|
38
|
+
attr_name="rotate",
|
|
39
|
+
)
|
|
40
|
+
stb_sec_open: StbSecOpenRc | None = next(
|
|
41
|
+
filter(
|
|
42
|
+
lambda obj: obj is not None and obj.id == stb_open.id_section,
|
|
43
|
+
stb_sec_opens,
|
|
44
|
+
),
|
|
45
|
+
None,
|
|
46
|
+
)
|
|
47
|
+
if not stb_sec_open:
|
|
48
|
+
continue
|
|
49
|
+
plane: ElementPlane = stb_id_to_planes[stb_open.id_member]
|
|
50
|
+
if not plane.thickness:
|
|
51
|
+
continue
|
|
52
|
+
opens: list[list[Vector2d]] = plane.opens
|
|
53
|
+
x = stb_open.position_x
|
|
54
|
+
y = stb_open.position_y
|
|
55
|
+
if (
|
|
56
|
+
stb_sec_open.length_x_or_none is None
|
|
57
|
+
or stb_sec_open.length_y_or_none is None
|
|
58
|
+
):
|
|
59
|
+
continue
|
|
60
|
+
w = stb_sec_open.length_x
|
|
61
|
+
h = stb_sec_open.length_y
|
|
62
|
+
if x is not None and y is not None and w and h:
|
|
63
|
+
opens.append(
|
|
64
|
+
[
|
|
65
|
+
Vector2d(x, y),
|
|
66
|
+
Vector2d(x + w, y),
|
|
67
|
+
Vector2d(x + w, y + h),
|
|
68
|
+
Vector2d(x, y + h),
|
|
69
|
+
]
|
|
70
|
+
)
|
|
@@ -0,0 +1,214 @@
|
|
|
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 (
|
|
9
|
+
NoneAccessError,
|
|
10
|
+
ReferenceElementNotFoundError,
|
|
11
|
+
SchemaError,
|
|
12
|
+
)
|
|
13
|
+
from stbkit.core.stb_reporting import Code, Phase, Reporter
|
|
14
|
+
|
|
15
|
+
from stbkit.api import stb_latest
|
|
16
|
+
from stbkit.api.experimental.repository import RepositoryLatest
|
|
17
|
+
from stbkit.api.stb_latest import (
|
|
18
|
+
StbBeam,
|
|
19
|
+
StbBrace,
|
|
20
|
+
StbColumn,
|
|
21
|
+
StbFoundationColumn,
|
|
22
|
+
StbGirder,
|
|
23
|
+
StbParapet,
|
|
24
|
+
StbPile,
|
|
25
|
+
StbPost,
|
|
26
|
+
StbSecBeamRc,
|
|
27
|
+
StbSecBeamS,
|
|
28
|
+
StbSecBeamSrc,
|
|
29
|
+
StbSecBraceS,
|
|
30
|
+
StbSecColumnCft,
|
|
31
|
+
StbSecColumnRc,
|
|
32
|
+
StbSecColumnS,
|
|
33
|
+
StbSecColumnSrc,
|
|
34
|
+
StbSecFoundationRc,
|
|
35
|
+
StbSecParapetRc,
|
|
36
|
+
StbSecPileRc,
|
|
37
|
+
StbSecPileS,
|
|
38
|
+
StbSecUndefined,
|
|
39
|
+
StbStripFooting,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
from ....._internal.constants import UNKNOWN_ELEMENT_SIZE_MM
|
|
43
|
+
from ....._internal.data_model.shape_data import (
|
|
44
|
+
SHAPE_PAIRS_UNDEFINED,
|
|
45
|
+
ShapePair,
|
|
46
|
+
)
|
|
47
|
+
from ....._internal.utils.unit_utils import mm_to_m
|
|
48
|
+
from ....._internal.vectors import Vector2d
|
|
49
|
+
from . import (
|
|
50
|
+
sec_beam_rc,
|
|
51
|
+
sec_beam_s,
|
|
52
|
+
sec_beam_src,
|
|
53
|
+
sec_brace_s,
|
|
54
|
+
sec_column_cft,
|
|
55
|
+
sec_column_rc,
|
|
56
|
+
sec_column_s,
|
|
57
|
+
sec_column_src,
|
|
58
|
+
sec_foundation,
|
|
59
|
+
sec_parapet_rc,
|
|
60
|
+
sec_pile_rc,
|
|
61
|
+
sec_pile_s,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def get_shapes_element_line(
|
|
66
|
+
repo: RepositoryLatest,
|
|
67
|
+
ele: StbColumn
|
|
68
|
+
| StbGirder
|
|
69
|
+
| StbPost
|
|
70
|
+
| StbBeam
|
|
71
|
+
| StbBrace
|
|
72
|
+
| StbStripFooting
|
|
73
|
+
| StbPile
|
|
74
|
+
| StbFoundationColumn
|
|
75
|
+
| StbParapet,
|
|
76
|
+
reporter: Reporter,
|
|
77
|
+
) -> list[ShapePair] | tuple[list[ShapePair], list[ShapePair]] | None:
|
|
78
|
+
if isinstance(ele, StbFoundationColumn):
|
|
79
|
+
foundation_column_shapes: list[ShapePair] = []
|
|
80
|
+
if ele.id_section_fd_or_none is not None:
|
|
81
|
+
try:
|
|
82
|
+
section_fd: StbSecColumnRc = repo.get(StbSecColumnRc, ele.id_section_fd)
|
|
83
|
+
shapes_fd: list[ShapePair] = sec_column_rc.stb_sec_column_rc_to_shapes(
|
|
84
|
+
section_fd
|
|
85
|
+
)
|
|
86
|
+
if shapes_fd:
|
|
87
|
+
foundation_column_shapes.extend(shapes_fd)
|
|
88
|
+
except ReferenceElementNotFoundError:
|
|
89
|
+
pass
|
|
90
|
+
if ele.id_section_wr_or_none is not None:
|
|
91
|
+
try:
|
|
92
|
+
section_wr: StbSecColumnRc = repo.get(StbSecColumnRc, ele.id_section_wr)
|
|
93
|
+
shapes_wr: list[ShapePair] = sec_column_rc.stb_sec_column_rc_to_shapes(
|
|
94
|
+
section_wr
|
|
95
|
+
)
|
|
96
|
+
if shapes_wr:
|
|
97
|
+
if (ele.offset_wr_x_or_none or ele.offset_wr_y_or_none) and (
|
|
98
|
+
ele.offset_fd_x_or_none or ele.offset_fd_y_or_none
|
|
99
|
+
):
|
|
100
|
+
rotate: float = ele.rotate_or_none or 0.0
|
|
101
|
+
offset_fd: Vector2d = Vector2d(
|
|
102
|
+
ele.offset_fd_x_or_none or 0.0,
|
|
103
|
+
ele.offset_fd_y_or_none or 0.0,
|
|
104
|
+
)
|
|
105
|
+
offset_wr: Vector2d = Vector2d(
|
|
106
|
+
ele.offset_wr_x_or_none or 0.0,
|
|
107
|
+
ele.offset_wr_y_or_none or 0.0,
|
|
108
|
+
)
|
|
109
|
+
offset_wr = offset_wr.rotate(-rotate) - offset_fd.rotate(
|
|
110
|
+
-rotate
|
|
111
|
+
)
|
|
112
|
+
for item in shapes_wr:
|
|
113
|
+
item.start.offset = offset_wr
|
|
114
|
+
if item.end:
|
|
115
|
+
item.end.offset = offset_wr
|
|
116
|
+
foundation_column_shapes.extend(shapes_wr)
|
|
117
|
+
except ReferenceElementNotFoundError:
|
|
118
|
+
pass
|
|
119
|
+
return foundation_column_shapes
|
|
120
|
+
try:
|
|
121
|
+
section: StBridgeElement = repo.deref(ele).id_section
|
|
122
|
+
except ReferenceElementNotFoundError:
|
|
123
|
+
return None
|
|
124
|
+
except SchemaError:
|
|
125
|
+
reporter.error(
|
|
126
|
+
message="断面参照が不正です",
|
|
127
|
+
code=Code.SCHEMA_ERROR,
|
|
128
|
+
phase=Phase.CONVERT_GEOMETRY,
|
|
129
|
+
stb_element=ele,
|
|
130
|
+
attr_name="id_section",
|
|
131
|
+
)
|
|
132
|
+
return None
|
|
133
|
+
match section:
|
|
134
|
+
case StbSecColumnRc():
|
|
135
|
+
return sec_column_rc.stb_sec_column_rc_to_shapes(section)
|
|
136
|
+
case StbSecColumnS():
|
|
137
|
+
return sec_column_s.stb_sec_column_s_to_shapes(repo, section, reporter)
|
|
138
|
+
case StbSecColumnSrc():
|
|
139
|
+
return sec_column_src.stb_sec_column_src_to_shapes(repo, section, reporter)
|
|
140
|
+
case StbSecColumnCft():
|
|
141
|
+
return sec_column_cft.stb_sec_column_cft_to_shapes(repo, section, reporter)
|
|
142
|
+
case StbSecBeamRc():
|
|
143
|
+
return sec_beam_rc.stb_sec_beam_rc_to_shapes(section)
|
|
144
|
+
case StbSecBeamS():
|
|
145
|
+
return sec_beam_s.stb_sec_beam_s_to_shapes(repo, section, reporter)
|
|
146
|
+
case StbSecBeamSrc():
|
|
147
|
+
return sec_beam_src.stb_sec_beam_src_to_shapes(repo, section, reporter)
|
|
148
|
+
case StbSecBraceS():
|
|
149
|
+
return sec_brace_s.stb_sec_brace_s_to_shapes(repo, section, reporter)
|
|
150
|
+
case StbSecFoundationRc():
|
|
151
|
+
shapes, _ = sec_foundation.stb_sec_foundation_rc_to_shapes_and_depth(
|
|
152
|
+
section, reporter
|
|
153
|
+
)
|
|
154
|
+
return shapes
|
|
155
|
+
case StbSecPileRc():
|
|
156
|
+
return sec_pile_rc.stb_sec_pile_rc_to_shapes(section, reporter)
|
|
157
|
+
case StbSecPileS():
|
|
158
|
+
shapes, _ = sec_pile_s.stb_sec_pile_s_to_shapes_and_length(section)
|
|
159
|
+
return shapes
|
|
160
|
+
case StbSecParapetRc():
|
|
161
|
+
return sec_parapet_rc.stb_sec_parapet_rc_to_shapes(section, reporter)
|
|
162
|
+
case StbSecUndefined():
|
|
163
|
+
return SHAPE_PAIRS_UNDEFINED
|
|
164
|
+
case _:
|
|
165
|
+
return None
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def get_slab_depth(
|
|
169
|
+
repo: RepositoryLatest, stb_slab: stb_latest.StbSlab, reporter: Reporter
|
|
170
|
+
) -> float:
|
|
171
|
+
try:
|
|
172
|
+
section = repo.deref(stb_slab).id_section_or_none
|
|
173
|
+
except SchemaError:
|
|
174
|
+
section = None
|
|
175
|
+
if isinstance(section, stb_latest.StbSecSlabRc):
|
|
176
|
+
try:
|
|
177
|
+
return section.stb_sec_slab_rc_conventional.stb_sec_figure_slab_rc_conventional.stb_sec_slab_rc_conventional_straight.depth
|
|
178
|
+
except NoneAccessError:
|
|
179
|
+
pass
|
|
180
|
+
reporter.warning(
|
|
181
|
+
message=(
|
|
182
|
+
f"スラブ断面id={stb_slab.id_section_or_none}が"
|
|
183
|
+
f"見つかりませんでした。d={UNKNOWN_ELEMENT_SIZE_MM}mmで代替します"
|
|
184
|
+
),
|
|
185
|
+
code=Code.MISSING_ATTRIBUTE,
|
|
186
|
+
phase=Phase.CONVERT_IFC,
|
|
187
|
+
stb_element=stb_slab,
|
|
188
|
+
attr_name="id_section",
|
|
189
|
+
)
|
|
190
|
+
return mm_to_m(UNKNOWN_ELEMENT_SIZE_MM)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def get_wall_t(
|
|
194
|
+
repo: RepositoryLatest, stb_wall: stb_latest.StbWall, reporter: Reporter
|
|
195
|
+
) -> float:
|
|
196
|
+
try:
|
|
197
|
+
section = repo.deref(stb_wall).id_section_or_none
|
|
198
|
+
except SchemaError:
|
|
199
|
+
section = None
|
|
200
|
+
if isinstance(section, stb_latest.StbSecWallRc):
|
|
201
|
+
fig: stb_latest.StbSecFigureWallRc = section.stb_sec_figure_wall_rc
|
|
202
|
+
if fig.stb_sec_wall_rc_straight:
|
|
203
|
+
return fig.stb_sec_wall_rc_straight.t
|
|
204
|
+
reporter.warning(
|
|
205
|
+
message=(
|
|
206
|
+
f"壁断面id={stb_wall.id_section_or_none}が"
|
|
207
|
+
f"見つかりませんでした。t={UNKNOWN_ELEMENT_SIZE_MM}mmで代替します"
|
|
208
|
+
),
|
|
209
|
+
code=Code.MISSING_ATTRIBUTE,
|
|
210
|
+
phase=Phase.CONVERT_IFC,
|
|
211
|
+
stb_element=stb_wall,
|
|
212
|
+
attr_name="id_section",
|
|
213
|
+
)
|
|
214
|
+
return mm_to_m(UNKNOWN_ELEMENT_SIZE_MM)
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
StbSecBeamRc,
|
|
9
|
+
StbSecBeamSrc,
|
|
10
|
+
StbSecBeamStraight,
|
|
11
|
+
StbSecBeamTaper,
|
|
12
|
+
StbSecFigureBeamRc,
|
|
13
|
+
StbSecFigureBeamSrc,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
from ....._internal.data_model.shape_data import (
|
|
17
|
+
SHAPE_PAIR_UNKNOWN,
|
|
18
|
+
ShapePair,
|
|
19
|
+
ShapeRectangle,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def stb_figure_beam_rc_to_shapes(
|
|
24
|
+
figure: StbSecFigureBeamRc | StbSecFigureBeamSrc, name: str
|
|
25
|
+
) -> ShapePair:
|
|
26
|
+
if figure.stb_sec_beam_straight_or_none:
|
|
27
|
+
straight: StbSecBeamStraight = figure.stb_sec_beam_straight
|
|
28
|
+
return ShapePair(
|
|
29
|
+
ShapeRectangle(
|
|
30
|
+
name=name,
|
|
31
|
+
width_x=straight.width,
|
|
32
|
+
width_y=straight.depth,
|
|
33
|
+
)
|
|
34
|
+
)
|
|
35
|
+
elif figure.stb_sec_beam_taper_or_none:
|
|
36
|
+
taper: StbSecBeamTaper = figure.stb_sec_beam_taper
|
|
37
|
+
shape_start: ShapeRectangle = ShapeRectangle(
|
|
38
|
+
name=name + "_start",
|
|
39
|
+
width_x=taper.start_width,
|
|
40
|
+
width_y=taper.start_depth,
|
|
41
|
+
)
|
|
42
|
+
shape_end: ShapeRectangle = ShapeRectangle(
|
|
43
|
+
name=name + "_end",
|
|
44
|
+
width_x=taper.end_width,
|
|
45
|
+
width_y=taper.end_depth,
|
|
46
|
+
)
|
|
47
|
+
return ShapePair(shape_start, shape_end)
|
|
48
|
+
else:
|
|
49
|
+
return SHAPE_PAIR_UNKNOWN
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def stb_sec_beam_rc_to_shapes(
|
|
53
|
+
stb_sec_beam_rc: StbSecBeamRc,
|
|
54
|
+
) -> list[ShapePair]:
|
|
55
|
+
result: list[ShapePair] = []
|
|
56
|
+
for figure in stb_sec_beam_rc.stb_sec_figure_beam_rc:
|
|
57
|
+
result.append(stb_figure_beam_rc_to_shapes(figure, stb_sec_beam_rc.name))
|
|
58
|
+
return result
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def stb_sec_beam_src_to_shapes_rc(
|
|
62
|
+
stb_sec_beam_src: StbSecBeamSrc,
|
|
63
|
+
) -> list[ShapePair]:
|
|
64
|
+
result: list[ShapePair] = []
|
|
65
|
+
for figure in stb_sec_beam_src.stb_sec_figure_beam_src:
|
|
66
|
+
result.append(stb_figure_beam_rc_to_shapes(figure, stb_sec_beam_src.name))
|
|
67
|
+
return result
|
|
@@ -0,0 +1,97 @@
|
|
|
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
|
+
StbSecBeamS,
|
|
13
|
+
StbSecBeamSrc,
|
|
14
|
+
StbSecSteelFigureBeamS,
|
|
15
|
+
StbSecSteelFigureBeamSrc,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
from ....._internal.data_model.shape_data import (
|
|
19
|
+
Shape,
|
|
20
|
+
ShapePair,
|
|
21
|
+
)
|
|
22
|
+
from ....._internal.vectors import Vector2d
|
|
23
|
+
from . import sec_steel
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def stb_sec_beam_s_to_shapes(
|
|
27
|
+
repo: RepositoryLatest,
|
|
28
|
+
sec_b_s: StbSecBeamS | StbSecBeamSrc,
|
|
29
|
+
reporter: Reporter,
|
|
30
|
+
) -> list[ShapePair]:
|
|
31
|
+
result: list[ShapePair] = []
|
|
32
|
+
try:
|
|
33
|
+
figure_b: StbSecSteelFigureBeamS | StbSecSteelFigureBeamSrc = (
|
|
34
|
+
sec_b_s.stb_sec_steel_figure_beam_s
|
|
35
|
+
if isinstance(sec_b_s, StbSecBeamS)
|
|
36
|
+
else sec_b_s.stb_sec_steel_figure_beam_src
|
|
37
|
+
)
|
|
38
|
+
for s_s_b_s_shape in (
|
|
39
|
+
figure_b.stb_sec_steel_beam_s_shape
|
|
40
|
+
if isinstance(figure_b, StbSecSteelFigureBeamS)
|
|
41
|
+
else figure_b.stb_sec_steel_beam_src_shape
|
|
42
|
+
):
|
|
43
|
+
straight = s_s_b_s_shape.stb_sec_steel_beam_straight_or_none
|
|
44
|
+
taper = s_s_b_s_shape.stb_sec_steel_beam_taper_or_none
|
|
45
|
+
if straight:
|
|
46
|
+
shape: Shape = sec_steel.stb_sec_steel_name_to_shape(
|
|
47
|
+
repo, straight.shape, reporter
|
|
48
|
+
)
|
|
49
|
+
if (
|
|
50
|
+
straight.vertical_offset_or_none
|
|
51
|
+
or straight.horizontal_offset_or_none
|
|
52
|
+
):
|
|
53
|
+
offset: Vector2d = Vector2d(
|
|
54
|
+
straight.horizontal_offset_or_none or 0.0,
|
|
55
|
+
straight.vertical_offset_or_none or 0.0,
|
|
56
|
+
)
|
|
57
|
+
shape.offset = offset
|
|
58
|
+
if not shape:
|
|
59
|
+
return []
|
|
60
|
+
result.append(ShapePair(shape))
|
|
61
|
+
elif taper:
|
|
62
|
+
shape_start: Shape = sec_steel.stb_sec_steel_name_to_shape(
|
|
63
|
+
repo, taper.start_shape, reporter
|
|
64
|
+
)
|
|
65
|
+
if (
|
|
66
|
+
taper.start_horizontal_offset_or_none
|
|
67
|
+
or taper.start_vertical_offset_or_none
|
|
68
|
+
):
|
|
69
|
+
offset_start: Vector2d = Vector2d(
|
|
70
|
+
taper.start_horizontal_offset_or_none or 0.0,
|
|
71
|
+
taper.start_vertical_offset_or_none or 0.0,
|
|
72
|
+
)
|
|
73
|
+
shape_start.offset = offset_start
|
|
74
|
+
shape_end: Shape = sec_steel.stb_sec_steel_name_to_shape(
|
|
75
|
+
repo, taper.end_shape, reporter
|
|
76
|
+
)
|
|
77
|
+
if (
|
|
78
|
+
taper.end_horizontal_offset_or_none
|
|
79
|
+
or taper.end_vertical_offset_or_none
|
|
80
|
+
):
|
|
81
|
+
offset_end: Vector2d = Vector2d(
|
|
82
|
+
taper.end_horizontal_offset_or_none or 0.0,
|
|
83
|
+
taper.end_vertical_offset_or_none or 0.0,
|
|
84
|
+
)
|
|
85
|
+
shape_end.offset = offset_end
|
|
86
|
+
result.append(
|
|
87
|
+
ShapePair(
|
|
88
|
+
shape_start,
|
|
89
|
+
shape_end,
|
|
90
|
+
)
|
|
91
|
+
)
|
|
92
|
+
return result
|
|
93
|
+
except (StbError, RuntimeError, AssertionError, TypeError, ValueError) as e:
|
|
94
|
+
reporter.warning(
|
|
95
|
+
message=str(e), code=Code.UNEXPECTED_ERROR, phase=Phase.CONVERT_IFC
|
|
96
|
+
)
|
|
97
|
+
return result
|
|
@@ -0,0 +1,28 @@
|
|
|
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.experimental.repository import RepositoryLatest
|
|
10
|
+
from stbkit.api.stb_latest import StbSecBeamSrc
|
|
11
|
+
|
|
12
|
+
from ....._internal.data_model.shape_data import ShapePair
|
|
13
|
+
from ...stb_latest_to_element_data.section import (
|
|
14
|
+
sec_beam_rc,
|
|
15
|
+
sec_beam_s,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def stb_sec_beam_src_to_shapes(
|
|
20
|
+
repo: RepositoryLatest,
|
|
21
|
+
sec_b_s: StbSecBeamSrc,
|
|
22
|
+
reporter: Reporter,
|
|
23
|
+
) -> tuple[list[ShapePair], list[ShapePair]]:
|
|
24
|
+
result_rc: list[ShapePair] = sec_beam_rc.stb_sec_beam_src_to_shapes_rc(sec_b_s)
|
|
25
|
+
result_s: list[ShapePair] = sec_beam_s.stb_sec_beam_s_to_shapes(
|
|
26
|
+
repo, sec_b_s, reporter
|
|
27
|
+
)
|
|
28
|
+
return result_rc, result_s
|
|
@@ -0,0 +1,49 @@
|
|
|
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.experimental.repository import RepositoryLatest
|
|
10
|
+
from stbkit.api.stb_latest import (
|
|
11
|
+
StbSecBraceS,
|
|
12
|
+
StbSecSteelBraceSSame,
|
|
13
|
+
StbSecSteelFigureBraceS,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
from ....._internal.data_model.shape_data import (
|
|
17
|
+
Shape,
|
|
18
|
+
ShapePair,
|
|
19
|
+
)
|
|
20
|
+
from .sec_steel import stb_sec_steel_name_to_shape
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def stb_sec_brace_s_to_shapes(
|
|
24
|
+
repo: RepositoryLatest,
|
|
25
|
+
stb_sec_brace_s: StbSecBraceS,
|
|
26
|
+
reporter: Reporter,
|
|
27
|
+
) -> list[ShapePair]:
|
|
28
|
+
"""
|
|
29
|
+
TODO:
|
|
30
|
+
- 2断面、3断面は非対応"""
|
|
31
|
+
result: list[ShapePair] = []
|
|
32
|
+
figure: StbSecSteelFigureBraceS | None = (
|
|
33
|
+
stb_sec_brace_s.stb_sec_steel_figure_brace_s_or_none
|
|
34
|
+
)
|
|
35
|
+
if figure is None:
|
|
36
|
+
reporter.warning(
|
|
37
|
+
"StbSecSteelFigureBrace_Sが設定されていません。",
|
|
38
|
+
code=Code.SCHEMA_ERROR,
|
|
39
|
+
phase=Phase.CONVERT_IFC,
|
|
40
|
+
stb_element=stb_sec_brace_s,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
return result
|
|
44
|
+
if figure.stb_sec_steel_brace_s_same_or_none is not None:
|
|
45
|
+
same: StbSecSteelBraceSSame | None = figure.stb_sec_steel_brace_s_same_or_none
|
|
46
|
+
if same:
|
|
47
|
+
shape: Shape = stb_sec_steel_name_to_shape(repo, same.shape, reporter)
|
|
48
|
+
result.append(ShapePair(shape))
|
|
49
|
+
return result
|