-
Notifications
You must be signed in to change notification settings - Fork 299
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
Sketch.hull() causes a ZeroDivisionError instead of some guidance around what was done wrong #1224
Comments
not exactly the same problem, but I had trouble using out = cq.Sketch().circle(rod_d / 2 + wall_t).push([mount_loc]).circle(mount_d / 2 + wall_t).edges().hull() which is basically a big and small circle that intersect each other. using hull produced this error:
where After messing around a bit, I solved my issue (without understanding the code too much, just messing and observe what works) with this commit. Possibly this could help you. |
AFAICT the issue occurs only with intersecting circles. Do you confirm? |
I think the issue is with concentric arcs (haven't tested yet, I could do that tomorrow), and intersecting circles would be one instance of that |
I tried to come up with other scenarios, but they don't seem to hit the same code path as 2 intersecting circles (haven't dug deeper to see what's actually going on). Two things I tried: cq.Sketch().circle(5).push([(5, 0)]).rect(10, 10, mode="i").reset().circle(2).hull() # concentric big semi + small circle
cq.Sketch().arc((0, 0), 5, 0, 180).arc((0, 0), 5, 180, 360).reset().edges().hull()) # 2 halves of a circle |
Hi. I've ran into problems with hull() when working on a model. I did a bit of testing with intersecting circles. The samples and code are here:
There are 4 equidistant circles (on a square). I place a single shape in the middle. Whenever the center circle is intersecting or is tangent to the others, the code fails. However, a new issue shows up when using a rectangle in the center. If the rectangle is not intersecting, but has sides bigger than gap between the circles (d-2*r) the code falls into an infinite loop. This behavior is not present when placing a similar sized circle. Maybe this is some new info to work with |
To Reproduce
I was going through the Sketch tutorial, and playing around with hull(), and encountered this error. What am I doing wrong in this script below?
This is the model right before the
hull()
invocation above:Backtrace
Environment
OS: MacOS Ventura 13.0.1
Was CadQuery installed using Conda?: Yes
Output of
conda list
from your active Conda environment:Using: jupyter-cadquery on Jupyter Notebook
The text was updated successfully, but these errors were encountered: