icadkit 0.3.14__tar.gz → 0.3.16__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 (156) hide show
  1. {icadkit-0.3.14 → icadkit-0.3.16}/Cargo.lock +4 -4
  2. {icadkit-0.3.14 → icadkit-0.3.16}/Cargo.toml +2 -2
  3. {icadkit-0.3.14 → icadkit-0.3.16}/LICENSES/rust-dependencies.txt +1 -1
  4. {icadkit-0.3.14 → icadkit-0.3.16}/PKG-INFO +2 -2
  5. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/LICENSE +1 -1
  6. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/src/parts.rs +29 -26
  7. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-python/LICENSE +1 -1
  8. {icadkit-0.3.14 → icadkit-0.3.16}/docs/changelog.md +48 -0
  9. {icadkit-0.3.14 → icadkit-0.3.16}/docs/parts.md +19 -9
  10. {icadkit-0.3.14 → icadkit-0.3.16}/docs/saved-bodies.md +6 -2
  11. {icadkit-0.3.14 → icadkit-0.3.16}/docs/support.md +4 -3
  12. {icadkit-0.3.14 → icadkit-0.3.16}/pyproject.toml +1 -1
  13. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/_csg_occt.py +75 -16
  14. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/_saved_occt.py +41 -13
  15. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/_shape_occt.py +14 -0
  16. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/shape.py +37 -11
  17. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_followup_parts.py +72 -0
  18. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_legacy_parts.py +44 -5
  19. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_preview.py +6 -6
  20. icadkit-0.3.16/tests/test_v8l4_parts.py +272 -0
  21. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_v8l4_saved.py +52 -3
  22. {icadkit-0.3.14 → icadkit-0.3.16}/uv.lock +7 -7
  23. icadkit-0.3.14/tests/test_v8l4_parts.py +0 -145
  24. {icadkit-0.3.14 → icadkit-0.3.16}/COMMERCIAL-LICENSE.md +0 -0
  25. {icadkit-0.3.14 → icadkit-0.3.16}/LICENSE +0 -0
  26. {icadkit-0.3.14 → icadkit-0.3.16}/LICENSES/Apache-2.0.txt +0 -0
  27. {icadkit-0.3.14 → icadkit-0.3.16}/LICENSES/PolyForm-Noncommercial-1.0.0.md +0 -0
  28. {icadkit-0.3.14 → icadkit-0.3.16}/LICENSES/parasolid-core-MIT.txt +0 -0
  29. {icadkit-0.3.14 → icadkit-0.3.16}/README.md +0 -0
  30. {icadkit-0.3.14 → icadkit-0.3.16}/THIRD_PARTY_NOTICES.md +0 -0
  31. {icadkit-0.3.14 → icadkit-0.3.16}/corpus/README.md +0 -0
  32. {icadkit-0.3.14 → icadkit-0.3.16}/corpus/generate.py +0 -0
  33. {icadkit-0.3.14 → icadkit-0.3.16}/corpus/public.jsonl +0 -0
  34. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/Cargo.toml +0 -0
  35. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/build.rs +0 -0
  36. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/src/compression.rs +0 -0
  37. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/src/container.rs +0 -0
  38. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/src/document.rs +0 -0
  39. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/src/error.rs +0 -0
  40. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/src/header.rs +0 -0
  41. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/src/lib.rs +0 -0
  42. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/src/limits.rs +0 -0
  43. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/src/native.rs +0 -0
  44. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/src/parasolid.rs +0 -0
  45. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/src/provenance.rs +0 -0
  46. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/src/reader.rs +0 -0
  47. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/src/record.rs +0 -0
  48. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/src/resource.rs +0 -0
  49. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/src/schema.rs +0 -0
  50. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/src/trailer.rs +0 -0
  51. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/src/views.rs +0 -0
  52. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/tests/container.rs +0 -0
  53. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/tests/header.rs +0 -0
  54. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-core/tests/resources.rs +0 -0
  55. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-python/Cargo.toml +0 -0
  56. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-python/src/brep.rs +0 -0
  57. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-python/src/document.rs +0 -0
  58. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-python/src/geometry.rs +0 -0
  59. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-python/src/lib.rs +0 -0
  60. {icadkit-0.3.14 → icadkit-0.3.16}/crates/icad-python/src/schema.rs +0 -0
  61. {icadkit-0.3.14 → icadkit-0.3.16}/docs/api.md +0 -0
  62. {icadkit-0.3.14 → icadkit-0.3.16}/docs/csg.md +0 -0
  63. {icadkit-0.3.14 → icadkit-0.3.16}/docs/drawing.md +0 -0
  64. {icadkit-0.3.14 → icadkit-0.3.16}/docs/license.md +0 -0
  65. {icadkit-0.3.14 → icadkit-0.3.16}/docs/native.md +0 -0
  66. {icadkit-0.3.14 → icadkit-0.3.16}/docs/parameters.md +0 -0
  67. {icadkit-0.3.14 → icadkit-0.3.16}/docs/preview.md +0 -0
  68. {icadkit-0.3.14 → icadkit-0.3.16}/docs/references.md +0 -0
  69. {icadkit-0.3.14 → icadkit-0.3.16}/docs/roadmap.md +0 -0
  70. {icadkit-0.3.14 → icadkit-0.3.16}/docs/shapes.md +0 -0
  71. {icadkit-0.3.14 → icadkit-0.3.16}/docs/trailer.md +0 -0
  72. {icadkit-0.3.14 → icadkit-0.3.16}/docs/viewer.md +0 -0
  73. {icadkit-0.3.14 → icadkit-0.3.16}/docs/writing.md +0 -0
  74. {icadkit-0.3.14 → icadkit-0.3.16}/scripts/bump_version.py +0 -0
  75. {icadkit-0.3.14 → icadkit-0.3.16}/scripts/check_license.py +0 -0
  76. {icadkit-0.3.14 → icadkit-0.3.16}/scripts/check_public_tree.py +0 -0
  77. {icadkit-0.3.14 → icadkit-0.3.16}/scripts/test_publication.py +0 -0
  78. {icadkit-0.3.14 → icadkit-0.3.16}/scripts/test_versions.py +0 -0
  79. {icadkit-0.3.14 → icadkit-0.3.16}/scripts/verify_artifacts.py +0 -0
  80. {icadkit-0.3.14 → icadkit-0.3.16}/scripts/verify_corpus.py +0 -0
  81. {icadkit-0.3.14 → icadkit-0.3.16}/scripts/verify_install.py +0 -0
  82. {icadkit-0.3.14 → icadkit-0.3.16}/scripts/verify_native_corpus.py +0 -0
  83. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/__init__.py +0 -0
  84. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/__main__.py +0 -0
  85. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/_core.pyi +0 -0
  86. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/_preview_bridge.py +0 -0
  87. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/_viewer/index.html +0 -0
  88. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/_viewer/viewer.css +0 -0
  89. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/_viewer/viewer.js +0 -0
  90. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/_viewer_io.py +0 -0
  91. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/api.py +0 -0
  92. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/cli.py +0 -0
  93. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/container.py +0 -0
  94. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/csg.py +0 -0
  95. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/document.py +0 -0
  96. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/drawing.py +0 -0
  97. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/errors.py +0 -0
  98. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/geometry.py +0 -0
  99. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/models.py +0 -0
  100. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/native.py +0 -0
  101. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/parameters.py +0 -0
  102. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/parts.py +0 -0
  103. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/preview.py +0 -0
  104. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/py.typed +0 -0
  105. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/references.py +0 -0
  106. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/saved.py +0 -0
  107. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/schema.py +0 -0
  108. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/trailer.py +0 -0
  109. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/versions.py +0 -0
  110. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/viewer.py +0 -0
  111. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/views.py +0 -0
  112. {icadkit-0.3.14 → icadkit-0.3.16}/src/icadkit/write.py +0 -0
  113. {icadkit-0.3.14 → icadkit-0.3.16}/tests/conftest.py +0 -0
  114. {icadkit-0.3.14 → icadkit-0.3.16}/tests/drawing_fixtures.py +0 -0
  115. {icadkit-0.3.14 → icadkit-0.3.16}/tests/fixture_builders.py +0 -0
  116. {icadkit-0.3.14 → icadkit-0.3.16}/tests/geometry_fixtures.py +0 -0
  117. {icadkit-0.3.14 → icadkit-0.3.16}/tests/parameter_fixtures.py +0 -0
  118. {icadkit-0.3.14 → icadkit-0.3.16}/tests/part_fixtures.py +0 -0
  119. {icadkit-0.3.14 → icadkit-0.3.16}/tests/preview_fixtures.py +0 -0
  120. {icadkit-0.3.14 → icadkit-0.3.16}/tests/saved_fixtures.py +0 -0
  121. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_api.py +0 -0
  122. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_cli.py +0 -0
  123. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_container.py +0 -0
  124. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_corpus.py +0 -0
  125. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_csg.py +0 -0
  126. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_distribution.py +0 -0
  127. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_drawing.py +0 -0
  128. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_extrusion.py +0 -0
  129. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_geometry.py +0 -0
  130. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_inspect.py +0 -0
  131. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_mirrors.py +0 -0
  132. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_native.py +0 -0
  133. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_native_corpus.py +0 -0
  134. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_native_round.py +0 -0
  135. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_parameters.py +0 -0
  136. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_part_profiles.py +0 -0
  137. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_part_semantics.py +0 -0
  138. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_parts.py +0 -0
  139. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_parts_material.py +0 -0
  140. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_profile_shapes.py +0 -0
  141. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_references.py +0 -0
  142. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_resource_cli.py +0 -0
  143. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_resources.py +0 -0
  144. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_saved.py +0 -0
  145. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_shape.py +0 -0
  146. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_trailer.py +0 -0
  147. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_unknown_version_boundary.py +0 -0
  148. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_v7_parts.py +0 -0
  149. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_version_geometry.py +0 -0
  150. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_viewer.py +0 -0
  151. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_views_placement.py +0 -0
  152. {icadkit-0.3.14 → icadkit-0.3.16}/tests/test_write.py +0 -0
  153. {icadkit-0.3.14 → icadkit-0.3.16}/tests/trailer_fixtures.py +0 -0
  154. {icadkit-0.3.14 → icadkit-0.3.16}/tests/viewer_assembly_browser.mjs +0 -0
  155. {icadkit-0.3.14 → icadkit-0.3.16}/tests/viewer_browser.mjs +0 -0
  156. {icadkit-0.3.14 → icadkit-0.3.16}/tests/viewer_mirror_browser.mjs +0 -0
@@ -89,7 +89,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
89
89
 
90
90
  [[package]]
91
91
  name = "icad-core"
92
- version = "0.3.14"
92
+ version = "0.3.16"
93
93
  dependencies = [
94
94
  "flate2",
95
95
  "parasolid-core",
@@ -99,7 +99,7 @@ dependencies = [
99
99
 
100
100
  [[package]]
101
101
  name = "icad-python"
102
- version = "0.3.14"
102
+ version = "0.3.16"
103
103
  dependencies = [
104
104
  "icad-core",
105
105
  "parasolid-core",
@@ -142,9 +142,9 @@ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
142
142
 
143
143
  [[package]]
144
144
  name = "parasolid-core"
145
- version = "0.3.12"
145
+ version = "0.3.13"
146
146
  source = "registry+https://github.com/rust-lang/crates.io-index"
147
- checksum = "a32654f3e5ffd2d2bc8ea581248b4197d6dbf589552c83e22eb28e78f9190d8f"
147
+ checksum = "c5a3eee4a0e82b459e0b46e898d1f91b5f48ccfd92d9be9fa8f6363d72376420"
148
148
 
149
149
  [[package]]
150
150
  name = "portable-atomic"
@@ -4,13 +4,13 @@ resolver = "3"
4
4
 
5
5
  [workspace.package]
6
6
  # Release version source. Update with: python3 scripts/bump_version.py X.Y.Z
7
- version = "0.3.14"
7
+ version = "0.3.16"
8
8
  edition = "2024"
9
9
  rust-version = "1.88"
10
10
  license = "PolyForm-Noncommercial-1.0.0"
11
11
 
12
12
  [workspace.dependencies]
13
- parasolid-core = "=0.3.12"
13
+ parasolid-core = "=0.3.13"
14
14
  pyo3 = { version = "=0.29.2", features = ["abi3-py310"] }
15
15
  flate2 = { version = "1", default-features = false, features = ["rust_backend"] }
16
16
  sha2 = "0.10"
@@ -134,7 +134,7 @@ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
134
134
  DEALINGS IN THE SOFTWARE.
135
135
 
136
136
 
137
- === parasolid-core 0.3.12 (MIT AND Apache-2.0) ===
137
+ === parasolid-core 0.3.13 (MIT AND Apache-2.0) ===
138
138
  MIT License
139
139
 
140
140
  Copyright (c) 2026 parasolid-kit contributors
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: icadkit
3
- Version: 0.3.14
3
+ Version: 0.3.16
4
4
  Classifier: Development Status :: 2 - Pre-Alpha
5
5
  Classifier: Programming Language :: Python :: 3 :: Only
6
6
  Classifier: Programming Language :: Python :: Implementation :: CPython
7
7
  Classifier: Programming Language :: Rust
8
8
  Classifier: Typing :: Typed
9
- Requires-Dist: parasolid-kit[occt]>=0.3.12,<0.4 ; extra == 'preview'
9
+ Requires-Dist: parasolid-kit[occt]>=0.3.14,<0.4 ; extra == 'preview'
10
10
  Provides-Extra: preview
11
11
  License-File: LICENSE
12
12
  License-File: COMMERCIAL-LICENSE.md
@@ -584,7 +584,7 @@ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
584
584
  DEALINGS IN THE SOFTWARE.
585
585
 
586
586
 
587
- === parasolid-core 0.3.12 (MIT AND Apache-2.0) ===
587
+ === parasolid-core 0.3.13 (MIT AND Apache-2.0) ===
588
588
  MIT License
589
589
 
590
590
  Copyright (c) 2026 parasolid-kit contributors
@@ -867,7 +867,11 @@ impl Document {
867
867
  && word(bytes, at + 12) == 1
868
868
  && word(bytes, at + 356) as usize == length - 352
869
869
  && (word(bytes, at + 360) == 1 || v8l4_external_extension)
870
- && word(bytes, at + 364) == 1;
870
+ // V8L4 also saves 2 in the third word of the 700-byte owner.
871
+ && (word(bytes, at + 364) == 1
872
+ || (profile == PartProfile::V8L4
873
+ && length == 700
874
+ && word(bytes, at + 364) == 2));
871
875
  if length != 352 && !extended_part {
872
876
  result.index_status = Status::Partial;
873
877
  result.issue(
@@ -916,21 +920,8 @@ impl Document {
916
920
  // parent/child graph, not the ID prefix alone, identify it.
917
921
  let is_root =
918
922
  flags == 64 && matches!(source_id & 0xf0000000, 0xe0000000 | 0xa0000000);
919
- // The observed V7L5 originals contain only an unlinked root.
920
- // Do not infer a child-part layout from another version.
921
- if profile == PartProfile::V7L5
922
- && (!is_root || (260..=272).step_by(4).any(|i| word(bytes, at + i) != 0))
923
- {
924
- result.index_status = Status::Partial;
925
- result.issue(
926
- ErrorKind::Unsupported,
927
- "parts.legacy_root_only",
928
- base + at as u64,
929
- "V7L5 is qualified only for an unlinked document root",
930
- );
931
- result.opaque(base + at as u64, base + end as u64, "unparsed_entities");
932
- break;
933
- }
923
+ // V7L5 assemblies save their child parts in the V7L2–V7L4
924
+ // records; the hierarchy check below validates every link.
934
925
  if !is_root
935
926
  && (!matches!(flags, 0 | 8 | 0x50 | 0x58)
936
927
  || source_id & 0xf0000000 != 0xa0000000)
@@ -1003,10 +994,14 @@ impl Document {
1003
994
  || (profile.mirrors() && word(bytes, at + 12) == 0xcf011081))
1004
995
  {
1005
996
  // The second word is 1 in every V7L7–V8L3 record; V8L4 user
1006
- // attribute text (the same `User_*,"value"` list) saves 230.
997
+ // attribute text (the same `User_*,"value"` list) saves 230, and
998
+ // a V8L4 record of subtype 0xb0000000 in one fragment saves 15.
1007
999
  if length >= 32
1008
1000
  && (word(bytes, at + 4) == 1
1009
- || (profile == PartProfile::V8L4 && word(bytes, at + 4) == 230))
1001
+ || (profile == PartProfile::V8L4
1002
+ && (word(bytes, at + 4) == 230
1003
+ || (word(bytes, at + 4) == 15
1004
+ && word(bytes, at + 28) == 0xb0000000))))
1010
1005
  && word(bytes, at + 8) == 0
1011
1006
  && word(bytes, at + 20) == 0
1012
1007
  && word(bytes, at + 24) & 0xff000000 == 0xfd000000
@@ -1037,15 +1032,23 @@ impl Document {
1037
1032
  );
1038
1033
  } else if length >= 36
1039
1034
  && word(bytes, at + 16) & 0xf0000000 == 0x80000000
1040
- && (bytes[at + 32] == 1
1041
- || (subtype == 0x19000000 && bytes[at + 32] == 2))
1042
- && matches!(
1043
- (subtype, length),
1035
+ && match (subtype, length) {
1044
1036
  (0x02000000, 408 | 472 | 616)
1045
- | (0x03000000 | 0x04000000, 56)
1046
- | (0x06000000, 48)
1047
- | (0x19000000, 88)
1048
- )
1037
+ | (0x03000000 | 0x04000000, 56)
1038
+ | (0x06000000, 48) => bytes[at + 32] == 1,
1039
+ // The leading byte is 1, 2 or 3 in the same 88 bytes.
1040
+ (0x19000000, 88) => matches!(bytes[at + 32], 1..=3),
1041
+ // A counted list: the leading byte counts 56-byte
1042
+ // entries behind the 40-byte head (one and two observed).
1043
+ (0x1a000000, 96) => bytes[at + 32] == 1,
1044
+ (0x1a000000, 152) => bytes[at + 32] == 2,
1045
+ // The V8L4 payload that other records split into two
1046
+ // fragments; its length varies and is framed above.
1047
+ (0xb0000000, _) => {
1048
+ profile == PartProfile::V8L4 && word(bytes, at + 4) == 15
1049
+ }
1050
+ _ => false,
1051
+ }
1049
1052
  {
1050
1053
  // Qualified framing only. Do not interpret binary attributes
1051
1054
  // as text or claim their material/BOM/constraint semantics.
@@ -584,7 +584,7 @@ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
584
584
  DEALINGS IN THE SOFTWARE.
585
585
 
586
586
 
587
- === parasolid-core 0.3.12 (MIT AND Apache-2.0) ===
587
+ === parasolid-core 0.3.13 (MIT AND Apache-2.0) ===
588
588
  MIT License
589
589
 
590
590
  Copyright (c) 2026 parasolid-kit contributors
@@ -4,6 +4,24 @@
4
4
 
5
5
  ### Fixed
6
6
 
7
+ - Part records that left the index partial, so that no part frame was
8
+ evaluated and `read_part_shapes` reported every part `shape.frame`, now
9
+ read:
10
+ - a V8L4 700-byte owner whose 348-byte extension saves 2 instead of 1 in
11
+ its third word. The extension stays opaque `part_metadata_extension`;
12
+ V8L1–V8L3 headers still require 1 and report `parts.record_layout`.
13
+ - single-fragment binary attributes of subtype `0x19000000` (88 bytes)
14
+ with a leading byte of 3, and of subtype `0x1a000000`, a counted list
15
+ with a 40-byte head and one 56-byte entry per count (96 bytes for one
16
+ entry, 152 for two). They are retained as `PartOpaqueAttribute`; another
17
+ length or count still reports `parts.attribute_layout`.
18
+ - under V8L4, a one-fragment attribute of subtype `0xb0000000` whose second
19
+ word is 15 (the payload that other V8L4 records split into two
20
+ fragments), retained as `PartOpaqueAttribute`. Saved bodies, which need
21
+ a complete index, then bind to their parts.
22
+ - V7L5 assemblies. A linked root and its child parts use the V7L2–V7L4
23
+ records and pass the same hierarchy checks; `parts.legacy_root_only` is
24
+ no longer reported.
7
25
  - Leader notes whose drawn leader has more than three points (the tip, two
8
26
  or more elbows and the end of the shelf; a 2026 production drawing) read
9
27
  `complete` with the full `path`. 0.3.11 unpacked exactly three points and
@@ -15,6 +33,36 @@
15
33
 
16
34
  ### Added
17
35
 
36
+ - The saved-body decoder (Rust) moves to `parasolid-core` 0.3.13: a
37
+ construction blend with null thumb weights no longer fails its body with
38
+ "double array contains null or non-finite data" (four bodies of a 2026
39
+ production file).
40
+ - Saved **wire bodies** (edges without faces: construction curves) convert
41
+ to their edges, chained into wires where they connect. `read_saved_bodies`
42
+ and `read_part_shapes` report them `complete` with `solid_count` 0, no
43
+ volume and no area (`None` in part shapes, `0.0` in meshes) and the length
44
+ centroid; their mesh is the edge polylines without triangles, which
45
+ `cad3d-ir-icad` already draws as lines. Fourteen bodies of a 2026
46
+ production file were refused as "Only saved solid and sheet bodies are
47
+ qualified" before. Requires `parasolid-kit` 0.3.14.
48
+ - A saved FIN whose source geometry leaves its declared edge tolerance (plus
49
+ the conversion budget) no longer fails the body while the deviation stays
50
+ within `SavedBodyLimits.max_source_tolerance_mm`, the bound that also
51
+ qualifies declared tolerances: the output edge tolerance covers the
52
+ measured deviation and the operation
53
+ `source_fin_deviation_within_tolerance_bound` records it (three bodies of
54
+ a 2026 production file whose FINs differ from the shared edge by 3.5 to
55
+ 3.9 µm against a declared 1 µm).
56
+ - Blend-heavy saved bodies convert with `parasolid-kit` 0.3.14, which
57
+ rebuilds rolling-ball blends (pipes around their spines, with a fixed frame
58
+ around a closed spine), their contact curves and the edges between blends,
59
+ reads periodic B-surfaces and ring FINs stored a period away from their
60
+ curve, and revolves a spun profile that meets its axis at one end. On the
61
+ three largest V8L4 production files, 407 of 417, 40 of 40 and 199 of 199
62
+ saved bodies convert; the nine others of the first declare edge or vertex
63
+ tolerances above `max_source_tolerance_mm` and the last fails its output
64
+ tolerance where faces reach several millimetres into a B-surface's linear
65
+ extension.
18
66
  - iCAD SX **V8L4** (header bytes `00 08 00 04`) is qualified for the part,
19
67
  view and drawing readers, observed on seven 2026 production files. Its part
20
68
  records carry the new tag `0x61000004` with the V8L3 352-byte layout
@@ -73,13 +73,16 @@ require `0x61000003`, and V8L4 requires `0x61000004`. Unknown layouts stop with
73
73
  source ranges and diagnostics.
74
74
 
75
75
  V8L4 (`icad-v8l4-parts-r3`, qualified on seven 2026 production files) keeps the
76
- V8L3 352-byte record and entity policy. Two record variants were observed only
77
- there: an external occurrence (flags `0x50`) may be 916 bytes, appending 564
78
- bytes behind the marker `0x101` at offset 360 (counted UTF-16 attribute strings
79
- and resource links) that are retained as `part_metadata_extension`; and the
76
+ V8L3 352-byte record and entity policy. Four record variants were observed
77
+ only there: an external occurrence (flags `0x50`) may be 916 bytes, appending
78
+ 564 bytes behind the marker `0x101` at offset 360 (counted UTF-16 attribute
79
+ strings and resource links) that are retained as `part_metadata_extension`; the
80
80
  user attribute text record (`User_*,"value"` pairs, read as `extra_info`) saves
81
- 230 instead of 1 in its second word. Both stay unqualified under V8L1–V8L3
82
- headers.
81
+ 230 instead of 1 in its second word; a one-fragment attribute of subtype
82
+ `0xb0000000` saves 15 there and is retained as an opaque attribute; and the
83
+ 348-byte extension of a 700-byte owner may save 2 instead of 1 in its third
84
+ word, with the extension retained as `part_metadata_extension` as before. All
85
+ four stay unqualified under V8L1–V8L3 headers.
83
86
 
84
87
  V7L2–V7L5 expose inventory, hierarchy, names, comments, stored attributes and
85
88
  root-relative millimetre frames, with opaque entity geometry. Their saved final
@@ -190,6 +193,12 @@ leave `status.index="complete"`, while `stored_attributes="partial"` and
190
193
  `parts.attribute_semantics` report unknown attribute meaning. Unknown attribute layouts retain a partial index and opaque bytes; unknown
191
194
  record framing stops traversal. `max_property_bytes` applies to these payloads.
192
195
 
196
+ A single-fragment binary attribute is qualified by its subtype, length and
197
+ leading byte together. Subtype `0x19000000` is one 88-byte layout whose
198
+ leading byte is 1, 2 or 3; subtype `0x1a000000` is a counted list, a 40-byte
199
+ head followed by one 56-byte entry per count in the leading byte (96 bytes for
200
+ one entry, 152 for two). Another length or count stays an unknown layout.
201
+
193
202
  Attribute records can also consist of several length-framed fragments, or carry
194
203
  the saved visibility bit. When the declared fragment count matches and the
195
204
  fragments consume the record exactly, the whole record is retained as one
@@ -336,6 +345,7 @@ parts, Japanese text changes and mixed native/Parasolid representations.
336
345
  Public tests use independently authored synthetic framing and malformed data;
337
346
  CAD files, vendor DLLs and schema catalogs are excluded from distributions.
338
347
 
339
- The qualified V7L5 originals contain an unlinked document root only. A child
340
- record or nonzero hierarchy link yields `parts.legacy_root_only`; V7L5 child
341
- assemblies are not inferred from the other V7 profiles.
348
+ V7L5 assemblies use the V7L2–V7L4 part records: a linked document root, its
349
+ child parts and their sibling chains are read and validated like the other
350
+ legacy profiles, and a missing or inconsistent link reports `parts.parent`,
351
+ `parts.child` or `parts.child_chain`. Their entity geometry stays opaque.
@@ -102,8 +102,12 @@ The current converter covers solid and sheet bodies with planes, cylinders,
102
102
  spheres, cones and tori, bounded by lines, circles, ellipses, source-identified
103
103
  surface-intersection curves and explicit trims of those curves. A sheet body
104
104
  becomes its open shell: it meshes and exports like a solid, with no volume
105
- (`solid_count` 0) and the area centroid as its centroid. Wire bodies (edges
106
- without faces) and other body kinds stay unqualified. This is a
105
+ (`solid_count` 0) and the area centroid as its centroid. A wire body (edges
106
+ without faces, as iCAD saves construction curves) becomes its edges, chained
107
+ into wires where they connect: its mesh is the edge polylines with no
108
+ triangles, `volume_mm3` 0.0 and `area_mm2` 0.0, the part shape reports
109
+ `volume_mm3` and `area_mm2` as `None` with the length centroid, and the GLB
110
+ of `cad3d-ir-icad` draws it as lines. Other body kinds stay unqualified. This is a
107
111
  bounded surface/boundary combination, not support for arbitrary solids
108
112
  containing those surfaces. Faces require explicit boundary loops. A conical
109
113
  face that ends in its apex is stored with a loop of one vertex and no edge; the
@@ -233,6 +233,7 @@ raw nodes and B-Rep structures can coexist. Process one resource at a time and
233
233
  use small pages for large NURBS entities. The [API reference](api.md) lists the
234
234
  defaults and exception behavior.
235
235
 
236
- The qualified V7L5 originals contain an unlinked document root only. A child
237
- record or nonzero hierarchy link yields `parts.legacy_root_only`; V7L5 child
238
- assemblies are not inferred from the other V7 profiles.
236
+ V7L5 assemblies use the V7L2–V7L4 part records: a linked document root, its
237
+ child parts and their sibling chains are read and validated like the other
238
+ legacy profiles, and a missing or inconsistent link reports `parts.parent`,
239
+ `parts.child` or `parts.child_chain`. Their entity geometry stays opaque.
@@ -31,7 +31,7 @@ Licensing = "https://github.com/monozukuri-ai/icadkit/blob/main/docs/license.md"
31
31
  Commercial = "https://www.un-robotics.com/#contact"
32
32
 
33
33
  [project.optional-dependencies]
34
- preview = ["parasolid-kit[occt]>=0.3.12,<0.4"]
34
+ preview = ["parasolid-kit[occt]>=0.3.14,<0.4"]
35
35
 
36
36
  [dependency-groups]
37
37
  dev = ["maturin==1.15.0", "pytest>=8.3,<9", "ruff>=0.15,<1", "mypy>=1.15,<3"]
@@ -50,12 +50,19 @@ def _shapes(shape: Any, kind: Any, api: dict[str, Any]) -> Any:
50
50
 
51
51
 
52
52
  def _check(
53
- shape: Any, limits: CsgLimits, api: dict[str, Any], *, allow_sheet: bool = False
53
+ shape: Any,
54
+ limits: CsgLimits,
55
+ api: dict[str, Any],
56
+ *,
57
+ allow_sheet: bool = False,
58
+ allow_wire: bool = False,
54
59
  ) -> int:
55
60
  """Validate a kernel result and count its solids.
56
61
 
57
- ``allow_sheet`` admits a result without solids whose shells are open: the
58
- converted saved sheet body. CSG results and primitives are always solids.
62
+ ``allow_sheet`` admits a result without solids whose shells are open (the
63
+ converted saved sheet body); ``allow_wire`` one without faces that still
64
+ has edges (the converted saved wire body). CSG results and primitives are
65
+ always solids.
59
66
  """
60
67
  if shape.IsNull() or not api["BRepCheck"].BRepCheck_Analyzer(shape).IsValid():
61
68
  _fail(
@@ -78,10 +85,18 @@ def _check(
78
85
  category="limit_exceeded",
79
86
  )
80
87
  solids = sum(1 for _ in _shapes(shape, api["TopAbs"].TopAbs_SOLID, api))
81
- if allow_sheet and not solids:
82
- if not any(True for _ in _shapes(shape, api["TopAbs"].TopAbs_FACE, api)):
83
- _fail("csg.empty_result", "Sheet result has no faces", category="invalid")
84
- return 0
88
+ if not solids and (allow_sheet or allow_wire):
89
+ faces = any(True for _ in _shapes(shape, api["TopAbs"].TopAbs_FACE, api))
90
+ edges = any(True for _ in _shapes(shape, api["TopAbs"].TopAbs_EDGE, api))
91
+ if (allow_sheet and faces) or (allow_wire and edges and not faces):
92
+ return 0
93
+ _fail(
94
+ "csg.empty_result",
95
+ "Sheet result has no faces"
96
+ if allow_sheet and not allow_wire
97
+ else "Open result has neither faces nor edges",
98
+ category="invalid",
99
+ )
85
100
  if not solids:
86
101
  _fail(
87
102
  "csg.empty_result",
@@ -437,20 +452,35 @@ def mesh_shape(
437
452
  api: dict[str, Any],
438
453
  *,
439
454
  allow_sheet: bool = False,
455
+ allow_wire: bool = False,
440
456
  ) -> CsgMesh:
441
- solids = _check(shape, limits, api, allow_sheet=allow_sheet)
457
+ solids = _check(shape, limits, api, allow_sheet=allow_sheet, allow_wire=allow_wire)
458
+ wire_only = (
459
+ allow_wire
460
+ and not solids
461
+ and not any(True for _ in _shapes(shape, api["TopAbs"].TopAbs_FACE, api))
462
+ )
442
463
  volume = api["GProp"].GProp_GProps()
443
464
  area = api["GProp"].GProp_GProps()
444
465
  api["BRepGProp"].BRepGProp.VolumeProperties_s(shape, volume)
445
466
  api["BRepGProp"].BRepGProp.SurfaceProperties_s(shape, area)
446
- # A sheet body has no volume: its measure is the area and the area centroid.
447
- center = (area if allow_sheet and not solids else volume).CentreOfMass()
467
+ if wire_only:
468
+ # A wire body has neither volume nor area: its measure is the length
469
+ # and the length centroid.
470
+ length = api["GProp"].GProp_GProps()
471
+ api["BRepGProp"].BRepGProp.LinearProperties_s(shape, length)
472
+ center = length.CentreOfMass()
473
+ mass, measure = 0.0, length.Mass()
474
+ else:
475
+ # A sheet body has no volume: its measure is the area and the area centroid.
476
+ center = (area if allow_sheet and not solids else volume).CentreOfMass()
477
+ mass = 0.0 if allow_sheet and not solids else volume.Mass()
478
+ measure = area.Mass()
448
479
  centroid = (center.X(), center.Y(), center.Z())
449
- mass = 0.0 if allow_sheet and not solids else volume.Mass()
450
480
  if (
451
- not all(math.isfinite(v) for v in (*centroid, mass, area.Mass()))
452
- or (mass <= 0 and not (allow_sheet and not solids))
453
- or area.Mass() <= 0
481
+ not all(math.isfinite(v) for v in (*centroid, mass, measure))
482
+ or (mass <= 0 and not ((allow_sheet or allow_wire) and not solids))
483
+ or measure <= 0
454
484
  ):
455
485
  _fail("csg.mass_properties", "Invalid CSG mass properties", category="invalid")
456
486
  mesher = api["BRepMesh"].BRepMesh_IncrementalMesh(
@@ -501,7 +531,36 @@ def mesh_shape(
501
531
  for (a, b), count in boundary.items():
502
532
  if count == 1:
503
533
  edges.extend((a, b))
504
- if not triangles or not all(math.isfinite(v) for v in positions):
534
+ if wire_only:
535
+ # The mesher discretises free edges into their 3D polygons; a wire
536
+ # body's mesh is those polylines and has no triangles.
537
+ for item in _shapes(shape, api["TopAbs"].TopAbs_EDGE, api):
538
+ edge = api["TopoDS"].TopoDS.Edge_s(item)
539
+ location = api["TopLoc"].TopLoc_Location()
540
+ polygon = api["BRep"].BRep_Tool.Polygon3D_s(edge, location)
541
+ if polygon is None or polygon.NbNodes() < 2:
542
+ _fail(
543
+ "csg.tessellation",
544
+ "Wire edge has no polygon; no partial mesh",
545
+ category="invalid",
546
+ )
547
+ offset = len(positions) // 3
548
+ if offset + polygon.NbNodes() > limits.max_vertices:
549
+ _fail(
550
+ "csg.limit_mesh",
551
+ "CSG mesh exceeds vertex/triangle limits",
552
+ category="limit_exceeded",
553
+ )
554
+ transform = location.Transformation()
555
+ nodes = polygon.Nodes()
556
+ for i in range(nodes.Lower(), nodes.Upper() + 1):
557
+ point = nodes.Value(i).Transformed(transform)
558
+ positions.extend((point.X(), point.Y(), point.Z()))
559
+ for i in range(polygon.NbNodes() - 1):
560
+ edges.extend((offset + i, offset + i + 1))
561
+ if (not edges if wire_only else not triangles) or not all(
562
+ math.isfinite(v) for v in positions
563
+ ):
505
564
  _fail("csg.tessellation", "Invalid or empty CSG mesh", category="invalid")
506
565
  return CsgMesh(
507
566
  body_id,
@@ -509,7 +568,7 @@ def mesh_shape(
509
568
  tuple(triangles),
510
569
  tuple(edges),
511
570
  mass,
512
- area.Mass(),
571
+ 0.0 if wire_only else area.Mass(),
513
572
  centroid,
514
573
  solids,
515
574
  deflection,
@@ -20,8 +20,10 @@ from .saved import SavedBody, SavedBodyLimits, SavedBodyMesh, _error
20
20
  def _preflight(model: Any, limits: SavedBodyLimits) -> None:
21
21
  if not model.complete or not model.topology.valid or not model.bodies:
22
22
  raise _error("topology", "Saved B-Rep must be complete and topologically valid")
23
- if any(b.kind.value not in ("solid", "sheet") for b in model.bodies):
24
- raise _error("body_kind", "Only saved solid and sheet bodies are qualified")
23
+ if any(b.kind.value not in ("solid", "sheet", "wire") for b in model.bodies):
24
+ raise _error(
25
+ "body_kind", "Only saved solid, sheet and wire bodies are qualified"
26
+ )
25
27
  for value in (*model.edges, *model.vertices):
26
28
  if value.tolerance is not None and (
27
29
  not math.isfinite(value.tolerance)
@@ -77,10 +79,12 @@ def _preflight(model: Any, limits: SavedBodyLimits) -> None:
77
79
  if any(f.sense.value == "unknown" or not f.loops for f in model.faces):
78
80
  raise _error("face", "Saved faces require explicit oriented boundary loops")
79
81
  apex = {h for _, _, loop in _apex_loops(model) for h in loop.half_edges}
82
+ # The fins of a wire body's edges belong to no loop and are stored as
83
+ # dummies; they carry no face geometry and the builder never reads them.
80
84
  if any(
81
85
  h.dummy or h.edge is None or h.sense.value == "unknown"
82
86
  for h in model.half_edges
83
- if h.id not in apex
87
+ if h.id not in apex and h.loop is not None
84
88
  ):
85
89
  raise _error("half_edge", "Unqualified saved half-edge")
86
90
 
@@ -278,25 +282,39 @@ def _build(
278
282
  "output_tolerance",
279
283
  "Kernel vertex tolerance exceeds configured bound",
280
284
  )
281
- if not api["BRepCheck"].BRepCheck_Analyzer(shape).IsValid():
285
+ builder.face_shapes[face.id] = shape
286
+ try:
287
+ # The builder's own check applies its wire repair (tolerance growth
288
+ # over a crossing just before a shared vertex) before judging.
289
+ builder._check_face(face)
290
+ except ValueError as exc:
282
291
  raise _error(
283
292
  "invalid_face", f"Saved face {face.id} failed kernel validation"
284
- )
285
- builder.face_shapes[face.id] = shape
293
+ ) from exc
286
294
  builder._validate_source_boundaries()
287
295
  # The builder's fatal diagnostics stop the conversion. Its non-fatal ones
288
- # (edges whose sampled FIN-to-output difference exceeds the source edge
289
- # tolerance while the conversion error budget passed) are recorded as an
290
- # operation; the output stays within the budget the builder validated.
296
+ # are recorded as operations: edges whose sampled FIN-to-output difference
297
+ # exceeds the source edge tolerance while the conversion error budget
298
+ # passed, and edges whose source FIN leaves even that budget but stays
299
+ # within the qualified source-tolerance bound (the output edge tolerance
300
+ # covers the measured deviation).
291
301
  if any(_fatal(d) for d in builder.diagnostics):
292
302
  raise _error(
293
303
  "conversion_diagnostics",
294
304
  "Saved boundary conversion has unresolved diagnostics",
295
305
  )
306
+ shape = builder._make_root(builder._build_bodies())
296
307
  operations = [*builder.operations, "restore_declared_body_resolution"]
297
- if builder.diagnostics:
308
+ codes = {d.code for d in builder.diagnostics}
309
+ if codes - {"occt.source_fin_deviation", "occt.intersection_deviation"}:
298
310
  operations.append("source_fin_deviation_within_conversion_budget")
299
- shape = builder._make_root(builder._build_bodies())
311
+ if "occt.source_fin_deviation" in codes:
312
+ operations.append("source_fin_deviation_within_tolerance_bound")
313
+ if "occt.intersection_deviation" in codes:
314
+ # An intersection whose supports meet only within the same bound (a
315
+ # blend spine across a crease of an offset, a chart a few micrometres
316
+ # off a rebuilt blend pipe); the edges on it carry the deviation.
317
+ operations.append("intersection_deviation_within_tolerance_bound")
300
318
  count = sum(1 for _ in _shapes(shape, api["TopAbs"].TopAbs_FACE, api))
301
319
  if count != len(model.faces):
302
320
  raise _error("face_coverage", "Saved face count changed during conversion")
@@ -324,10 +342,13 @@ def build_base(
324
342
  # The preflight has bounded that resolution; nothing is healed.
325
343
  resolution = min(b.linear_resolution for b in model.bodies) * 1000
326
344
  occt = import_module("parasolid_kit.interop.occt.options")
345
+ # A FIN that leaves its declared edge tolerance is still accepted while the
346
+ # deviation stays within the same bound that qualifies declared tolerances.
327
347
  options = occt.OcctConversionOptions(
328
348
  source_unit="m",
329
349
  target_unit="mm",
330
350
  validation=occt.ValidationTolerances(linear_absolute=max(1e-6, resolution)),
351
+ fin_deviation_cap=limits.max_source_tolerance_mm,
331
352
  )
332
353
  shape, operations = _build(model, options, api, limits)
333
354
  return shape, operations, len(model.faces)
@@ -350,9 +371,16 @@ def convert(
350
371
  max_triangles=limits.max_triangles,
351
372
  max_vertices=limits.max_vertices,
352
373
  )
353
- # A saved sheet body is its open shell; solids arrive closed or not at all.
374
+ # A saved sheet body is its open shell and a wire body its edges;
375
+ # solids arrive closed or not at all.
354
376
  mesh = mesh_shape(
355
- shape, body.body_id, bounded, deflection, api, allow_sheet=True
377
+ shape,
378
+ body.body_id,
379
+ bounded,
380
+ deflection,
381
+ api,
382
+ allow_sheet=True,
383
+ allow_wire=True,
356
384
  )
357
385
  assert body.resource_id is not None
358
386
  return SavedBodyMesh(
@@ -50,10 +50,24 @@ def surface_properties(
50
50
  return area.Mass(), (centre.X(), centre.Y(), centre.Z())
51
51
 
52
52
 
53
+ def linear_properties(
54
+ shape: Any, api: dict[str, Any]
55
+ ) -> tuple[float, tuple[float, float, float]]:
56
+ """Exact kernel curve length and length centroid; the measure of a wire body."""
57
+ length = api["GProp"].GProp_GProps()
58
+ api["BRepGProp"].BRepGProp.LinearProperties_s(shape, length)
59
+ centre = length.CentreOfMass()
60
+ return length.Mass(), (centre.X(), centre.Y(), centre.Z())
61
+
62
+
53
63
  def solid_count(shape: Any, api: dict[str, Any]) -> int:
54
64
  return sum(1 for _ in _shapes(shape, api["TopAbs"].TopAbs_SOLID, api))
55
65
 
56
66
 
67
+ def face_count(shape: Any, api: dict[str, Any]) -> int:
68
+ return sum(1 for _ in _shapes(shape, api["TopAbs"].TopAbs_FACE, api))
69
+
70
+
57
71
  def compound(shapes: list[Any], api: dict[str, Any]) -> Any:
58
72
  builder = api["BRep"].BRep_Builder()
59
73
  result = api["TopoDS"].TopoDS_Compound()