Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added metadata handling to Assembly.add method #1327

Merged
merged 3 commits into from
May 14, 2023
Merged

Conversation

jmwright
Copy link
Member

I am using the metadata Dictionary to create exploded assembly views by including a relative translation with each assembly component. The metadata works fine when adding Workplanes, but when sub-assemblies are added the metadata is not preserved. This PR adds a new Assembly.add() overload, along with the relevant code to save the metadata.

Closes #1321

@codecov
Copy link

codecov bot commented Apr 27, 2023

Codecov Report

Merging #1327 (3e2d1e1) into master (33bf83e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 3e2d1e1 differs from pull request most recent head 4771b8b. Consider uploading reports for the commit 4771b8b to get more accurate results

@@           Coverage Diff           @@
##           master    #1327   +/-   ##
=======================================
  Coverage   94.29%   94.29%           
=======================================
  Files          26       26           
  Lines        5575     5576    +1     
  Branches      950      950           
=======================================
+ Hits         5257     5258    +1     
  Misses        187      187           
  Partials      131      131           
Impacted Files Coverage Δ
cadquery/assembly.py 96.61% <100.00%> (+0.01%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@adam-urbanczyk adam-urbanczyk requested a review from lorenzncode May 5, 2023 06:29
Copy link
Member

@lorenzncode lorenzncode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the test.

add will override existing metadata if any. I suppose if override is not desired the metadata dicts can be merged manually before calling add.

@adam-urbanczyk adam-urbanczyk merged commit 0fc683c into master May 14, 2023
@adam-urbanczyk
Copy link
Member

Thanks @jmwright

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

metadata Is Not Preserved When Adding a Sub-Assembly
3 participants