stbkit 0.1.0b2__tar.gz → 0.1.0b4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/PKG-INFO +14 -5
  2. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/README.md +6 -1
  3. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/pyproject.toml +10 -4
  4. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/api/experimental/__init__.py +18 -1
  5. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/cli/_internal/cli_main.py +6 -0
  6. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/cli/_internal/constants_exit_code.py +2 -1
  7. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/cli/_internal/entry_points.py +1 -0
  8. stbkit-0.1.0b4/src/stbkit/cli/commands/view.py +41 -0
  9. stbkit-0.1.0b4/src/stbkit/native/__init__.py +19 -0
  10. stbkit-0.1.0b4/src/stbkit/native/_bridge.py +88 -0
  11. stbkit-0.1.0b4/src/stbkit/native/_stb_viewer.py +170 -0
  12. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/data_model/building_geometry.py +30 -45
  13. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/data_model/building_geometry_web.py +6 -4
  14. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/optional_dependencies/ifc_exporter/ifc_entity_exporter.py +1 -1
  15. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/optional_dependencies/ifc_to_building_geometry.py +9 -12
  16. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/studio_report.py +1 -2
  17. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/element_data_to_building_geometry.py +17 -7
  18. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/pipeline/execution.py +1 -1
  19. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/_stb_latest_to_element_data.py +4 -1
  20. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/member/member_footing.py +7 -1
  21. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/member/member_line.py +6 -2
  22. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/member/member_pile.py +6 -1
  23. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/member/member_plane.py +7 -1
  24. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec.py +7 -1
  25. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_beam_s.py +7 -1
  26. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_beam_src.py +7 -1
  27. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_brace_s.py +7 -1
  28. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_column_cft.py +7 -1
  29. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_column_s.py +7 -1
  30. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_column_src.py +6 -1
  31. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_steel.py +7 -1
  32. stbkit-0.1.0b4/src/stbkit/tools/py.typed +0 -0
  33. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit.egg-info/PKG-INFO +14 -5
  34. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit.egg-info/SOURCES.txt +5 -0
  35. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit.egg-info/requires.txt +5 -1
  36. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/LICENSE +0 -0
  37. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/setup.cfg +0 -0
  38. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/__main__.py +0 -0
  39. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/api/__init__.py +0 -0
  40. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/api/experimental/repository/__init__.py +0 -0
  41. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/api/py.typed +0 -0
  42. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/api/stb_latest.py +0 -0
  43. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/api/stb_v2_0_2.py +0 -0
  44. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/api/stb_v2_1_1.py +0 -0
  45. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/cli/__init__.py +0 -0
  46. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/cli/_internal/common.py +0 -0
  47. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/cli/_internal/converter.py +0 -0
  48. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/cli/_internal/diff.py +0 -0
  49. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/cli/_internal/global_parent.py +0 -0
  50. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/cli/_internal/show_versions.py +0 -0
  51. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/cli/_internal/summary.py +0 -0
  52. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/cli/_internal/validate.py +0 -0
  53. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/cli/commands/convert.py +0 -0
  54. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/cli/commands/diff.py +0 -0
  55. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/cli/commands/summary.py +0 -0
  56. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/cli/commands/upgrade.py +0 -0
  57. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/cli/commands/validate.py +0 -0
  58. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/cli/py.typed +0 -0
  59. {stbkit-0.1.0b2/src/stbkit/tools → stbkit-0.1.0b4/src/stbkit/native}/py.typed +0 -0
  60. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/__init__.py +0 -0
  61. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/__init__.py +0 -0
  62. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/constants.py +0 -0
  63. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/data_model/element_data.py +0 -0
  64. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/data_model/ifc_data/entity_data.py +0 -0
  65. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/data_model/ifc_data/entity_names.py +0 -0
  66. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/data_model/shape_data.py +0 -0
  67. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/data_model/summary.py +0 -0
  68. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/diff/__init__.py +0 -0
  69. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/diff/common.py +0 -0
  70. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/diff/diff_xml.py +0 -0
  71. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/matrix.py +0 -0
  72. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/optional_dependencies/__init__.py +0 -0
  73. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/optional_dependencies/ifc_common.py +0 -0
  74. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/optional_dependencies/ifc_exporter/ifc_profile_exporter.py +0 -0
  75. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/optional_dependencies/ifc_exporter/ifc_representation_exporter.py +0 -0
  76. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/optional_dependencies/ifc_pipeline.py +0 -0
  77. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/stb_io.py +0 -0
  78. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/stb_repair/_common.py +0 -0
  79. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/stb_repair/_stb_repair.py +0 -0
  80. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/stb_repair/_stb_v2_0_2_repair.py +0 -0
  81. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/stb_repair/_stb_v2_1_0_repair.py +0 -0
  82. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/stb_repair/_stb_v2_1_1_repair.py +0 -0
  83. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/utils/atomic_writer.py +0 -0
  84. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/utils/float_rounding.py +0 -0
  85. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/utils/girder_utils.py +0 -0
  86. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/utils/guid_utils.py +0 -0
  87. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/utils/mesh_utils.py +0 -0
  88. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/utils/node_utils.py +0 -0
  89. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/utils/unit_utils.py +0 -0
  90. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/_internal/vectors.py +0 -0
  91. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/__init__.py +0 -0
  92. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/__init__.py +0 -0
  93. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/building_geometry_to_ply_text.py +0 -0
  94. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/coord_converter.py +0 -0
  95. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/ifc_to_ply_text.py +0 -0
  96. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/name_converter.py +0 -0
  97. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/pipeline/__init__.py +0 -0
  98. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/pipeline/data.py +0 -0
  99. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/pipeline/ply_pipeline.py +0 -0
  100. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/pipeline/stb_pipeline.py +0 -0
  101. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/pipeline/stb_pipeline_latest.py +0 -0
  102. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/pipeline/step.py +0 -0
  103. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/__init__.py +0 -0
  104. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/open.py +0 -0
  105. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_beam_rc.py +0 -0
  106. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_column_rc.py +0 -0
  107. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_foundation.py +0 -0
  108. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_parapet_rc.py +0 -0
  109. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_pile_rc.py +0 -0
  110. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_latest_to_element_data/section/sec_pile_s.py +0 -0
  111. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_to_building_geometry.py +0 -0
  112. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_to_ifc_data/__init__.py +0 -0
  113. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_to_ifc_data/_stb_to_ifc_data.py +0 -0
  114. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_to_ifc_data/convert_option.py +0 -0
  115. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/converters/_internal/stb_to_ply_text.py +0 -0
  116. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/__init__.py +0 -0
  117. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/__init__.py +0 -0
  118. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/common.py +0 -0
  119. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/upgrade.py +0 -0
  120. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/__init__.py +0 -0
  121. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_common.py +0 -0
  122. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_joint_beam_shape_h.py +0 -0
  123. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_sec_pile_rc.py +0 -0
  124. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_sec_pile_s.py +0 -0
  125. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_sec_slab_deck.py +0 -0
  126. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/hook_sec_slab_rc.py +0 -0
  127. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/post_girder.py +0 -0
  128. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/post_open.py +0 -0
  129. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/post_sec_beam_rc.py +0 -0
  130. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hook_funcs/post_sec_beam_s.py +0 -0
  131. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/hooks.py +0 -0
  132. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/post.py +0 -0
  133. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/v2_0_2_to_v2_1_0/tables.py +0 -0
  134. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/v2_1_0_to_v2_1_1/__init__.py +0 -0
  135. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/v2_1_0_to_v2_1_1/hooks.py +0 -0
  136. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit/tools/upgrade/_internal/v2_1_0_to_v2_1_1/tables.py +0 -0
  137. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit.egg-info/dependency_links.txt +0 -0
  138. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit.egg-info/entry_points.txt +0 -0
  139. {stbkit-0.1.0b2 → stbkit-0.1.0b4}/src/stbkit.egg-info/top_level.txt +0 -0
@@ -1,14 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stbkit
3
- Version: 0.1.0b2
3
+ Version: 0.1.0b4
4
4
  Summary: ST-Bridgeを扱うライブラリSTB-KIT
5
5
  Author-email: "STB-KIT Development Team (TAISEI CORPORATION)" <oss-dev@pub.taisei.co.jp>
6
6
  License-Expression: MPL-2.0
7
- Project-URL: Homepage, https://github.com/taisei-oss/stb-kit
7
+ Project-URL: Homepage, https://taisei-oss.github.io/stb-kit/
8
8
  Project-URL: Repository, https://github.com/taisei-oss/stb-kit
9
9
  Project-URL: Issues, https://github.com/taisei-oss/stb-kit/issues
10
10
  Project-URL: Changelog, https://github.com/taisei-oss/stb-kit/blob/main/CHANGELOG.md
11
- Keywords: ST-Bridge,BIM,IFC,structural-engineering,stbridge
11
+ Keywords: ST-Bridge,BIM,building,IFC,structural-engineering,stbridge
12
12
  Classifier: Development Status :: 4 - Beta
13
13
  Classifier: Environment :: Console
14
14
  Classifier: Intended Audience :: Developers
@@ -19,6 +19,7 @@ Classifier: Programming Language :: Python :: 3
19
19
  Classifier: Programming Language :: Python :: 3.12
20
20
  Classifier: Programming Language :: Python :: 3.13
21
21
  Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Programming Language :: Python :: 3.15
22
23
  Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
23
24
  Classifier: Topic :: Scientific/Engineering
24
25
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
@@ -27,16 +28,19 @@ Classifier: Typing :: Typed
27
28
  Requires-Python: >=3.12
28
29
  Description-Content-Type: text/markdown
29
30
  License-File: LICENSE
30
- Requires-Dist: stbkit-core==0.1.0b2
31
+ Requires-Dist: stbkit-core==0.1.0b4
31
32
  Provides-Extra: xsd
32
33
  Requires-Dist: xmlschema>=4.3.2; extra == "xsd"
33
34
  Provides-Extra: ifc
34
35
  Requires-Dist: ifcopenshell>=0.8.5; extra == "ifc"
35
36
  Requires-Dist: numpy; extra == "ifc"
37
+ Provides-Extra: native
38
+ Requires-Dist: stbkit-native==0.1.0b4; extra == "native"
36
39
  Provides-Extra: full
37
40
  Requires-Dist: ifcopenshell>=0.8.5; extra == "full"
38
41
  Requires-Dist: numpy; extra == "full"
39
42
  Requires-Dist: xmlschema>=4.3.2; extra == "full"
43
+ Requires-Dist: stbkit-native==0.1.0b4; extra == "full"
40
44
  Dynamic: license-file
41
45
 
42
46
  # stbkit
@@ -89,7 +93,12 @@ python -m pip install --pre stbkit
89
93
  ```bash
90
94
  python -m pip install --pre "stbkit[xsd]"
91
95
  ```
92
- - `full` : 全機能を利用する場合に必要です(xsd, ifc を含む)。
96
+ - `native` : 3Dビュー機能を利用する場合に必要です。
97
+ インストール方法:
98
+ ```bash
99
+ python -m pip install --pre "stbkit[native]"
100
+ ```
101
+ - `full` : 全機能を利用する場合に必要です(xsd, ifc, native を含む)。
93
102
  インストール方法:
94
103
  ```bash
95
104
  python -m pip install --pre "stbkit[full]"
@@ -48,7 +48,12 @@ python -m pip install --pre stbkit
48
48
  ```bash
49
49
  python -m pip install --pre "stbkit[xsd]"
50
50
  ```
51
- - `full` : 全機能を利用する場合に必要です(xsd, ifc を含む)。
51
+ - `native` : 3Dビュー機能を利用する場合に必要です。
52
+ インストール方法:
53
+ ```bash
54
+ python -m pip install --pre "stbkit[native]"
55
+ ```
56
+ - `full` : 全機能を利用する場合に必要です(xsd, ifc, native を含む)。
52
57
  インストール方法:
53
58
  ```bash
54
59
  python -m pip install --pre "stbkit[full]"
@@ -10,17 +10,17 @@ build-backend = "setuptools.build_meta"
10
10
 
11
11
  [project]
12
12
  name = "stbkit"
13
- version = "0.1.0b2"
13
+ version = "0.1.0b4"
14
14
  description = "ST-Bridgeを扱うライブラリSTB-KIT"
15
15
  authors = [
16
16
  { name = "STB-KIT Development Team (TAISEI CORPORATION)", email = "oss-dev@pub.taisei.co.jp" },
17
17
  ]
18
- dependencies = ["stbkit-core==0.1.0b2"]
18
+ dependencies = ["stbkit-core==0.1.0b4"]
19
19
  readme = "README.md"
20
20
  requires-python = ">=3.12"
21
21
  license = "MPL-2.0"
22
22
  license-files = ["LICENSE"]
23
- keywords = ["ST-Bridge", "BIM", "IFC", "structural-engineering", "stbridge"]
23
+ keywords = ["ST-Bridge", "BIM", "building", "IFC", "structural-engineering", "stbridge"]
24
24
  classifiers = [
25
25
  "Development Status :: 4 - Beta",
26
26
  "Environment :: Console",
@@ -32,6 +32,7 @@ classifiers = [
32
32
  "Programming Language :: Python :: 3.12",
33
33
  "Programming Language :: Python :: 3.13",
34
34
  "Programming Language :: Python :: 3.14",
35
+ "Programming Language :: Python :: 3.15",
35
36
  "Topic :: Multimedia :: Graphics :: 3D Modeling",
36
37
  "Topic :: Scientific/Engineering",
37
38
  "Topic :: Software Development :: Libraries :: Python Modules",
@@ -40,7 +41,7 @@ classifiers = [
40
41
  ]
41
42
 
42
43
  [project.urls]
43
- Homepage = "https://github.com/taisei-oss/stb-kit"
44
+ Homepage = "https://taisei-oss.github.io/stb-kit/"
44
45
  Repository = "https://github.com/taisei-oss/stb-kit"
45
46
  Issues = "https://github.com/taisei-oss/stb-kit/issues"
46
47
  Changelog = "https://github.com/taisei-oss/stb-kit/blob/main/CHANGELOG.md"
@@ -61,10 +62,14 @@ ifc = [
61
62
  "ifcopenshell>=0.8.5",
62
63
  "numpy"
63
64
  ]
65
+ native = [
66
+ "stbkit-native==0.1.0b4"
67
+ ]
64
68
  full = [
65
69
  "ifcopenshell>=0.8.5",
66
70
  "numpy",
67
71
  "xmlschema>=4.3.2",
72
+ "stbkit-native==0.1.0b4"
68
73
  ]
69
74
 
70
75
  [tool.ruff]
@@ -79,4 +84,5 @@ extend = "../../pyproject.toml"
79
84
  exclude = [
80
85
  "src/stbkit/cli/_internal/entry_points.py",
81
86
  "src/stbkit/cli/_internal/diff.py",
87
+ "src/stbkit/native/_bridge.py",
82
88
  ]
@@ -15,5 +15,22 @@
15
15
  from stbkit.core.repository import get_repository as get_repository
16
16
  from stbkit.core.serialization import from_dict as from_dict
17
17
  from stbkit.core.serialization import to_dict as to_dict
18
+ from stbkit.core.stb_exceptions import (
19
+ ReferenceElementNotFoundError as ReferenceElementNotFoundError,
20
+ )
21
+ from stbkit.core.stb_reporting import CollectingReporter as CollectingReporter
22
+ from stbkit.core.stb_reporting import Reporter as Reporter
23
+ from stbkit.core.stb_reporting import ReportingResult as ReportingResult
18
24
 
19
- __all__ = ["from_dict", "get_repository", "to_dict"]
25
+ from stbkit.native import view as view
26
+
27
+ __all__ = [
28
+ "CollectingReporter",
29
+ "ReferenceElementNotFoundError",
30
+ "Reporter",
31
+ "ReportingResult",
32
+ "from_dict",
33
+ "get_repository",
34
+ "to_dict",
35
+ "view",
36
+ ]
@@ -12,10 +12,13 @@ from argparse import ArgumentParser, Namespace, _SubParsersAction
12
12
  from importlib import metadata
13
13
  from typing import Any, Never
14
14
 
15
+ from stbkit.core.stb_exceptions import MissingOptionalDependencyError
16
+
15
17
  from .constants_exit_code import (
16
18
  EXIT_EXECUTION_ERROR,
17
19
  EXIT_INTERRUPTED,
18
20
  EXIT_INVALID_ARGUMENT,
21
+ EXIT_OPTIONAL_DEPENDENCY_MISSING,
19
22
  )
20
23
  from .entry_points import load_command_entry_points
21
24
  from .global_parent import make_global_parent
@@ -50,6 +53,9 @@ def main() -> None:
50
53
  except KeyboardInterrupt:
51
54
  # Ctrl+Cによる中断。
52
55
  raise SystemExit(EXIT_INTERRUPTED) from None
56
+ except MissingOptionalDependencyError as error:
57
+ print(str(error), file=sys.stderr)
58
+ raise SystemExit(EXIT_OPTIONAL_DEPENDENCY_MISSING) from None
53
59
  except Exception: # noqa: BLE001
54
60
  # 終了コードを変更するための最後の受け皿なので種類を問わずキャッチする。
55
61
  traceback.print_exc()
@@ -47,7 +47,8 @@ EXIT_EXECUTION_ERROR: Final[int] = 3
47
47
  EXIT_OPTIONAL_DEPENDENCY_MISSING: Final[int] = 4
48
48
  """オプション依存パッケージがなく、処理を実行できなかった。
49
49
 
50
- ifcopenshellやxmlschemaを必要とする処理を指定したのにインストールされていない場合。
50
+ ifcopenshell、xmlschema、stbkit-nativeを必要とする処理を指定したのに
51
+ インストールされていない場合。
51
52
  利用者の環境によって結果が変わるため、EXIT_EXECUTION_ERRORとは分ける。
52
53
  """
53
54
 
@@ -17,6 +17,7 @@ BUILTIN_COMMANDS: Final[dict[str, str]] = {
17
17
  "summary": "stbkit.cli.commands.summary:register",
18
18
  "upgrade": "stbkit.cli.commands.upgrade:register",
19
19
  "validate": "stbkit.cli.commands.validate:register",
20
+ "view": "stbkit.cli.commands.view:register",
20
21
  }
21
22
 
22
23
 
@@ -0,0 +1,41 @@
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 __future__ import annotations
8
+
9
+ from argparse import ArgumentParser, Namespace, _SubParsersAction
10
+ from pathlib import Path
11
+ from typing import Any
12
+
13
+ from stbkit.cli._internal.global_parent import (
14
+ get_logger,
15
+ get_max_size,
16
+ make_global_parent,
17
+ )
18
+
19
+
20
+ def _run_view(args: Namespace) -> None:
21
+ from stbkit.native import view
22
+ from stbkit.tools._internal.stb_io import load_latest
23
+
24
+ path: Path = args.path
25
+ logger = get_logger(args)
26
+ stb = load_latest(path, max_size=get_max_size(args), logger=logger)
27
+ view(stb, logger=logger)
28
+
29
+
30
+ def register(subparsers: _SubParsersAction[Any]) -> None:
31
+ parser: ArgumentParser = subparsers.add_parser(
32
+ "view",
33
+ parents=[make_global_parent()],
34
+ help="ST-Bridgeを3D表示",
35
+ )
36
+ parser.add_argument(
37
+ "path",
38
+ type=Path,
39
+ help="表示するST-Bridgeファイル",
40
+ )
41
+ parser.set_defaults(func=_run_view)
@@ -0,0 +1,19 @@
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
+ """stbkit-nativeの呼び出しをするモジュール。
8
+
9
+ Rust拡張は任意依存のstbkit-nativeが提供します。
10
+ 未インストールの場合、MissingOptionalDependencyErrorを投げます。
11
+ """
12
+
13
+ from ._stb_viewer import ElementClickCallback, ElementClickEvent, view
14
+
15
+ __all__ = [
16
+ "ElementClickCallback",
17
+ "ElementClickEvent",
18
+ "view",
19
+ ]
@@ -0,0 +1,88 @@
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 Callable
8
+ from importlib import import_module
9
+ from types import ModuleType
10
+ from typing import Final, Never, Protocol, TypedDict, runtime_checkable
11
+
12
+ from stbkit.core.stb_exceptions import MissingOptionalDependencyError
13
+
14
+ from stbkit.tools._internal.data_model.building_geometry import BuildingGeometry
15
+
16
+ _NATIVE_PACKAGE_NAME_SPACE: Final = "stbkit._native"
17
+ _NATIVE_MODULE_NAME: Final = f"{_NATIVE_PACKAGE_NAME_SPACE}.stbkit_native_rs"
18
+
19
+
20
+ class ElementClickEventDict(TypedDict):
21
+ """Rustから受け取るクリックイベントデータ"""
22
+
23
+ element_index: int
24
+ kind: int
25
+ guid: str | None
26
+ xpath: str | None
27
+ name: str | None
28
+ source_type: str
29
+ source_id: str | None
30
+
31
+
32
+ @runtime_checkable
33
+ class _NativeBackend(Protocol):
34
+ """Rust拡張が公開している関数のインターフェース"""
35
+
36
+ def _run_viewer(
37
+ self,
38
+ building_geometry: BuildingGeometry,
39
+ on_element_click: Callable[[ElementClickEventDict], None] | None = None,
40
+ ) -> None: ...
41
+
42
+ def _raise_missing_native(error: ModuleNotFoundError) -> Never:
43
+ """任意依存がない場合の処理"""
44
+
45
+ raise MissingOptionalDependencyError(
46
+ package_name="stbkit-native",
47
+ install_command='python -m pip install --pre "stbkit[native]"',
48
+ ) from error
49
+
50
+
51
+ def _raise_unloadable_native(error: ImportError | OSError) -> Never:
52
+ """Rust拡張をロードできない場合の処理"""
53
+
54
+ raise RuntimeError(
55
+ "stbkit-nativeのRust拡張を読み込めませんでした。"
56
+ "Pythonのバージョン、CPUアーキテクチャ、および"
57
+ "stbkitとstbkit-nativeのバージョンを確認してください。"
58
+ ) from error
59
+
60
+
61
+ def _load_native_backend() -> _NativeBackend:
62
+ """Rust拡張を遅延読み込みする。"""
63
+
64
+ try:
65
+ module: ModuleType = import_module(_NATIVE_MODULE_NAME)
66
+ except ModuleNotFoundError as error:
67
+ if error.name in {_NATIVE_PACKAGE_NAME_SPACE, _NATIVE_MODULE_NAME}:
68
+ _raise_missing_native(error)
69
+ _raise_unloadable_native(error)
70
+ except (ImportError, OSError) as error:
71
+ _raise_unloadable_native(error)
72
+
73
+ if not isinstance(module, _NativeBackend):
74
+ raise TypeError(
75
+ "stbkit-nativeのAPIに互換性がありません。"
76
+ "stbkitとstbkit-nativeを最新版に更新してください。"
77
+ )
78
+ return module
79
+
80
+
81
+ def run_viewer(
82
+ building_geometry: BuildingGeometry,
83
+ on_element_click: Callable[[ElementClickEventDict], None] | None = None,
84
+ ) -> None:
85
+ backend: _NativeBackend = _load_native_backend()
86
+ backend._run_viewer(building_geometry, on_element_click)
87
+
88
+
@@ -0,0 +1,170 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Callable
4
+ from dataclasses import dataclass
5
+ from logging import Logger
6
+ from uuid import UUID
7
+
8
+ from stbkit.core.data_model.common import StBridgeElement, StBridgeRoot
9
+ from stbkit.core.repository import RepositoryBase, get_repository
10
+ from stbkit.core.serialization import to_dict
11
+ from stbkit.core.stb_reporting import Reporter, get_reporter
12
+
13
+ from stbkit.api import upgrade_to_latest
14
+ from stbkit.api.stb_latest import StBridge
15
+ from stbkit.tools._internal.data_model.building_geometry import BuildingGeometry
16
+ from stbkit.tools.converters._internal.stb_to_building_geometry import (
17
+ stb_to_building_geometry,
18
+ )
19
+
20
+ from . import _bridge
21
+
22
+
23
+ @dataclass(frozen=True, slots=True)
24
+ class ElementClickEvent:
25
+ """3Dビューでクリックされた1要素の情報。
26
+
27
+ Attributes:
28
+ element_index: 3D表示データ内での要素の通し番号。
29
+ kind: 柱・大梁などの部材種別を表す番号。ElementKindの値。
30
+ guid: 要素のGUID。持たない要素や取得できなかった場合はNone。
31
+ xpath: 生成元での要素のXPath。取得できなかった場合None。
32
+ name: 要素につけている名前(内部実装)
33
+ source_type: 生成元での要素名。"StbColumn"のような文字列。
34
+ source_id: 生成元での要素のID。持たない要素の場合はNone。
35
+ """
36
+
37
+ element_index: int
38
+ kind: int
39
+ guid: str | None
40
+ xpath: str | None
41
+ name: str | None
42
+ source_type: str
43
+ source_id: str | None
44
+
45
+ @classmethod
46
+ def from_payload(cls, payload: _bridge.ElementClickEventDict) -> ElementClickEvent:
47
+ """Rustの辞書形式から型付きイベントを作成する。"""
48
+
49
+ return cls(
50
+ element_index=payload["element_index"],
51
+ kind=payload["kind"],
52
+ guid=payload["guid"],
53
+ xpath=payload["xpath"],
54
+ name=payload["name"],
55
+ source_type=payload["source_type"],
56
+ source_id=payload["source_id"],
57
+ )
58
+
59
+
60
+ type ElementClickCallback = Callable[[ElementClickEvent], None]
61
+ """3Dビューで要素がクリックされたときに呼び出す関数の型。"""
62
+
63
+
64
+ def _element_click_dispatcher(
65
+ callback: ElementClickCallback,
66
+ ) -> Callable[[_bridge.ElementClickEventDict], None]:
67
+ """Rustの転送辞書を型付きイベントへ変換するコールバックを作成する。"""
68
+
69
+ def dispatch(payload: _bridge.ElementClickEventDict) -> None:
70
+ callback(ElementClickEvent.from_payload(payload))
71
+
72
+ return dispatch
73
+
74
+
75
+ def _view_building_geometry(
76
+ building_geometry: BuildingGeometry,
77
+ *,
78
+ on_element_click: ElementClickCallback | None = None,
79
+ ) -> None:
80
+
81
+ raw_callback: Callable[[_bridge.ElementClickEventDict], None] | None = (
82
+ _element_click_dispatcher(on_element_click)
83
+ if on_element_click is not None
84
+ else None
85
+ )
86
+ _bridge.run_viewer(building_geometry, raw_callback)
87
+
88
+
89
+ def _print_dict(d: dict[str, object], indent_lebel: int = 0) -> None:
90
+ indent = " " * indent_lebel
91
+ for key, value in d.items():
92
+ if value is None:
93
+ continue
94
+ elif isinstance(value, list):
95
+ if not value:
96
+ continue
97
+ elif isinstance(value[0], dict):
98
+ for i, item in enumerate(value):
99
+ print(f"{indent}{key}[{i}]:")
100
+ _print_dict(item, indent_lebel=indent_lebel + 2)
101
+ continue
102
+ else:
103
+ print(f"{indent}{key}: {value}")
104
+ elif isinstance(value, dict):
105
+ print(f"{indent}{key}:")
106
+ _print_dict(value, indent_lebel=indent_lebel + 2)
107
+ else:
108
+ print(f"{indent}{key}: {value}")
109
+
110
+
111
+ def _print_element_click(
112
+ event: ElementClickEvent, stb: StBridgeRoot, repo: RepositoryBase
113
+ ) -> None:
114
+ """クリックされた要素情報を標準出力へ表示する。"""
115
+ print(f"要素: {event.source_type}")
116
+ guid = event.guid
117
+ if not guid:
118
+ print(
119
+ "guidが設定されていません。guidを設定された部材は部材情報を表示できます。"
120
+ )
121
+ else:
122
+ element: StBridgeElement | None = repo.get_by_guid_or_none(UUID(guid))
123
+ if element is None:
124
+ print("guidに対応する要素が見つかりません。")
125
+ else:
126
+ _print_dict(to_dict(element), indent_lebel=2)
127
+
128
+
129
+ def view(
130
+ stb: StBridgeRoot,
131
+ *,
132
+ logger: Logger | None = None,
133
+ reporter: Reporter | None = None,
134
+ on_element_click: ElementClickCallback | None = None,
135
+ ) -> None:
136
+ """ST-Bridgeを3Dビューアで表示します。
137
+
138
+ ウィンドウを閉じるまで戻りません。
139
+
140
+ Args:
141
+ stb: 表示するST-Bridgeのルート要素。
142
+ on_element_click: 要素がクリックされたときに呼び出す関数。
143
+
144
+ Raises:
145
+ RuntimeError: 任意依存のstbkit-nativeが未インストール、または
146
+ Rust拡張を読み込めない場合。
147
+ TypeError: stbkit-nativeのAPIがこのstbkitと互換でない場合。
148
+
149
+ Examples:
150
+ >>> import stbkit.api
151
+ >>> import stbkit.api.experimental
152
+ >>> stb = stbkit.api.load("model.stb")
153
+ >>> stbkit.api.experimental.view(stb)
154
+ """
155
+ reporter = get_reporter(logger, reporter)
156
+ upgraded_stb: StBridge = upgrade_to_latest(stb, reporter=reporter)
157
+ repo: RepositoryBase = get_repository(upgraded_stb)
158
+
159
+ def print_element_click(event: ElementClickEvent) -> None:
160
+ _print_element_click(event, stb=upgraded_stb, repo=repo)
161
+
162
+ building_geometry: BuildingGeometry = stb_to_building_geometry(
163
+ upgraded_stb, reporter=reporter
164
+ )
165
+ if on_element_click is None:
166
+ on_element_click = print_element_click
167
+ _view_building_geometry(
168
+ building_geometry,
169
+ on_element_click=on_element_click,
170
+ )
@@ -17,6 +17,8 @@ UINT32_NONE = 0xFFFF_FFFF
17
17
  """u32列で参照なし表す値。Rustのu32::MAXと一致させる。"""
18
18
 
19
19
  _GUID_SIZE = 16
20
+ _UUID_NONE: UUID = UUID(int=(1 << 128) - 1)
21
+ """UUIDが未設定であることを表す特殊値。すべてF"""
20
22
 
21
23
  # 処理系依存対策
22
24
  if array("f").itemsize != 4:
@@ -41,6 +43,10 @@ def _new_u32_array() -> array[int]:
41
43
  return array("I")
42
44
 
43
45
 
46
+ def _new_uuid_array() -> array[int]:
47
+ return array("B")
48
+
49
+
44
50
  def _new_offsets_array() -> array[int]:
45
51
  # データの範囲をoffsets[i]:offsets[i + 1] で求めるため、
46
52
  # 要素が0個でも先頭の0を作っておく。
@@ -105,48 +111,27 @@ class SurfaceLoopType(IntEnum):
105
111
  HOLE = 1
106
112
 
107
113
 
108
- @dataclass(slots=True)
109
- class OptionalUuidColumn:
110
- """UUID | Noneを、固定長bytearrayと有効フラグで保持する"""
114
+ def _uuid_to_bytes(value: UUID | str | None) -> bytes:
115
+ if value is None:
116
+ return _UUID_NONE.bytes
117
+ uuid_value: UUID = value if isinstance(value, UUID) else UUID(value)
118
+ return uuid_value.bytes
111
119
 
112
- data: bytearray = field(default_factory=bytearray, repr=False)
113
- """要素[i]のUUIDをdata[i * 16:(i + 1) * 16]に格納"""
114
- valid: bytearray = field(default_factory=bytearray, repr=False)
115
- """0:None, 1:UUIDあり"""
116
120
 
117
- def __len__(self) -> int:
118
- return len(self.valid)
121
+ def _uuid_at(column: array[int], index: int) -> UUID | None:
122
+ if not 0 <= index < len(column) // _GUID_SIZE:
123
+ raise IndexError(index)
124
+ start: int = index * _GUID_SIZE
125
+ value: UUID = UUID(bytes=bytes(column[start : start + _GUID_SIZE]))
126
+ return None if value == _UUID_NONE else value
119
127
 
120
- def append(self, value: UUID | str | None) -> None:
121
- if value is None:
122
- # 固定長を維持するため、Noneでもメモリを確保する
123
- self.data.extend(b"\x00" * _GUID_SIZE)
124
- self.valid.append(0)
125
- return
126
- uuid_value: UUID = value if isinstance(value, UUID) else UUID(value)
127
- self.data.extend(uuid_value.bytes)
128
- self.valid.append(1)
129
-
130
- def get(self, index: int) -> UUID | None:
131
- if not 0 <= index < len(self):
132
- raise IndexError(index)
133
- if self.valid[index] == 0:
134
- return None
135
- start: int = index * _GUID_SIZE
136
- return UUID(bytes=bytes(self.data[start : start + _GUID_SIZE]))
137
128
 
138
- def validate(self, expected_count: int | None = None) -> None:
139
- if len(self.data) != len(self.valid) * _GUID_SIZE:
140
- raise ValueError(
141
- "UUIDを格納推している配列サイズが不正です: "
142
- f"{len(self.data)} != {len(self.valid) * _GUID_SIZE}"
143
- )
144
- if expected_count is not None and len(self) != expected_count:
145
- raise ValueError(
146
- f"UUIDの数が不正です: expect={expected_count}, actual={len(self)}"
147
- )
148
- if any(value not in (0, 1) for value in self.valid):
149
- raise ValueError("UUID valid フラグは0か1でなければなりません")
129
+ def _validate_uuid_array(column: array[int], expected_count: int) -> None:
130
+ if column.typecode != "B" or len(column) != expected_count * _GUID_SIZE:
131
+ raise ValueError(
132
+ "UUID列はarray('B')で、長さはUUID数 * 16である必要があります: "
133
+ f"expect={expected_count * _GUID_SIZE}, actual={len(column)}"
134
+ )
150
135
 
151
136
 
152
137
  @dataclass(frozen=True, slots=True)
@@ -469,7 +454,7 @@ class Node:
469
454
  class NodeTable:
470
455
  positions_xyz: array[float] = field(default_factory=_new_f64_array, repr=False)
471
456
  source_id: list[str] = field(default_factory=list, repr=False)
472
- guid: OptionalUuidColumn = field(default_factory=OptionalUuidColumn)
457
+ guid: array[int] = field(default_factory=_new_uuid_array, repr=False)
473
458
  story_index: array[int] = field(default_factory=_new_u32_array, repr=False)
474
459
  xpath: list[str | None] = field(default_factory=list, repr=False)
475
460
 
@@ -488,7 +473,7 @@ class NodeTable:
488
473
  index: int = len(self)
489
474
  self.positions_xyz.extend(_vector3(position, name="node position"))
490
475
  self.source_id.append(source_id)
491
- self.guid.append(guid)
476
+ self.guid.extend(_uuid_to_bytes(guid))
492
477
  # u32列ではNone直接保持できないため、UINT32_NONEとして持たせる。
493
478
  self.story_index.append(
494
479
  UINT32_NONE if story_index is None else int(story_index)
@@ -508,7 +493,7 @@ class NodeTable:
508
493
  float(self.positions_xyz[offset + 2]),
509
494
  ),
510
495
  source_id=self.source_id[index],
511
- guid=self.guid.get(index),
496
+ guid=_uuid_at(self.guid, index),
512
497
  story_index=None if raw_story == UINT32_NONE else int(raw_story),
513
498
  xpath=self.xpath[index],
514
499
  )
@@ -517,7 +502,7 @@ class NodeTable:
517
502
  count: int = len(self)
518
503
  if len(self.positions_xyz) != count * 3:
519
504
  raise ValueError("node positionsの長さはnode数 * 3と一致する必要があります")
520
- self.guid.validate(count)
505
+ _validate_uuid_array(self.guid, count)
521
506
  if len(self.story_index) != count:
522
507
  raise ValueError("node story_index数はnode数と一致する必要があります")
523
508
  if len(self.xpath) != count:
@@ -673,7 +658,7 @@ class ElementTable:
673
658
  story_start: array[int] = field(default_factory=_new_u32_array, repr=False)
674
659
  story_count: array[int] = field(default_factory=_new_u32_array, repr=False)
675
660
 
676
- guid: OptionalUuidColumn = field(default_factory=OptionalUuidColumn)
661
+ guid: array[int] = field(default_factory=_new_uuid_array, repr=False)
677
662
  xpath: list[str | None] = field(default_factory=list, repr=False)
678
663
  name: list[str | None] = field(default_factory=list, repr=False)
679
664
  source_type: list[str] = field(default_factory=list, repr=False)
@@ -713,7 +698,7 @@ class ElementTable:
713
698
  self.story_start.append(UINT32_NONE)
714
699
  self.story_count.append(0)
715
700
 
716
- self.guid.append(guid)
701
+ self.guid.extend(_uuid_to_bytes(guid))
717
702
  self.xpath.append(xpath)
718
703
  self.name.append(name)
719
704
  self.source_type.append(source_type)
@@ -758,7 +743,7 @@ class ElementTable:
758
743
  f"element列 {name!r} の長さは {count} である必要があります: "
759
744
  f"actual={len(column)}"
760
745
  )
761
- self.guid.validate(count)
746
+ _validate_uuid_array(self.guid, count)
762
747
  for value in self.kind:
763
748
  ElementKind(value)
764
749