You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
Is it possible to add a third dimension to the function?(z height)
Something like:
polygon = [(0,1,2), (-1, 0, 2.5), (0, -1, 2.5), (1, 0, 2)]
I tried it but get the error:
triangles = tripy.earclip(polygon)
File "C:\Users\SEKRSV\AppData\Local\Programs\Python\Python36\lib\site-packages\tripy.py", line 30, in earclip
polygon = [Point(*point) for point in polygon]
File "C:\Users\SEKRSV\AppData\Local\Programs\Python\Python36\lib\site-packages\tripy.py", line 30, in <listcomp>
polygon = [Point(*point) for point in polygon]
TypeError: __new__() takes 3 positional arguments but 4 were given
The text was updated successfully, but these errors were encountered:
The problem in 3D space is quite a bit more complicated than on a single plane. While technically one can calculate the area of a triangle in 3D space with nearly as much ease as 2D, the surface itself depends on the points chosen. At a first glance I think this would be far more complicated than this library would provide.
However, for this class of problem in 3D you might want to look into Delaunay triangulation:
Hi!
Is it possible to add a third dimension to the function?(z height)
Something like:
polygon = [(0,1,2), (-1, 0, 2.5), (0, -1, 2.5), (1, 0, 2)]
I tried it but get the error:
triangles = tripy.earclip(polygon)
The text was updated successfully, but these errors were encountered: