Strategy gap: no top-down decomposition into body + features (largest whole shape, then features) #33
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#33
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?
Missing top-down strategy: find the largest whole shape first, then decompose into features
What
pc2cad.pycurrently runs a purely bottom-up analytic fit: itsegments the point cloud, fits primitives to each segment, and
emits a flat list of
plane/cylinder/cone/sphereprimitives plus per-plane
profile_extrudefallbacks. There is notop-down pass that asks "what is the overall shape of this object?"
The user-facing impact: for any compound shape (a prismatic part, a
turned part, a housing with a boss and a counterbore), the output
is a list of independent primitives that don't compose into a
coherent solid. There's no concept of "this is the main body"
versus "these are the features cut into the body." The build123d
export path then has no body to subtract features from, so it
falls back to either dropping the features or producing a stack of
independent slabs.
The pipeline has pieces of a top-down strategy scattered through
the code (
detect_planar_pockets,detect_chamfers,detect_fillets, slot detection, hole detection), but they'reapplied as independent bottom-up passes on the primitive list
rather than as steps in a single coherent body-then-features
workflow.
Reproduction
Run the pipeline on any compound mechanical sample (e.g.
samples/sample_plane_cyl.ply, theMerge_01_pc.plyRevopointscan) and inspect the report's primitive list. The list is a flat
set of independent primitives; the report has no
body/featuresstructure.Expected
The fitter should produce a report with at least:
bodyprimitive (or small set) representing the overallsolid(s) of the object.
featureslist representing the cuts / additions on each body(holes, counterbores, pockets, slots, chamfers, fillets).
features into it.
Actual
Flat primitive list, no body/features structure, export produces
a stack of independent slabs or a freeform mesh with no feature
hierarchy.
Suggested fix (not for me to implement)
Add a top-down pass to
pc2cad.pythat runs after the analyticfit:
the most inliers and is the most "enclosing" shape — a plane
slab, a cylinder, etc.).
body.adjacency, inlier-count ratio, and intersection patterns with
the body.
already has
extrude/revolvefor the body and the booleanops (
cut,fuse) for the features.Related
need a strategy in order, to find the largest planar profile
extrusions, find the largest whole shapes, detect holes, gouges,
counterbores etc."