Bug A: pc2cad has no top-down body+features decomposition #47
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#47
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?
Strategy gap: pc2cad has no top-down body+features decomposition
What is missing
pc2cad.py::_fit_primitives_on_pointsreturns a flat list of primitives.There is no algorithm that takes the input pointcloud, decides which
primitive is the body, and which primitives are features to
boolean-cut from the body. The export path (
export_step,export_stl,export_brep) consumes the flat list and emits eachprimitive as a separate solid or compound member.
_derive_profile_features_from_sectionsexists but handles exactly onenarrow case: a single plane profile with a revolve operation. It is not
a general body+features composition.
_collect_feature_toolsiterates feature primitives (holes, fillets,chamfers, slots) but it does so independently of body identification
— it does not ask "which primitive owns this feature?" or "does this
feature lie inside the body's bounding volume?". This is the root
cause of pc2cad#34 (closed without a real strategy fix in commit
404f173— the verify step doesn't address the strategy gap).Sample
samples/strategy_plate_with_hole.ply(7000 points, σ=0.2 mm)Parametric ground truth (build123d):
the four top edges
samples/specs/strategy_plate_with_hole_spec.pysamples/strategy_l_bracket.ply(9000 points, σ=0.3 mm)Parametric ground truth (build123d):
inner corner, 1 mm chamfer on the four outer top edges
samples/specs/strategy_l_bracket_spec.pyWhat a real fix has to produce
A new module (e.g.
pc2cad_reconstruct.py) that consumesfit_primitives(...)output and emits aReconstructionstructurewith explicit
bodyandfeaturesfields. The export path mustconsume this structure and produce a STEP that contains one solid
per reconstruction, not one solid per primitive.
Acceptance — agentic / visual verification
The implementer must run this command and attach both output PNGs to
the closing comment:
Both commands must report
coverage ≥ 0.85(plate) andcoverage ≥ 0.80(bracket), AND the closing comment must include:/tmp/bug_A_plate/side_by_side.pngand/tmp/bug_A_bracket/side_by_side.pngprimitive"
composition is real (e.g. by reading the build123d spec and
computing the boolean difference between the emitted STEP and the
ground truth)
A commit that ships a
compose_body_with_featuresfunction but doesnot demonstrate ≥85% coverage on the plate sample with the rendered
PNGs is not a real fix — closing requires both the unit test and
the visual/behavioral evidence.
Why this is a strategy gap and not a function bug
Previous pc2cad strategy bugs (#32 "profile-extrude does not compose
compound shapes", #33 "no top-down decomposition into body + features")
were closed by commit-level workarounds (CLI flags, fallback commits)
that did not change the underlying capability. This bug describes the
underlying capability gap: there is no algorithm in pc2cad that
identifies a body primitive and routes features against it. Closing
this bug requires that algorithm to exist and to be demonstrably
correct on both synthetic samples.
Related
organic vs mechanical routing) target adjacent strategy gaps
How to regenerate the samples
Cross-references — related strategy bugs
This bug is part of a four-bug batch on the pc2cad reconstruction
strategy gaps. They are designed to be solved together because each
one's verification gate depends on the harness from Bug D and the
synthetic samples from Bug A.
Closing this bug requires running the verification commands in its body
and attaching the resulting side-by-side PNGs to the closing comment.
Closing any of A/B/C without Bug D's harness producing falsifiable
evidence is a workaround, not a fix.