cadquery
cadquery copied to clipboard
Free function api
A free function API for cq.Shape. Originally inspired by #1269.
The idea is to provide a low-level but reasonably user friendly API for cq.Shape
- [x] primitives
- [x] operations
- [x] bool op as operators
- [x] moved with multiple locations
- [ ] Overload for
*locs
- [ ] Overload for
- [ ] Location constructor improvements ?
- [x] additional factories ?
- [ ] tests
- [ ] docs
Codecov Report
Attention: Patch coverage is 99.23664% with 5 lines in your changes are missing coverage. Please review.
Project coverage is 95.04%. Comparing base (
99792e5) to head (066795c). Report is 2 commits behind head on master.
| Files | Patch % | Lines |
|---|---|---|
| cadquery/occ_impl/shapes.py | 99.18% | 3 Missing and 2 partials :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #1469 +/- ##
==========================================
+ Coverage 94.54% 95.04% +0.49%
==========================================
Files 28 28
Lines 5848 7202 +1354
Branches 1166 1572 +406
==========================================
+ Hits 5529 6845 +1316
- Misses 193 224 +31
- Partials 126 133 +7
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@lorenzncode will you have bandwidth/interest to look at this?
@adam-urbanczyk Yes, at first glance this looks very interesting. I'll find some time to take a look.
I started experimenting. It seems very easy to use! Can revolve be changed to accept Shell?
# https://groups.google.com/g/cadquery/c/B-9w-U3gs1M/m/YhwbkMYPCAAJ
from cadquery.occ_impl.shapes import spline, loft, revolve
pts0 = [(1, 1, 0), (1, 1, 1), (1.2, 0.7483, 2)]
pts1 = [(2, 2, 0), (2, 2, 1), (2.2, 1.7776, 2)]
edge0 = spline(pts0)
edge1 = spline(pts1)
sh0 = loft([edge0, edge1])
result = revolve(sh0, pts0[0], pts1[0], 180) # changed revolve _get Shell
I added shape normalization. For your example loft returns Face instead of Shell.
I think it is ready for a fist pass. Take a look at the new doc section to get a glimpse.
Very exciting new CQ development! I checked out the branch and started trying it out. Will play around with it more.
Thanks for all the work on this @adam-urbanczyk ! The examples run fine for me, and the code looks good.
Either in this PR or a separate PR, we will also need to update setup.py for the new multimethod version declaration. With version 1.9.1 I get an intermittent error. This means we will probably see some support issues after the next release where people did not upgrade their multimethod version or create a fresh environment.
OK, I think I resolved all the points. Let me know if you are OK with merging.
Thank you for the new API!
+1 to merge