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

Error when trying to intersect 2 Spheres (Python) #42

Open
henryJack opened this issue Jun 19, 2018 · 0 comments
Open

Error when trying to intersect 2 Spheres (Python) #42

henryJack opened this issue Jun 19, 2018 · 0 comments

Comments

@henryJack
Copy link

I'm using the python version of verb. It seems to work great (although the whole module being compiled into on file is a little weird)
However, I've got an issue when trying to intersect two spheres. If you run the following...

from build.verb import verb_geom_Intersect as Intersect
from build.verb import verb_geom_SphericalSurface as SphericalSurface

sphere_1 = SphericalSurface(center=[1, 2, 3], radius=5)
sphere_2 = SphericalSurface(center=[1, 2, 4], radius=5)

result = Intersect.surfaces(sphere_1, sphere_2)

You get the following error...

verb 2.1.0
Traceback (most recent call last):
  File "C:/dev/verb/build/intersection_example.py", line 121, in <module>
    result = Intersect.surfaces(srf1, srf2, 1e-6)
  File "C:\dev\verb\build\verb.py", line 10121, in surfaces
    return _hx_local_1()
  File "C:\dev\verb\build\verb.py", line 10120, in _hx_local_1
    return list(map(_hx_local_0,verb_eval_Intersect.surfaces(first.asNurbs(),second.asNurbs(),tol)))
  File "C:\dev\verb\build\verb.py", line 7085, in surfaces
    tess1 = verb_eval_Tess.rationalSurfaceAdaptive(surface0)
  File "C:\dev\verb\build\verb.py", line 9025, in rationalSurfaceAdaptive
    arrTrees = verb_eval_Tess.divideRationalSurfaceAdaptive(surface,options)
  File "C:\dev\verb\build\verb.py", line 8947, in divideRationalSurfaceAdaptive
    norm = verb_core_Vec.normalized(verb_core_Vec.cross(python_internal_ArrayImpl._get((ds[0] if 0 < len(ds) else None), 1),python_internal_ArrayImpl._get((ds[1] if 1 < len(ds) else None), 0)))
  File "C:\dev\verb\build\verb.py", line 5408, in normalized
    return verb_core_Vec.div(arr,verb_core_Vec.norm(arr))
  File "C:\dev\verb\build\verb.py", line 5603, in div
    _g.append(((a[i] if i >= 0 and i < len(a) else None) / b))
ZeroDivisionError: float division by zero

Any Ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant