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

Sketch - hull intersecting faces #943

Open
helmecke opened this issue Jan 1, 2022 · 0 comments
Open

Sketch - hull intersecting faces #943

helmecke opened this issue Jan 1, 2022 · 0 comments
Labels
bug Something isn't working sketching

Comments

@helmecke
Copy link

helmecke commented Jan 1, 2022

Getting ZeroDivisionError: float division by zero trying to hull intersecting faces.

Not working:

import cadquery as cq

r = cq.Sketch().circle(2).rarray(1, 5, 1, 2).circle(1).wires().hull()

show_object(r)

Failed workaround:

import cadquery as cq

r = cq.Sketch().circle(2).rarray(1, 5, 1, 2).circle(1.1, "s").circle(1).wires().hull()

show_object(r)

Working:

import cadquery as cq

r = cq.Sketch().circle(2).rarray(1, 7, 1, 2).circle(1).wires().hull()

show_object(r)

Stacktrace:

(cq) $ python 008.py      
Traceback (most recent call last):
  File "/home/jakob/Git/github.com/helmecke/cadquery-models/exercises/008.py", line 11, in <module>
    r = cq.Sketch().circle(2).rarray(1, 5, 1, 2).circle(1).wires().hull()
  File "/home/jakob/.local/share/miniconda3/envs/cq/lib/python3.9/site-packages/cadquery/sketch.py", line 484, in hull
    rv = find_hull(el for el in self._faces.Edges())
  File "/home/jakob/.local/share/miniconda3/envs/cq/lib/python3.9/site-packages/cadquery/hull.py", line 395, in find_hull
    angle, segment = get_angle(current_e, e)
  File "/home/jakob/.local/share/miniconda3/envs/cq/lib/python3.9/site-packages/cadquery/hull.py", line 312, in get_angle
    return arc_arc(current, e)
  File "/home/jakob/.local/share/miniconda3/envs/cq/lib/python3.9/site-packages/cadquery/hull.py", line 262, in arc_arc
    dx /= l
ZeroDivisionError: float division by zero
@adam-urbanczyk adam-urbanczyk added bug Something isn't working sketching labels Jan 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sketching
Projects
None yet
Development

No branches or pull requests

2 participants