Revert "removed poly2tri"

This reverts commit ce98b4aac3893b202e7aa7d9c48cc4a288df522e.
Revert "Revert "removed poly2tri""

This reverts commit 59f924d171a8e2be96fc311c943e9406544439a9.
handled weird bug with memory access violation