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

cutThruAll failure #355

Closed
adam-urbanczyk opened this issue May 21, 2020 · 2 comments · Fixed by #604
Closed

cutThruAll failure #355

adam-urbanczyk opened this issue May 21, 2020 · 2 comments · Fixed by #604
Labels
bug Something isn't working Priority:high

Comments

@adam-urbanczyk
Copy link
Member

The following code fails:

import cadquery as cq

sphere_r = 10.

result = (cq.Workplane("XY").sphere(sphere_r)
            .workplane(centerOption="ProjectedOrigin").circle(sphere_r / 2.).cutThruAll()
            .workplane(centerOption="ProjectedOrigin").transformed(rotate=(90, 0, 0))
            .circle(sphere_r / 2.).cutThruAll()
            .workplane(centerOption="ProjectedOrigin").transformed(rotate=(0, 90, 0))
            .circle(sphere_r / 2.).cutThruAll()
            .workplane(centerOption="ProjectedOrigin").circle(sphere_r / 2.).extrude(sphere_r + 2, both=True))

perturbaing one of the angles makes it work

import cadquery as cq

sphere_r = 10.

result = (cq.Workplane("XY").sphere(sphere_r)
            .workplane(centerOption="ProjectedOrigin").circle(sphere_r / 2.).cutThruAll()
            .workplane(centerOption="ProjectedOrigin").transformed(rotate=(90, 0, 0))
            .circle(sphere_r / 2.).cutThruAll()
            .workplane(centerOption="ProjectedOrigin").transformed(rotate=(0, 89.9, 0))
            .circle(sphere_r / 2.).cutThruAll()
            .workplane(centerOption="ProjectedOrigin").circle(sphere_r / 2.).extrude(sphere_r + 2, both=True))

show_object(result)
@adam-urbanczyk adam-urbanczyk added the bug Something isn't working label May 21, 2020
@RubenRubens
Copy link
Contributor

None of this works now. Using an old release (CQ-editor compiled for Windows) the second code works as expected.

Error code

Traceback (most recent call last):
  File "/testing/src/cutThruAll/C2.py", line 7, in <module>
    result = (cq.Workplane("XY").sphere(sphere_r)
  File "/cadquery/cadquery/cq.py", line 3105, in cutThruAll
    faceRef = sel2.filter(faces)[0]
  File "/cadquery/cadquery/selectors.py", line 103, in filter
    return [min(objectList, key=dist)]
ValueError: min() arg is an empty sequence

Tested with (almost) the latest release using Docker. Find the docker image here.

@adam-urbanczyk
Copy link
Member Author

Thanks, will try to fix this ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority:high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants