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,188 @@
|
|
|
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 collections.abc import Mapping
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
from enum import StrEnum
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class _DataFormat(StrEnum):
|
|
14
|
+
BUILDING_GEOMETRY = "building_geometry"
|
|
15
|
+
IFC = "ifc"
|
|
16
|
+
PLY = "ply"
|
|
17
|
+
STB = "stb"
|
|
18
|
+
STL = "stl"
|
|
19
|
+
WAVEFRONT_OBJ = "wavefront_obj"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class _DataKind(StrEnum):
|
|
23
|
+
BYTES = "bytes"
|
|
24
|
+
DICT = "dict"
|
|
25
|
+
FILE = "file"
|
|
26
|
+
OBJECT = "object"
|
|
27
|
+
TEXT = "text"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class _FileFormat(StrEnum):
|
|
31
|
+
ASCII = "ascii"
|
|
32
|
+
BINARY = "binary"
|
|
33
|
+
JSON = "json"
|
|
34
|
+
STEP = "step"
|
|
35
|
+
XML = "xml"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class _StbVersion(StrEnum):
|
|
39
|
+
LATEST = "latest"
|
|
40
|
+
UNSPECIFIED = "unspecified"
|
|
41
|
+
V2_0_0 = "2.0.0"
|
|
42
|
+
V2_0_1 = "2.0.1"
|
|
43
|
+
V2_0_2 = "2.0.2"
|
|
44
|
+
V2_1_0 = "2.1.0"
|
|
45
|
+
V2_1_1 = "2.1.1"
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@dataclass(frozen=True)
|
|
49
|
+
class _DataFormatSet:
|
|
50
|
+
format: _DataFormat
|
|
51
|
+
kind: _DataKind
|
|
52
|
+
stb_version: _StbVersion | None = None
|
|
53
|
+
file_format: _FileFormat | None = None
|
|
54
|
+
|
|
55
|
+
def __str__(self) -> str:
|
|
56
|
+
parts = [self.format, self.kind]
|
|
57
|
+
if self.stb_version is not None:
|
|
58
|
+
parts.append(self.stb_version)
|
|
59
|
+
if self.file_format is not None:
|
|
60
|
+
parts.append(self.file_format)
|
|
61
|
+
return ":".join(parts)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def _get_extension(format: _DataFormat) -> str:
|
|
65
|
+
match format:
|
|
66
|
+
case _DataFormat.IFC:
|
|
67
|
+
return ".ifc"
|
|
68
|
+
case _DataFormat.WAVEFRONT_OBJ:
|
|
69
|
+
return ".obj"
|
|
70
|
+
case _DataFormat.PLY:
|
|
71
|
+
return ".ply"
|
|
72
|
+
case _DataFormat.STB:
|
|
73
|
+
return ".stb"
|
|
74
|
+
case _DataFormat.STL:
|
|
75
|
+
return ".stl"
|
|
76
|
+
case _:
|
|
77
|
+
raise ValueError(f"サポートしていないフォーマットです: {format}")
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
@dataclass(frozen=True)
|
|
81
|
+
class _Data:
|
|
82
|
+
"""変換パイプラインで扱うDataの共通基底クラス"""
|
|
83
|
+
|
|
84
|
+
format: _DataFormat
|
|
85
|
+
kind: _DataKind
|
|
86
|
+
stb_version: _StbVersion | None
|
|
87
|
+
|
|
88
|
+
@property
|
|
89
|
+
def format_set(self) -> _DataFormatSet:
|
|
90
|
+
return _DataFormatSet(
|
|
91
|
+
format=self.format,
|
|
92
|
+
kind=self.kind,
|
|
93
|
+
stb_version=self.stb_version,
|
|
94
|
+
file_format=getattr(self, "file_format", None),
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
@dataclass(frozen=True)
|
|
99
|
+
class _SerializedData(_Data):
|
|
100
|
+
"""リアライズ済み表現の共通基底。"""
|
|
101
|
+
|
|
102
|
+
file_format: _FileFormat
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
@dataclass(frozen=True)
|
|
106
|
+
class _FileData(_SerializedData):
|
|
107
|
+
path: Path
|
|
108
|
+
encoding: str | None
|
|
109
|
+
|
|
110
|
+
def __init__(
|
|
111
|
+
self,
|
|
112
|
+
format: _DataFormat,
|
|
113
|
+
path: Path,
|
|
114
|
+
file_format: _FileFormat,
|
|
115
|
+
*,
|
|
116
|
+
stb_version: _StbVersion | None = None,
|
|
117
|
+
encoding: str | None = "utf-8",
|
|
118
|
+
) -> None:
|
|
119
|
+
object.__setattr__(self, "format", format)
|
|
120
|
+
object.__setattr__(self, "kind", _DataKind.FILE)
|
|
121
|
+
object.__setattr__(self, "file_format", file_format)
|
|
122
|
+
object.__setattr__(self, "stb_version", stb_version)
|
|
123
|
+
object.__setattr__(self, "path", path)
|
|
124
|
+
object.__setattr__(self, "encoding", encoding)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
@dataclass(frozen=True)
|
|
128
|
+
class _TextData(_SerializedData):
|
|
129
|
+
text: str
|
|
130
|
+
|
|
131
|
+
def __init__(
|
|
132
|
+
self,
|
|
133
|
+
format: _DataFormat,
|
|
134
|
+
text: str,
|
|
135
|
+
file_format: _FileFormat,
|
|
136
|
+
*,
|
|
137
|
+
stb_version: _StbVersion | None = None,
|
|
138
|
+
) -> None:
|
|
139
|
+
if file_format is _FileFormat.BINARY:
|
|
140
|
+
raise ValueError("TextDataはFileFormat.BINARYを使用できません")
|
|
141
|
+
object.__setattr__(self, "format", format)
|
|
142
|
+
object.__setattr__(self, "kind", _DataKind.TEXT)
|
|
143
|
+
object.__setattr__(self, "file_format", file_format)
|
|
144
|
+
object.__setattr__(self, "stb_version", stb_version)
|
|
145
|
+
object.__setattr__(self, "text", text)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
@dataclass(frozen=True)
|
|
149
|
+
class _BytesData(_SerializedData):
|
|
150
|
+
value: bytes
|
|
151
|
+
|
|
152
|
+
def __init__(
|
|
153
|
+
self, format: _DataFormat, value: bytes, file_format: _FileFormat
|
|
154
|
+
) -> None:
|
|
155
|
+
object.__setattr__(self, "format", format)
|
|
156
|
+
object.__setattr__(self, "kind", _DataKind.BYTES)
|
|
157
|
+
object.__setattr__(self, "file_format", file_format)
|
|
158
|
+
object.__setattr__(self, "value", value)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
@dataclass(frozen=True)
|
|
162
|
+
class _ObjectData[T](_Data):
|
|
163
|
+
value: T
|
|
164
|
+
|
|
165
|
+
def __init__(
|
|
166
|
+
self, format: _DataFormat, value: T, *, stb_version: _StbVersion | None = None
|
|
167
|
+
) -> None:
|
|
168
|
+
object.__setattr__(self, "format", format)
|
|
169
|
+
object.__setattr__(self, "kind", _DataKind.OBJECT)
|
|
170
|
+
object.__setattr__(self, "stb_version", stb_version)
|
|
171
|
+
object.__setattr__(self, "value", value)
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
@dataclass(frozen=True)
|
|
175
|
+
class _DictData(_Data):
|
|
176
|
+
value: Mapping[str, object]
|
|
177
|
+
|
|
178
|
+
def __init__(
|
|
179
|
+
self,
|
|
180
|
+
format: _DataFormat,
|
|
181
|
+
value: Mapping[str, object],
|
|
182
|
+
*,
|
|
183
|
+
stb_version: _StbVersion | None = None,
|
|
184
|
+
) -> None:
|
|
185
|
+
object.__setattr__(self, "format", format)
|
|
186
|
+
object.__setattr__(self, "kind", _DataKind.DICT)
|
|
187
|
+
object.__setattr__(self, "stb_version", stb_version)
|
|
188
|
+
object.__setattr__(self, "value", value)
|