static private void FillBoundaryFace(TempMesh tempMesh, List <Vector3> added, ref Vector3[] tempTriangle) { // 1. Reorder added so in order ot their occurence along the perimeter. MeshUtils.ReorderList(added); // 2. Find actual face vertices var face = FindRealPolygon(added); // 3. Create triangle fans int t_fwd = 0, t_bwd = face.Count - 1, t_new = 1; bool incr_fwd = true; while (t_new != t_fwd && t_new != t_bwd) { MeshTools.AddTriangle(tempMesh, ref tempTriangle, face, t_bwd, t_fwd, t_new); if (incr_fwd) { t_fwd = t_new; } else { t_bwd = t_new; } incr_fwd = !incr_fwd; t_new = incr_fwd ? t_fwd + 1 : t_bwd - 1; } }