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
|
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.72% 95.72%
=======================================
Files 30 30
Lines 9533 9540 +7
Branches 1421 1423 +2
=======================================
+ Hits 9125 9132 +7
Misses 253 253
Partials 155 155 ☔ 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. |
|
Thanks for the update, @adam-urbanczyk — completely understand wanting to settle the naming/scope internally before this goes in, no rush at all. Happy to adapt the PR to whatever you land on. A couple of things I can do in the meantime if useful:
I'll leave it in draft for now. Just ping me when you've settled on a direction and I'll turn it around quickly. |
…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.
8848bf4 to
0ad3370
Compare
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)