Skip to content

History support for wire#2055

Open
adam-urbanczyk wants to merge 7 commits into
masterfrom
wire-history
Open

History support for wire#2055
adam-urbanczyk wants to merge 7 commits into
masterfrom
wire-history

Conversation

@adam-urbanczyk

@adam-urbanczyk adam-urbanczyk commented Jun 26, 2026

Copy link
Copy Markdown
Member

NB: this required manual implementation due to lack of proper support on the OCCT side. The interface is there, but it does not return anything.

NB2: also includes more robust implementation with edge reordering.

@adam-urbanczyk adam-urbanczyk marked this pull request as draft June 26, 2026 10:26
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.78%. Comparing base (09773f4) to head (5e8b9bb).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2055      +/-   ##
==========================================
+ Coverage   95.76%   95.78%   +0.02%     
==========================================
  Files          30       30              
  Lines        9376     9425      +49     
  Branches     1395     1403       +8     
==========================================
+ Hits         8979     9028      +49     
  Misses        242      242              
  Partials      155      155              

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

@adam-urbanczyk adam-urbanczyk marked this pull request as ready for review June 26, 2026 20:23

@lorenzncode lorenzncode left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One potential issue with history is handling failed operations. Currently it's inconsistent as in this example:

from cadquery.func import *

empty_history = History()
try:
    wire([], history=empty_history)
except Exception:
    pass

disconnected_history = History()
try:
    wire(
        [
            segment((0, 0), (1, 0)),
            segment((5, 0), (6, 0)),
        ],
        history=disconnected_history,
    )
except Exception:
    pass

print(len(empty_history.ops))  # 1
print(len(disconnected_history.ops))  # 0

Should history be committed only on success?

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