History support for wire#2055
Open
adam-urbanczyk wants to merge 7 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
lorenzncode
reviewed
Jun 27, 2026
lorenzncode
left a comment
Member
There was a problem hiding this comment.
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)) # 0Should history be committed only on success?
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.
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.