How to break a sprite into shapes with script

So I’m trying to make a sprite break into pieces with a script and I’ve found this post that cuts the original sprite into a bunch of squares. I would like to do this with any polygon.

58112-plshelp.png
In this picture the first example is what the script in the post could do, but I would like to be able to cut it into a shape such as a triangle like in the second example. How can I go about doing this?

https://forum.unity.com/threads/dynamic-2d-destruction.235005/