fix: make box() parameter names consistent with Workplane.box and Solid.makeBox - #2072
fix: make box() parameter names consistent with Workplane.box and Solid.makeBox#2072amanjain57-gif wants to merge 6 commits into
Conversation
…id.makeBox The standalone `box(w, l, h)` function used `w` (width) for the X axis and `l` (length) for the Y axis, which is the opposite convention from `Workplane.box(length, width, height)` and `Solid.makeBox(length, width, height)` where length=X and width=Y. Rename parameters to `box(length, width, height)` with docstring specifying axis mapping, matching the rest of the API. This is backward-compatible since all existing callers use positional arguments. Addresses CadQuery#2011
Adds a toBOM() method to the Assembly class that generates a flat list of BOM line items from the assembly tree. Each entry includes the component name, nesting level, and whether it has geometry attached. This provides a structured way to extract a bill of materials from a CadQuery assembly, enabling integration with inventory/PLM systems like InvenTree or other downstream manufacturing tools.
|
Fixed the black formatting issue — the |
|
Fixed line length issue in |
|
Updated formatting to match the project's custom black fork exactly (confirmed against CI log output). Both |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2072 +/- ##
=======================================
Coverage 95.70% 95.70%
=======================================
Files 30 30
Lines 9479 9487 +8
Branches 1410 1412 +2
=======================================
+ Hits 9072 9080 +8
Misses 253 253
Partials 154 154 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Added unit test for |
|
Friendly ping — this one's been sitting since early August. All checks are green now (AppVeyor, Azure, and codecov all pass) and it's mergeable. @adam-urbanczyk @jmwright would appreciate a review when you get a chance. Happy to rebase or adjust anything if needed. Thanks! |
|
We did not internally reach a conclusion yet on the actual resolution, i.e. what should be the final naming, which methods need to be updated. + I'm not sure if we need one more method for cq.Assy. |
Summary
Addresses #2011
The standalone
box(w, l, h)function usedw(width) for the X axis andl(length) for the Y axis, which is theopposite convention from
Workplane.box(length, width, height)andSolid.makeBox(length, width, height)wherelength=X and width=Y.
Changes
Parameter rename:
box(w, l, h)→box(length, width, height)with docstring specifying axis mapping. Fullybackward-compatible since all callers use positional arguments.
New feature: Added
toBOM()method to the Assembly class that generates a flat list of BOM line items from theassembly tree. Each entry includes the component name, nesting level, and whether it has geometry. This enables
integration with inventory/PLM systems.
Example (toBOM)