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

Implement makeSplineApprox for edges and faces #694

Merged
merged 23 commits into from
Mar 31, 2021
Merged

Conversation

adam-urbanczyk
Copy link
Member

@adam-urbanczyk adam-urbanczyk commented Mar 17, 2021

Will resolve #682

  • implement Edge.makeSplineApprox
  • implement Face.makeSplineApprox
  • rework parametricCurve
  • implement parametricSurface
  • implement Edge.close
  • add splineAppox to the CQ API
  • BRepAlgoAPI_Splitter and rework Workplane.split

Also related to #675

@adam-urbanczyk adam-urbanczyk marked this pull request as draft March 17, 2021 07:58
@codecov
Copy link

codecov bot commented Mar 17, 2021

Codecov Report

Merging #694 (0e136fb) into master (d5ce132) will increase coverage by 0.11%.
The diff coverage is 100.00%.

❗ Current head 0e136fb differs from pull request most recent head 7a259be. Consider uploading reports for the commit 7a259be to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #694      +/-   ##
==========================================
+ Coverage   94.41%   94.52%   +0.11%     
==========================================
  Files          31       32       +1     
  Lines        6909     7071     +162     
  Branches      740      766      +26     
==========================================
+ Hits         6523     6684     +161     
- Misses        252      254       +2     
+ Partials      134      133       -1     
Impacted Files Coverage Δ
cadquery/occ_impl/geom.py 88.96% <ø> (ø)
cadquery/selectors.py 98.14% <ø> (ø)
cadquery/assembly.py 90.54% <100.00%> (ø)
cadquery/cq.py 91.32% <100.00%> (+0.26%) ⬆️
cadquery/occ_impl/shapes.py 92.53% <100.00%> (+0.30%) ⬆️
tests/naca.py 100.00% <100.00%> (ø)
tests/test_assembly.py 100.00% <100.00%> (ø)
tests/test_cadquery.py 99.17% <100.00%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d5ce132...7a259be. Read the comment docs.

@marcus7070
Copy link
Member

Will Shape.split let me split a Wire with a Vertex?

I have needed to do that before, when making a ruled surface between a Wire with 4 edges and a spline with one edge. I needed to add 3 more vertices at certain locations on the spline. It was awkward and being able to split wires would be great improvement!

@adam-urbanczyk
Copy link
Member Author

adam-urbanczyk commented Mar 25, 2021

Will Shape.split let me split a Wire with a Vertex?

I have needed to do that before, when making a ruled surface between a Wire with 4 edges and a spline with one edge. I needed to add 3 more vertices at certain locations on the spline. It was awkward and being able to split wires would be great improvement!

I did a quick check and it seems to work.

@adam-urbanczyk adam-urbanczyk marked this pull request as ready for review March 25, 2021 17:24
@marcus7070
Copy link
Member

I pushed two more tests. Feel free to revert if you don't want them, it was just easier to write the code than suggest them in comments.

Copy link
Member

@marcus7070 marcus7070 left a comment

Choose a reason for hiding this comment

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

I've still got more to look at here, I'll try to get back to it later today.

cadquery/cq.py Outdated Show resolved Hide resolved
cadquery/occ_impl/shapes.py Outdated Show resolved Hide resolved
@marcus7070
Copy link
Member

@adam-urbanczyk pushed some 500 lines of code without needing the "black fix" commit, I push like 15 LOC and mess up the streak. 🤦

@marcus7070
Copy link
Member

marcus7070 commented Mar 28, 2021

I don't think we test splitting with multiple tool Shapes? edit: referring to the Shape.split method, not Workplane.split

Thinking about that some more, I'm ok with not testing it. I can't actually think of when I would ever split with multiple tools, I think it's a bit of an edge case.

edit: Added a test for this case below.

cadquery/cq.py Show resolved Hide resolved
Co-authored-by: Marcus Boyd <[email protected]>
cadquery/cq.py Outdated Show resolved Hide resolved
tests/test_cadquery.py Outdated Show resolved Hide resolved
Copy link
Member

@jmwright jmwright left a comment

Choose a reason for hiding this comment

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

Thanks @adam-urbanczyk this was a lot of work. I just had a few minor comments.

@adam-urbanczyk
Copy link
Member Author

OK, I think this is ready to be merged.

@jmwright
Copy link
Member

@adam-urbanczyk Thanks again!

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.

Expose GeomAPI_PointsToBSplineSurface
3 participants