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

Fix sketch solver line_point method relative/absolute mixup #1336

Merged
merged 2 commits into from
Jun 17, 2023

Conversation

voneiden
Copy link
Contributor

Closes #1127

@codecov
Copy link

codecov bot commented May 20, 2023

Codecov Report

Merging #1336 (04d4571) into master (7143ead) will decrease coverage by 0.15%.
The diff coverage is 100.00%.

❗ Current head 04d4571 differs from pull request most recent head 62d2a4c. Consider uploading reports for the commit 62d2a4c to get more accurate results

@@            Coverage Diff             @@
##           master    #1336      +/-   ##
==========================================
- Coverage   94.30%   94.16%   -0.15%     
==========================================
  Files          26       26              
  Lines        5584     5584              
  Branches      954      954              
==========================================
- Hits         5266     5258       -8     
- Misses        187      194       +7     
- Partials      131      132       +1     
Impacted Files Coverage Δ
cadquery/occ_impl/sketch_solver.py 91.19% <100.00%> (ø)

... and 3 files with indirect coverage changes

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

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.

The fix itself looks good.

There is an assert missing here in the tests:

(midpoint - seg1.startPoint()).Length == approx(2)

I'd suggest to add the assert to line 643. It should be sufficient for testing the fix.

    assert (midpoint - seg1.startPoint()).Length == approx(2)

I've added a comment regarding the new pytest with sketch "s8". Since the sketch solver is experimental, it might be easier to keep the tests simple (skip adding the new test) since rework may be required later. @voneiden , @adam-urbanczyk , if you disagree and want to keep the additional test please disregard that item.

tests/test_sketch.py Outdated Show resolved Hide resolved
Enable assert that fails without the fix ( issue CadQuery#1127 )
@voneiden
Copy link
Contributor Author

There we go, verified that the assert is indeed enough to test this fix.

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.

Thanks @voneiden!

@voneiden
Copy link
Contributor Author

Was that an accidental wrong branch for your commit 62d2a4c @adam-urbanczyk ?

@adam-urbanczyk
Copy link
Member

It was on purpose - trying to fix appveyor

@adam-urbanczyk
Copy link
Member

Green, thanks @voneiden !

@adam-urbanczyk adam-urbanczyk merged commit b96eb8a into CadQuery:master Jun 17, 2023
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.

sketch_solver.line_point has incorrect implementation?
3 participants