Implemented a more robust flattening algorithm for splitting triangles.

In order to split a triangle using delaunay triangulation, it needs to be
in a 2D space. Previously this was done by flattening either the X,Y, or Z
axis. This usually worked, but had flaws. Therefore, the new approach
rotates the triangle into the YZ plane for the triangulation and then
rotates the split triangle back to the original location.