Optimize trianglify