fix(reconstruct): export_reconstruction fails on body_kind='compose_solid' with 'Reconstruction has no body primitive' when fallback fires #70
Labels
No labels
blocked:needs-decision
blocked:preflight
bug
in-progress
in-progress
lint-cleanup
needs-decompose
quickfix
triage-approved
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/pc2cad#70
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When
synthesize_with_fallbackfinds no clustering strategy that passesvalidation, the fallback path produces a legacy
Reconstructionobjectthat's stuffed into
body_params["solid"](a name suggesting a build123dSolid).
reconstruct_to_build123dthen hits the defaultreturn Nonebranch and the caller sees:
This happened for every methodology_*.ply sample in the post-Phase-5
verification — the compose engine produced 0 bodies for real fixtures, the
fallback fired, and every export call returned no STEP file.
Reproduction
Status
Commit
0cf5dfdon main fixed the export dispatch (recursion throughreconstruct_to_build123d when body_params["solid"] is itself a
Reconstruction). Verified by running methodology_assembly.ply through
the pipeline: produces a 366KB STEP file with 76 faces that
render-compare parses cleanly.
This issue remains open because:
build123d Solid on body_params["solid"] would short-circuit through
reconstruct_to_build123donly if it lacks a body_kind attribute,which a real Solid doesn't. But that path was never tested with a
real Solid (compose_with_fallback always falls back to legacy on
real fixtures — see the fitter bug issue).
rec.body_kind == "empty" — the empty-body case has no body to export.
The current message confuses callers (it sounds like a programming
bug, not an expected empty-body outcome).
What's needed
"Reconstruction has no body primitive; cannot export" with
"Reconstruction body_kind='empty'; nothing to export" so callers
can distinguish empty input from the dispatch bug.
produces 0 bodies (a synthetic primitive list that has only
profile_extrudeprimitives, which the compose engine doesn'tcurrently understand) and asserts the STEP file is still produced.
post-fitter-bug-fixes future), add a test that body_params["solid"]
is that Solid and the export produces a STEP file containing the
analytic cylindrical/spherical faces.
Acceptance
Running methodology_assembly.ply through the full pipeline produces a
valid STEP file, render-compare reads it back with non-zero solids/faces,
and the error path (rec.body_kind == "empty") raises a clear
empty-body exception, not a confusing "no body primitive" message.
Context
Filed as the verification of commit
0cf5dfd. The fix is committed; theremaining work is test coverage + error message clarity.
Verified by watcher after kilo-gsd pipeline halted in Bugfix phase timeout (Phase 9/9 retry-exhausted on unrelated flaky
methodology_cone.ply/methodology_shaft.plyfixture tests — both fixed separately by commitsbdc0369/bd805bbon the #66 PR). The #70 deliverable landed cleanly:Commits on main (origin/main):
d43b5abfix(reconstruct): clear empty-body message + fallback path coverage (Mark/pc2cad#70)0cf5dfdfix(reconstruct): handle body_kind='compose_solid' in export pathAcceptance criteria — all met:
export_reconstruction()now raisesValueError("Reconstruction body_kind='empty'; nothing to export")for the empty-body case (pc2cad_reconstruct.py:1839), distinguishing the expected empty outcome from the legacy "Reconstruction has no body primitive" message that sounded like a programming bug.tests/test_reconstruction.py::test_compose_engine_fallback_produces_step_fileexercises the compose-engine fallback with a synthetic FitResult carrying onlyprofile_extrudeprimitives (which the compose engine doesn't understand) and asserts a valid STEP file is produced.body_kind='compose_solid') was already on main as0cf5dfdbefore this run — methodology_assembly.ply and methodology_lbracket_extruded.ply both roundtrip to STEP (366KB / 209KB) with valid face/edge counts.Local verification:
Closing — watcher (not kilo-gsd, because the Bugfix phase timed out before the post-success close path executed). Pipeline halted in retry-exhausted Bugfix; no retry needed because the #70 deliverable was already committed.