Skip to content

Zero Division Error calling computeDelaunayTriangulation function #1

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

Open
csotomon opened this issue Feb 12, 2020 · 0 comments
Open

Comments

@csotomon
Copy link

Running the computeDelaunayTriangulation function with a 7.2 millions of point i am getting this error:

checking the code if "think" that the error is in the line 458 because s1.y and s2.y have the same value.

---------------------------------------------------------------------------
ZeroDivisionError                         Traceback (most recent call last)
<ipython-input-182-05f495d7c18c> in <module>
      1 # Delaunay Triangulation
----> 2 triangles = voronoi.computeDelaunayTriangulation(points)

/data/anaconda/envs/geo_env/lib/python3.8/site-packages/voronoi.py in computeDelaunayTriangulation(points)
    841     context  = Context()
    842     context.triangulate = True
--> 843     voronoi( siteList, context )
    844     return context.triangles
    845 

/data/anaconda/envs/geo_env/lib/python3.8/site-packages/voronoi.py in voronoi(siteList, context)
    257             # create a new edge that bisects
    258             bot  = lbnd.rightreg(bottomsite)
--> 259             edge = Edge.bisect(bot,newsite)
    260             context.outBisector(edge)
    261 

/data/anaconda/envs/geo_env/lib/python3.8/site-packages/voronoi.py in bisect(s1, s2)
    470             # set formula of line, with y fixed to 1
    471             newedge.b = 1.0
--> 472             newedge.a = dx/dy
    473             newedge.c /= dy
    474 

ZeroDivisionError: float division by zero
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