Skip to content

Sketch - hull intersecting faces #943

Description

@helmecke

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions