pc2cad_profile.extract_profile_sketches helper bypassed by the default step export path #35
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#35
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?
pc2cad_profile.py::extract_profile_sketchesnot invoked from the CLI workflow for organic / real-scan inputsWhat
pc2cad_profile.pyis the build123d helper that turns detectedprofile features (profile_extrude / profile_revolve primitives)
into
build123d.Sketchrecords, with arc-vs-line decomposition,sagitta-based consistency checks, and axisymmetry heuristics
(see
_polygon_to_edges,_arc_is_consistent,_is_axisymmetric,_build_sketch_from_edges, andextract_profile_sketches).The CLI (
pc2cad_cli.py::_export_build123d, line 445) invokesthis helper when
--out-format build123dis selected, but onlyfor the
build123dexport path. For the defaultstepexportand for the analytic / freeform hybrid path on real scans, the
helper is bypassed. The freeform Poisson mesh and the analytic
primitives are exported without ever running the build123d
profile extraction.
The user-facing impact: even on samples that have profile
features (a planar polygon with a depth, a revolve profile),
the export never goes through the build123d helper that knows
how to build a clean
Sketchfrom the polygon's edge list.The default
stepexport path is the one that needs thehelper the most (it's the path that should produce real CAD),
but it's the one that skips it.
The user noted on 2026-06-20: "at some point you stopped using
the helper and that is tedious." The helper exists, is fully
implemented, and is being skipped.
Reproduction
Expected
The build123d helper should be the primary export path for
profile_extrude / profile_revolve primitives, regardless of the
output format. The
stepandbrepexporters should consumeProfileSketchrecords (or equivalent) rather than rawPrimitivelists.Actual
The helper is wired only into the
build123dexport format. Thedefault
steppath goes through the FreeCAD / OCP path thatcurrently produces placeholders (see pc2cad#23). The build123d
path works for
profile_extrudeprimitives but is bypassedentirely for organic / freeform samples.
Suggested fix (not for me to implement)
export_step(and the other analytic export paths)to call
extract_profile_sketchesfirst and use the resultingProfileSketchrecords as the primary input.profile_extrude/profile_revolveprimitives (the freeform-only case), fall back to the
Poisson-mesh path (or the analytic fallback, once the strategy
bugs above are addressed).
Related
build123d helper can be the primary path)