-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Hi,
We discovered with some colleagues by using different version of tripy that it was not able anymore to process some polygons that were supported in version 0.0.3.
Here is an example to reproduce the case.
import shapely.wkt
import numpy as np
import tripy
import matplotlib.pyplot as plt
if __name__ == '__main__':
polygon = shapely.wkt.loads("POLYGON ((2.3374803 48.87445059972346, 2.3374866 48.87444049972347, 2.3375329 48.87436569972348, 2.3375717 48.8743029997235, 2.3376836 48.87433219972348, 2.3378011 48.87436279972348, 2.3377983 48.87436709972348, 2.3377661 48.87441459972347, 2.337753 48.87441159972347, 2.3377382 48.87443419972345, 2.337751 48.87443809972346, 2.3377694 48.87443419972345, 2.3379195 48.87447389972345, 2.3380046 48.87471509972338, 2.3379528 48.87472209972339, 2.3379554 48.87472929972338, 2.337902 48.87473809972339, 2.3379056 48.87474939972338, 2.3377288 48.87477829972337, 2.3377241 48.87476549972337, 2.3376082 48.87478359972337, 2.3376066 48.87477919972339, 2.3375998 48.87478029972337, 2.337577099999999 48.87472049972339, 2.3374907 48.87473379972338, 2.3374961 48.87459949972342, 2.3374982 48.87454969972343, 2.3375389 48.87454889972344, 2.3375331 48.87447659972346, 2.3374803 48.87445059972346))")
poly_coords = np.array(polygon.exterior.coords)
tris = tripy.earclip(poly_coords)
for t in np.array(tris):
plt.plot(t[[0, 1, 2, 0], 0], t[[0, 1, 2, 0], 1])
plt.plot(poly_coords[:, 0], poly_coords[:, 1], 'k-', lw=3)
plt.show()It produces the following images:
| tripy-0.0.3 | tripy-1.0.0 |
|---|---|
![]() |
![]() |
As you can see in the second images, tripy was not able to produce any triangles.
I was reading the PR #2 and saw that you introduced some changes to handle some edge cases.
Is this a side effect ? Should the library be able to process this polygon (or not) ?
Should it at least produce some of the triangles ?
Metadata
Metadata
Assignees
Labels
No labels

