Bug C: pc2cad does not route organic vs mechanical scans differently #49
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#49
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 does not route organic vs mechanical scans differently
What is missing
pc2cad.pyruns the same fitting pipeline on every input. For apure-organic scan (e.g.
samples/organic_bunny.ply, 100k+ points),RANSAC primitives are mostly noise — the right output is the Poisson
freeform mesh (
export_residual_mesh), not a primitive list. For amechanical scan with sharp edges and cylindrical faces, the right
output is RANSAC primitives plus feature cuts (Bug A).
Currently both inputs go through the same fitting pipeline and
produce mediocre results on both:
samples/organic_bunny.ply→ flat primitive list, even thoughprimitive coverage is < 30% and Poisson would explain > 95%
samples/strategy_plate_with_hole.ply→ freeform mesh fallback,even though RANSAC primitives would explain > 85%
There is no
classify_scan(pointcloud) -> "organic" | "mechanical" | "mixed"that gates the routing decision, and no strategy that usesthe classification to pick a fitting path.
This is a strategy gap (no scan-classification / routing
algorithm exists), not a function bug (the fitter works on the
samples it was tested on).
Sample
Organic side:
samples/organic_bunny.ply(existing on disk)Mechanical side:
samples/strategy_plate_with_hole.plyandsamples/strategy_l_bracket.ply(commitb239497)What a real fix has to produce
A
classify_scan(pointcloud) -> dictthat returns at minimum{"type": "organic" | "mechanical" | "mixed", "confidence": float, features: {...}}. A strategy router (route_strategy(classification, config)) that picks between freeform-Poisson, primitive+features, orhybrid pipelines based on classification. Wire the router into the
top-level
fit_primitives(or a newreconstruct_pointcloud) entrypoint so the CLI gets the right output without manual flags.
Acceptance — agentic / visual verification
The implementer must run both commands and attach both output
PNGs and metrics to the closing comment:
The closing comment must include:
/tmp/bug_C_bunny/side_by_side.pngand/tmp/bug_C_plate/side_by_side.pngmetrics.jsonfeature(s) triggered the routing decision and which pipeline path
was taken.
A commit that ships
classify_scanbut does not wire it into the CLIdefault path is not a real fix — the bug is about routing, and
routing that the user has to opt into via a flag does not address
it.
Why this is a strategy gap and not a function bug
The current pipeline works on samples it was tuned for. The gap is
that there is no per-scan decision about which strategy to apply. A
real fix requires a classification + routing layer that is on by
default.
Related
How to regenerate the synthetic 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.