- reverse-engineering-studio.md: free-form composer (entity/op chips, [label](token) serialization, IME-safe Enter), operation tips as a markdown registry (viewer/server/operations/, mtime-hot, errors named), submission schema incl. operations + operation_context, self-contained artifact rule (transcription = literals, extraction harnesses beside the case), kernel-ordering facts (bores before blend fillets; fitter to_dict unique_knots contract), artifact names the UI polls - step-reconstruction.md: route to the studio variant when a human operator is available - SKILL.md: workflow count corrected to six; viewer/README.md updated for the composer + tips registry
5.5 KiB
Workflow: STEP Reconstruction
Rebuild an editable SimpleCAD model from an existing STEP file, with evidence gathering, feature-tree inference, candidate construction, and tiered acceptance.
Goal and scope
Use when the deliverable is an editable/replayable model reproducing a target
.step/.stp. Not for read-only questions about a STEP file — those stay in
domains/step-inspection.md without reconstruction. When a human operator is
available to annotate feature intent on the target, run the variant workflow
references/workflows/reverse-engineering-studio.md instead of this
autonomous path.
Task decomposition
goal: candidate model accepted against the target STEP
primary_domain: step-inspection
required_domains:
- requirement-refinement
- step-inspection
- part-modeling
optional_domains:
- sketch-and-features
- assembly-and-product # multi-component targets
- export-and-translation # re-export for comparison or delivery
artifacts:
- target evidence notes (summaries, entity descriptors, sections)
- feature-tree hypothesis with provenance rows
- candidate source and replayed model
- comparison evidence and acceptance verdict
validation_gates:
- replay succeeds in a fresh process
- STEP roundtrip of the candidate validates
- acceptance follows the hierarchy (topology identity > float drift > justified stop)
repair_routes:
- comparison fails -> step-inspection (localize) then part-modeling (fix feature)
- global similarity but locally falsified feature -> change the feature hypothesis
Steps
-
Refine the requirement: what fidelity is required (exact transcription vs functional equivalence), which components are in scope, what acceptance means here.
-
Inventory the target economically (
domains/step-inspection.md):inspect_step_rsummary(withinclude_parameter_groups=Trueonce), entity descriptors for specific hypotheses, compact boundaries/sections. Persist large arrays to files, not conversation context. Readreferences/inspect/brep-reverse-engineering.mdcompletely first. -
Infer feature families from carrier and section behavior (
references/docs/guides/reconstruction-agent-strategy.md):shared axis + rotational sections -> revolve stable translated profile -> extrude profile transported along a path -> sweep ordered changing section family -> loft verified equal angular/linear units -> one unit + pattern several local signatures -> ordered mixed feature treeRecord a provenance row per region: observed boundary, adjacent-carrier evidence, proposed operation, direction/axis, confidence, and the check that could falsify it. A loop on a final planar face may be a later hole or pocket, not part of the base profile.
-
Build the candidate via
single-part-modeling.md(block structure perdiscipline/feature-tree-convention.md; sketch tier when constraints represent the evidence (domains/sketch-and-features.md), direct geometry tier for non-planar or exact transcription, annotatedprofile=geometryhonestly). Overshoot through-cut tools; validate one representative feature before patterning. -
Replay in a fresh process:
export_model_json→replay_model_json; thenvalidate_step_roundtrip_rdescriptoron the candidate's STEP export. -
Compare and iterate (
domains/step-inspection.md):compare_global_properties_rdescriptor→ scopedcompare_boundary_distance_rdescriptor(≤200 samples, face-id scoped) →compare_material_rdescriptor(include_components=True)for strict proof →compare_steps_rbrepcomparisonfor the exact gate. Usetrack_section_contours_rdescriptorwhen section topology (birth/death/split/merge) is the open question,fit_face_analytic_rdescriptorto test carrier families,render_step_comparison_rpathfor shared-view visual evidence. After a failed strict comparison, group causes withBRepComparison.to_error_summary(), fix related groups together, rerun a fresh cycle. -
Accept per the hierarchy (
domains/step-inspection.md): topology identity is the endpoint; float-level serialization drift is acceptable; a structurally different but visually close stop requires recorded evidence that no better feature order exists or the SDK lacks the operation.
Validation gates
- One compact iteration row per attempt: hypothesis, changed parameters, replay/roundtrip status, diagnostic deltas, strongest proof attempted.
- Preserve the best valid candidate; repeated non-improvement changes the feature hypothesis instead of blind parameter tuning.
- Global similarity never overrides a locally falsified feature.
Failure routes
- No affordable evidence for a region → record the gap; do not invent geometry and call it recovered.
- Candidate structurally different → re-open the feature-tree hypothesis before accepting a visual-close stop.
- Reconstruction tooling absent (
inspectextra not installed) → report the missing capability rather than degrading silently.
Deliverables
Candidate source path, replay evidence, comparison evidence with verdict and its acceptance tier, provenance rows, and explicitly unrecovered regions.
Required reading before authoring or editing any part source in this
workflow: discipline/feature-tree-convention.md — the block-structured
sketch → basic body op → bool → modifier convention, its mandatory boundary
comments, and the sketch/geometry/primitive tier rules.