Skip to content

More free functions#2038

Merged
adam-urbanczyk merged 53 commits into
masterfrom
adam-shapes-parity
Jun 17, 2026
Merged

More free functions#2038
adam-urbanczyk merged 53 commits into
masterfrom
adam-shapes-parity

Conversation

@adam-urbanczyk

@adam-urbanczyk adam-urbanczyk commented May 22, 2026

Copy link
Copy Markdown
Member

This PR should reach (rough) feature parity with Shape.* Closes #1812

  • prism
  • hollow
  • offset2D
  • fillet2D
  • draft
  • set ops for combining selectors

This enables e.g.
selection = f.outerWire() & f.edges('|X')

  • history

Big experimental change. Added a History and Op class. History instance can be passed now to many ops via history= kwarg. Name for the operation can be specified via name=. It can be later queried like so:

h = History()

f = plane(1,1)
res = extrude(f, (0,0,1), history=h, name='ex')

top = h['ex'].last()
side = h[-1].generated(f.edges())
  • tests
  • docs

@adam-urbanczyk adam-urbanczyk marked this pull request as draft May 22, 2026 17:42
@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.46835% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.66%. Comparing base (8c17892) to head (d724fc6).

Files with missing lines Patch % Lines
cadquery/occ_impl/shapes.py 97.43% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2038      +/-   ##
==========================================
+ Coverage   95.64%   95.66%   +0.01%     
==========================================
  Files          30       30              
  Lines        8962     9040      +78     
  Branches     1328     1344      +16     
==========================================
+ Hits         8572     8648      +76     
- Misses        240      241       +1     
- Partials      150      151       +1     

☔ 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.

@codecov

codecov Bot commented May 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.23009% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.75%. Comparing base (8c17892) to head (225834c).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
cadquery/occ_impl/shapes.py 98.21% 2 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2038      +/-   ##
==========================================
+ Coverage   95.64%   95.75%   +0.10%     
==========================================
  Files          30       30              
  Lines        8962     9356     +394     
  Branches     1328     1391      +63     
==========================================
+ Hits         8572     8959     +387     
- Misses        240      242       +2     
- Partials      150      155       +5     

☔ View full report in Codecov by Harness.
📢 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 jmwright mentioned this pull request Jun 5, 2026
4 tasks
@jmwright

Copy link
Copy Markdown
Member

@adam-urbanczyk Are the 2D operations ever going to get the history feature?

Comment thread doc/primer.rst
Comment thread cadquery/occ_impl/shapes.py Outdated
Comment thread cadquery/occ_impl/shapes.py
Comment thread cadquery/occ_impl/shapes.py Outdated
Comment thread cadquery/occ_impl/shapes.py Outdated
Comment thread cadquery/occ_impl/shapes.py Outdated
Comment thread cadquery/func.py Outdated
Comment thread cadquery/func.py Outdated
@adam-urbanczyk

Copy link
Copy Markdown
Member Author

@adam-urbanczyk Are the 2D operations ever going to get the history feature?

I think so, but not in this PR. I quickly tried, but got some issues that need to be investigated.

@adam-urbanczyk

Copy link
Copy Markdown
Member Author

OK, if the latest commit is green, I'm going to merge this. NB: RTD stopped reporting status (but builds fine), not sure how to solve ATM.

@adam-urbanczyk adam-urbanczyk merged commit c0734b3 into master Jun 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature parity with cq.Shape methods

3 participants