Beispiel #1
0
        private static void CreateFace()
        {
            if (Selection.objects.Length == 3)
            {
                var vertices = Utilities.Get3FromSelection <Vertex>();
                if (vertices.Item1 != null && vertices.Item2 != null && vertices.Item3 != null)
                {
                    var vertexArray = new[] { vertices.Item1, vertices.Item2, vertices.Item3 };
                    Utilities.ConnectUnconnectedVertices(vertexArray);
                    vertexArray = vertexArray.OrderBy(v => v.Index).ToArray();

                    Face3.Create(vertices.Item1.GeometryEditor, new Triangle(vertexArray[0], vertexArray[1], vertexArray[2]));
                }
            }
            else if (Selection.objects.Length == 4)
            {
                var vertices = Utilities.Get4FromSelection <Vertex>();
                if (vertices.Item1 != null && vertices.Item2 != null && vertices.Item3 != null && vertices.Item4 != null)
                {
                    var vertexArray = new[] { vertices.Item1, vertices.Item2, vertices.Item3, vertices.Item4 };
                    Utilities.ConnectUnconnectedVertices(vertexArray);
                    vertexArray = vertexArray.OrderBy(v => v.Index).ToArray();


                    Face4.Create(vertices.Item1.GeometryEditor, new Triangle(vertexArray[0], vertexArray[1], vertexArray[2]), new Triangle(vertexArray[3], vertexArray[2], vertexArray[1]));
                }
            }
        }