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

Add shape and workplane support to the Workplane.eachpoint() function. Issue #1395 #1578

Merged
merged 9 commits into from May 13, 2024

Conversation

dov
Copy link
Contributor

@dov dov commented Apr 29, 2024

This PR solves issue #1395 and adds the ability to use the Workplane.eachpoint() function with a Shape and a Workplane.

Here are is an example for using a wire to do a cutThru():

wire = Wire.makeCircle(1, (0, 0, 0), (0, 0, 1))
result = (
    Workplane("XY")
    .box(10, 10, 1)
    .faces(">Z")
    .rect(7, 7, forConstruction=True)
    .vertices()
    .eachpoint(wire)
    .cutThruAll()
)

And here is an example for using another workplane, adding a sphere to the center of each face:

box = Workplane().box(2, 2, 2)
sph = Workplane().sphere(1.0)
# Place the sphere in the center of each box face
r = box.faces().eachpoint(sph, combine=True)

@dov dov changed the title Add shape and workplane support to the Workplane.pointeach() function. Issue #1395 Add shape and workplane support to the Workplane.eachpoint() function. Issue #1395 Apr 29, 2024
@dov dov force-pushed the foreach-shape-and-workplane branch from 0dd6765 to ddb6a3d Compare April 29, 2024 18:26
@adam-urbanczyk
Copy link
Member

@dov could you run black?

@DovXjet
Copy link

DovXjet commented May 5, 2024

@adam-urbanczyk Ok. I just did. It isn't trivial since the rest of the files are not compliant.

(However, I just found "darken", which makes it easy).

Copy link

codecov bot commented May 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.86%. Comparing base (995d139) to head (8664c8e).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1578   +/-   ##
=======================================
  Coverage   94.85%   94.86%           
=======================================
  Files          28       28           
  Lines        6216     6226   +10     
  Branches     1251     1261   +10     
=======================================
+ Hits         5896     5906   +10     
  Misses        193      193           
  Partials      127      127           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jmwright
Copy link
Member

jmwright commented May 5, 2024

@dov The following command should show just what is needed to fix your changes.

black --diff --check .

@adam-urbanczyk adam-urbanczyk self-requested a review May 8, 2024 20:51
cadquery/cq.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 @dov I just had a couple of corrections to a comment. Otherwise it looks good.

Co-authored-by: Jeremy Wright <wrightjmf@gmail.com>
@jmwright jmwright merged commit f29f2d6 into CadQuery:master May 13, 2024
5 checks passed
@jmwright
Copy link
Member

Thanks @dov

@dov dov deleted the foreach-shape-and-workplane branch May 13, 2024 14:58
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.

None yet

4 participants