Skip to content

Add STEP Import for Assemblies #1779

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

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft

Add STEP Import for Assemblies #1779

wants to merge 15 commits into from

Conversation

jmwright
Copy link
Member

@jmwright jmwright commented Feb 26, 2025

The goal is to make it possible to round-trip assemblies to and from STEP without loss of data. This data can include:

  • Part location
  • Part color
  • Sub-assembly location
  • Sub-assembly colors
  • Face labels
  • Face colors

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 85.18519% with 12 lines in your changes missing coverage. Please review.

Project coverage is 95.42%. Comparing base (8c68faa) to head (687bc2b).

Files with missing lines Patch % Lines
cadquery/occ_impl/importers/assembly.py 82.60% 7 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1779      +/-   ##
==========================================
- Coverage   95.54%   95.42%   -0.12%     
==========================================
  Files          28       29       +1     
  Lines        7319     7396      +77     
  Branches     1102     1114      +12     
==========================================
+ Hits         6993     7058      +65     
- Misses        195      202       +7     
- Partials      131      136       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jmwright
Copy link
Member Author

@adam-urbanczyk In 4045c58 you set the cadquery.Assembly.importStep method up to be a class method, and you construct assy before calling the lower-level method. However, since the Assembly.name property is private and can only be set during instantiation, this creates an issue for me. I need to be able to set the top-level assembly name based on the name set in the STEP file, which requires me to set the name property after instantiation.

We need to decide on the proper way to fix this.

@adam-urbanczyk
Copy link
Member

Hey, I do not understand the issue. You can always do this:

assy = Assembly()
assy.name = '123'

Do you mean that you need to modify AssemblyProtocol to satisify mypy? That also does not sound like an issue to me.

@jmwright
Copy link
Member Author

Correct, mypy complains. I can make that change to make name a public property if you don't see an issue with doing so.

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.

2 participants