CadQuery / CadQuery/cadquery

Cutting a cylinder with helix sweep result in "Compound is empty"

Open
#1,437 4 comments 0 reactions 0 assignees View on GitHub
OCC kernel issue
Dominant language
Python
Stars
5.8k
Forks
541
Avg merge
3d 2h
Merged PRs (30d)
5

Description

Hi I am trying to create an auger-shaped marble run lift with the following code, but when running it with latest cadquery it always yield an error: ValueError: Compound is empty

The code:
```
import cadquery as cq
from ocp_vscode import *

r = 18 # Radius of the helix
p = 18 # Pitch of the helix
h = 30 # Height of the helix

wire = cq.Wire.makeHelix(pitch=p, height=h, radius=r)
helix = cq.Workplane(obj=wire)
marble_track = (
cq.Workplane('XZ')
.center(r, 0)
.circle(8)
.sweep(helix)
)

post = cq.Workplane().cylinder(h, 22)

result = post.cut(marble_track)

show(result)
```

I visually inspected the marble_track & the post individually, they seem to be correct, but don't know why cutting the marble_track from the post would return empty compound.

I tried to cut the other way around to figure out what's going on, I.E. result = marble_track.cut(post), this time it yields something really weird.

![image](https://github.com/CadQuery/cadquery/assets/634161/261e28a7-03dd-4a78-917e-b0fc5a3108cc)

After getting some help from anderson.pa in discord #general channel, change the post to be z-flush would make it render: `post = cq.Workplane().cylinder(h, 22, centered=(True, True, False))`, but change wire to a bigger height or change the post to smaller radius(18) would cause it to fail.

So it seems to be a bug particular to the helix sweep.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.