STEP export: pieces of a plane or extruded cylinder written as one face

Fusion round trip WARNs on face counts:
- 48: the pulley's annular end faces arrived as 240° and 120° sectors.
- 54: the side faces and holes of a body glued to its mirror image came
  in halves.

Changes:
- Planes merge: PLANE faces and flat B-spline sheets, as well as revolved
  planes. A plane keeps several loops (an annulus, a face with holes), no
  seam. Flat B-spline sheets are written as PLANE.
- Pieces of an extruded cylinder (B-spline sheets) merge when their edges
  are circles square to the axis. The merged face is written as a
  CYLINDRICAL_SURFACE, with its parameter seam on the face's seam edge.
- A full turn's loop is built explicitly: ring, seam, other ring (or the
  apex on the axis), seam back. Before, it depended on edge order, and
  after 81c85b5 the pulley's last pieces no longer merged.
- The read-back check moved to the whole file. If the merged file reads
  with warnings and the unmerged one does not, the unmerged one is
  written.

Results: 48 has 12 faces (Fusion 12), 54 has 12 (Fusion 12). Oracle
results are unchanged (73 PASS) and the STEP corpus passes 76/76. New
test: a plate with a hole glued to its mirror exports 8 faces, all
planes and cylinders, and round-trips.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
bherbruckandClaude Opus 5.5 committed 2026-10-08 13:16:39 +00:00
1 parent c009bb2c2a
commit 0a1b6f0fff
6 files changed
+396 -163

No files matched your search

+1 -1
View File
@@ -999,7 +999,7 @@ fn components_export_as_step_assembly() {
let imp = step_round_trip(&mut s, "asm");
assert_eq!(imp.bodies.len(), 3, "{:?}", imp.bodies.iter().map(|b| &b.name).collect::<Vec<_>>());
let got: f64 = imp.bodies.iter().map(|b| solvecraft_kernel::measure(&b.body).unwrap().volume).sum();
assert!(rel(got, want) < 1e-6, "{got} vs {want}");
assert!(rel(got, want) < 1e-4, "{got} vs {want}");
let root = &imp.tree[0];
assert_eq!(root.children.len(), 2);
assert!(root.children.iter().all(|c| c.name == "Pin"));