fix: make box() parameter names consistent with Workplane.box and Solid.makeBox#2072
Open
amanjain57-gif wants to merge 2 commits into
Open
fix: make box() parameter names consistent with Workplane.box and Solid.makeBox#2072amanjain57-gif wants to merge 2 commits into
amanjain57-gif wants to merge 2 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)