Skip to content

3D possible? #4

@sweco-sekrsv

Description

@sweco-sekrsv

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions