Migrate export_step / export_stl / export_brep off FreeCAD, onto build123d + OCP — Phase 1: Rewrite _primitive_to_shape to use OCP constructors #41
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#41
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?
Phase 1: Rewrite
_primitive_to_shapeto use OCP constructorsGoal: Replace
pc2cad.py:3592 _primitive_to_shape(FreeCAD, Part, primitive)with an OCP-only equivalent that does not take FreeCAD/Part as parameters.
This is the per-primitive shape constructor every boolean and export op
funnels through, so it is the choke point.
Approach:
BRepPrimAPI_MakeSphere(center, radius).Shape()BRepPrimAPI_MakeCylinder(axis_point, axis_dir, radius, height).Shape()BRepPrimAPI_MakeCone(...)(derive base/apex from primitive)BRepBuilderAPI_MakeFacefrom the polygon'sPoly_Triangulationor from the inlier-hull polygon as aTopoDS_Wireon a plane.
_primitive_to_shape(primitive: Primitive) -> TopoDS_Shape.Drop the FreeCAD, Part params.
Files:
pc2cad.py:3592-3690(rewrite_primitive_to_shape),pc2cad.py:3583-3591(delete_freecad_import).Acceptance:
git grep "def _primitive_to_shape" pc2cad.pyshows the new signature.signature; lint passes.
Decomposed from pc2cad#23